Socket
Socket
Sign inDemoInstall

worktank

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worktank - npm Package Compare versions

Comparing version 2.7.2 to 2.7.3

2

dist/worker/backend_compiled.d.ts

@@ -1,2 +0,2 @@

declare const _default: "globalThis.WorkTankWorkerBackend=new class{constructor(){this.methods={};addEventListener(\"message\",this.message.bind(this))}exec(s,t){let a=this.methods[s],r=new Promise(e=>e(a.apply(void 0,t))),i=e=>{try{postMessage({type:\"result\",value:e})}catch(o){n(o)}},n=e=>{e=e instanceof Error?e:typeof e==\"string\"?new Error(e):new Error;let{message:o,name:c,stack:d}=e;postMessage({type:\"result\",error:{message:o,name:c,stack:d}})};r.then(i,n)}message(s){if(s.data.type===\"exec\")return this.exec(s.data.method,s.data.args)}ready(){postMessage({type:\"ready\"})}register(s,t){this.methods[s]=t}};globalThis.process||(globalThis.process={});globalThis.process.env={...globalThis.process.env,...JSON.parse(\"/*! ENV_PLACEHOLDER !*/\")}; /*! METHODS_PLACEHOLDER !*/";
declare const _default: "globalThis.WorkTankWorkerBackend=new class{constructor(){this.methods={};addEventListener(\"message\",this.message.bind(this))}exec(e,t){let a=this.methods[e],r=new Promise(s=>s(a.apply(void 0,t))),i=s=>{try{postMessage({type:\"result\",value:s})}catch(o){n(o)}},n=s=>{s=s instanceof Error?s:typeof s==\"string\"?new Error(s):new Error;let{message:o,name:c,stack:d}=s;postMessage({type:\"result\",error:{message:o,name:c,stack:d}})};r.then(i,n)}message(e){if(e.data.type===\"exec\")return this.exec(e.data.method,e.data.args)}ready(){postMessage({type:\"ready\"})}register(e,t){this.methods[e]=t}};globalThis.process||(globalThis.process={});globalThis.process.env={...globalThis.process.env,...globalThis.process.ENV_PLACEHOLDER}; /*! METHODS_PLACEHOLDER !*/";
export default _default;

@@ -1,1 +0,1 @@

export default 'globalThis.WorkTankWorkerBackend=new class{constructor(){this.methods={};addEventListener("message",this.message.bind(this))}exec(s,t){let a=this.methods[s],r=new Promise(e=>e(a.apply(void 0,t))),i=e=>{try{postMessage({type:"result",value:e})}catch(o){n(o)}},n=e=>{e=e instanceof Error?e:typeof e=="string"?new Error(e):new Error;let{message:o,name:c,stack:d}=e;postMessage({type:"result",error:{message:o,name:c,stack:d}})};r.then(i,n)}message(s){if(s.data.type==="exec")return this.exec(s.data.method,s.data.args)}ready(){postMessage({type:"ready"})}register(s,t){this.methods[s]=t}};globalThis.process||(globalThis.process={});globalThis.process.env={...globalThis.process.env,...JSON.parse("/*! ENV_PLACEHOLDER !*/")}; /*! METHODS_PLACEHOLDER !*/';
export default 'globalThis.WorkTankWorkerBackend=new class{constructor(){this.methods={};addEventListener("message",this.message.bind(this))}exec(e,t){let a=this.methods[e],r=new Promise(s=>s(a.apply(void 0,t))),i=s=>{try{postMessage({type:"result",value:s})}catch(o){n(o)}},n=s=>{s=s instanceof Error?s:typeof s=="string"?new Error(s):new Error;let{message:o,name:c,stack:d}=s;postMessage({type:"result",error:{message:o,name:c,stack:d}})};r.then(i,n)}message(e){if(e.data.type==="exec")return this.exec(e.data.method,e.data.args)}ready(){postMessage({type:"ready"})}register(e,t){this.methods[e]=t}};globalThis.process||(globalThis.process={});globalThis.process.env={...globalThis.process.env,...globalThis.process.ENV_PLACEHOLDER}; /*! METHODS_PLACEHOLDER !*/';

