file-worker
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -132,3 +132,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return __generator(this, function (_a) { | ||
console.log(file); | ||
result = new Promise(function (resolve, reject) { | ||
@@ -135,0 +134,0 @@ var worker = WebWorkerHelper.createWebWorker(processor); |
@@ -218,3 +218,2 @@ ;(function(global) { | ||
return __generator(this, function (_a) { | ||
console.log(file); | ||
result = new Promise(function (resolve, reject) { | ||
@@ -221,0 +220,0 @@ var worker = WebWorkerHelper.createWebWorker(processor); |
@@ -1,1 +0,1 @@ | ||
!function(e){var t={},n={},r={},i={},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,u)}s((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,o=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){u.label=n[1];break}if(6===n[0]&&u.label<a[1]){u.label=a[1],a=n;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(n);break}a[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],o=0}finally{i=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,o,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return{next:n(0),throw:n(1),return:n(2)}};t=function(e){return Object.defineProperty(e,"__esModule",{value:!0}),e}(t),n=function(e){function t(){var e=__PROCESSOR__,t=function(){function e(e){this.file=e,this.currentReader=0}return e.prototype.read=function(e){var t=Math.min(this.file.size,this.currentReader+e);if(this.currentReader==this.file.size)this.onFinished();else{var n=this.file.slice(this.currentReader,t);this.currentReader=t;var r=new FileReaderSync,i=r.readAsArrayBuffer(n);this.onData(i),this.currentReader==this.file.size&&this.onFinished()}},e.prototype.readAll=function(){var e=new FileReaderSync,t=e.readAsArrayBuffer(this.file);this.onData(t),this.onFinished()},e}();self.addEventListener("message",function(n){var r=n.data,i=[],o=new t(r),a={write:function(e){i.push(e)},writeOnce:function(e){self.postMessage(e)},finish:function(){self.postMessage(i)}};try{e(o,a)}catch(e){self.postMessage({error:e.toString()})}})}function n(e){var n=t.toString();n=n.replace("__PROCESSOR__",e.toString()),n="("+n+")()";var r;try{r=new Blob([n],{type:"application/javascript"})}catch(e){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,r=new BlobBuilder,r.append(n),r=r.getBlob()}window.URL=window.URL||window.webkitURL;var i=URL.createObjectURL(r);return new Worker(i)}return Object.defineProperty(e,"__esModule",{value:!0}),e.createWebWorker=n,e}(n),r=function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(){}return e.readFile=function(e,n){return o(this,void 0,void 0,function(){var r;return a(this,function(i){return console.log(e),r=new Promise(function(r,i){var o=t.createWebWorker(n);o.postMessage(e),o.onmessage=function(e){r(e.data)}}),[2,r]})})},e}();return e.FileWorker=n,e}(r,n),i=function(e,t){return Object.defineProperty(e,"__esModule",{value:!0}),e.default=t.FileWorker,e}(i,r),e.FileWorker=i.default}(window); | ||
!function(e){var t={},n={},r={},i={},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,u)}s((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,o=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){u.label=n[1];break}if(6===n[0]&&u.label<a[1]){u.label=a[1],a=n;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(n);break}a[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],o=0}finally{i=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,o,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return{next:n(0),throw:n(1),return:n(2)}};t=function(e){return Object.defineProperty(e,"__esModule",{value:!0}),e}(t),n=function(e){function t(){var e=__PROCESSOR__,t=function(){function e(e){this.file=e,this.currentReader=0}return e.prototype.read=function(e){var t=Math.min(this.file.size,this.currentReader+e);if(this.currentReader==this.file.size)this.onFinished();else{var n=this.file.slice(this.currentReader,t);this.currentReader=t;var r=new FileReaderSync,i=r.readAsArrayBuffer(n);this.onData(i),this.currentReader==this.file.size&&this.onFinished()}},e.prototype.readAll=function(){var e=new FileReaderSync,t=e.readAsArrayBuffer(this.file);this.onData(t),this.onFinished()},e}();self.addEventListener("message",function(n){var r=n.data,i=[],o=new t(r),a={write:function(e){i.push(e)},writeOnce:function(e){self.postMessage(e)},finish:function(){self.postMessage(i)}};try{e(o,a)}catch(e){self.postMessage({error:e.toString()})}})}function n(e){var n=t.toString();n=n.replace("__PROCESSOR__",e.toString()),n="("+n+")()";var r;try{r=new Blob([n],{type:"application/javascript"})}catch(e){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,r=new BlobBuilder,r.append(n),r=r.getBlob()}window.URL=window.URL||window.webkitURL;var i=URL.createObjectURL(r);return new Worker(i)}return Object.defineProperty(e,"__esModule",{value:!0}),e.createWebWorker=n,e}(n),r=function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(){}return e.readFile=function(e,n){return o(this,void 0,void 0,function(){var r;return a(this,function(i){return r=new Promise(function(r,i){var o=t.createWebWorker(n);o.postMessage(e),o.onmessage=function(e){r(e.data)}}),[2,r]})})},e}();return e.FileWorker=n,e}(r,n),i=function(e,t){return Object.defineProperty(e,"__esModule",{value:!0}),e.default=t.FileWorker,e}(i,r),e.FileWorker=i.default}(window); |
@@ -46,3 +46,2 @@ "use strict"; | ||
return __generator(this, function (_a) { | ||
console.log(file); | ||
result = new Promise(function (resolve, reject) { | ||
@@ -49,0 +48,0 @@ var worker = WebWorkerHelper.createWebWorker(processor); |
{ | ||
"name": "file-worker", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Process files asynchronous at browser with web worker.", | ||
@@ -5,0 +5,0 @@ "main": "dist/commonjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37008
744