- support for web worker. #11

Changed
- throw error if input type is incorrect.
- prevent webpack to require dependencies.
This commit is contained in:
Chen, Yi-Cyuan
2017-07-14 13:10:27 +08:00
parent 8b9a23ce32
commit c00df3af37
15 changed files with 275 additions and 82 deletions
+12
View File
@@ -0,0 +1,12 @@
var imported = false;
onmessage = function(e) {
if (imported) {
postMessage(md5(e.data));
if (typeof exports !== 'undefined') {
imported = false;
}
} else {
imported = true;
importScripts(e.data);
}
}