@@ -45,5 +45,5 @@ /* IMPORT */

...globalThis.process.env,
...JSON.parse("/*! ENV_PLACEHOLDER !*/")
...globalThis.process.ENV_PLACEHOLDER
};
export {};
/*! METHODS_PLACEHOLDER !*/

@@ -8,3 +8,3 @@ /* IMPORT */

constructor(env, methods, name, listener) {
const code = `data:text/javascript;charset=utf-8,${encodeURIComponent(WorkerBackend.replace('"/*! ENV_PLACEHOLDER !*/"', `'${JSON.stringify(env)}'`).replace('/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}`))}`;
const code = `data:text/javascript;charset=utf-8,${encodeURIComponent(WorkerBackend.replace('globalThis.process.ENV_PLACEHOLDER', JSON.stringify(env)).replace('/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}`))}`;
this.worker = new WorkerShim(code, { name, type: 'module' });

@@ -11,0 +11,0 @@ this.listen(listener);

@@ -5,3 +5,3 @@ {

"description": "A simple isomorphic library for executing functions inside WebWorkers or Node Threads pools.",
"version": "2.7.2",
"version": "2.7.3",
"type": "module",

@@ -8,0 +8,0 @@ "main": "dist/index.js",

@@ -1,1 +0,1 @@

export default 'globalThis.WorkTankWorkerBackend=new class{constructor(){this.methods={};addEventListener("message",this.message.bind(this))}exec(s,t){let a=this.methods[s],r=new Promise(e=>e(a.apply(void 0,t))),i=e=>{try{postMessage({type:"result",value:e})}catch(o){n(o)}},n=e=>{e=e instanceof Error?e:typeof e=="string"?new Error(e):new Error;let{message:o,name:c,stack:d}=e;postMessage({type:"result",error:{message:o,name:c,stack:d}})};r.then(i,n)}message(s){if(s.data.type==="exec")return this.exec(s.data.method,s.data.args)}ready(){postMessage({type:"ready"})}register(s,t){this.methods[s]=t}};globalThis.process||(globalThis.process={});globalThis.process.env={...globalThis.process.env,...JSON.parse("/*! ENV_PLACEHOLDER !*/")}; /*! METHODS_PLACEHOLDER !*/';
export default 'globalThis.WorkTankWorkerBackend=new class{constructor(){this.methods={};addEventListener("message",this.message.bind(this))}exec(e,t){let a=this.methods[e],r=new Promise(s=>s(a.apply(void 0,t))),i=s=>{try{postMessage({type:"result",value:s})}catch(o){n(o)}},n=s=>{s=s instanceof Error?s:typeof s=="string"?new Error(s):new Error;let{message:o,name:c,stack:d}=s;postMessage({type:"result",error:{message:o,name:c,stack:d}})};r.then(i,n)}message(e){if(e.data.type==="exec")return this.exec(e.data.method,e.data.args)}ready(){postMessage({type:"ready"})}register(e,t){this.methods[e]=t}};globalThis.process||(globalThis.process={});globalThis.process.env={...globalThis.process.env,...globalThis.process.ENV_PLACEHOLDER}; /*! METHODS_PLACEHOLDER !*/';

@@ -76,5 +76,5 @@

...globalThis.process.env,
...JSON.parse ( "/*! ENV_PLACEHOLDER !*/" )
...globalThis.process.ENV_PLACEHOLDER
};
/*! METHODS_PLACEHOLDER !*/

@@ -20,3 +20,3 @@

const code = `data:text/javascript;charset=utf-8,${encodeURIComponent ( WorkerBackend.replace ( '"/*! ENV_PLACEHOLDER !*/"', `'${JSON.stringify ( env )}'` ).replace ( '/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}` ) )}`;
const code = `data:text/javascript;charset=utf-8,${encodeURIComponent ( WorkerBackend.replace ( 'globalThis.process.ENV_PLACEHOLDER', JSON.stringify ( env ) ).replace ( '/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}` ) )}`;

@@ -23,0 +23,0 @@ this.worker = new WorkerShim ( code, { name, type: 'module' } );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc