UNPKG

@substrate-system/fflate

Version:

High performance (de)compression in an 8kB package

3 lines (2 loc) 1.28 kB
var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var _=(e,r)=>l(e,"name",{value:r,configurable:!0});var w=(e,r)=>{for(var o in r)l(e,o,{get:r[o],enumerable:!0})},g=(e,r,o,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of p(r))!d.call(e,t)&&t!==o&&l(e,t,{get:()=>r[t],enumerable:!(s=m(r,t))||s.enumerable});return e};var f=e=>g(l({},"__esModule",{value:!0}),e);var h={};w(h,{default:()=>c});module.exports=f(h);let i;const k=";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global";try{i=require("worker_threads").Worker}catch{}var c=i?(e,r,o,s,t)=>{let a=!1;const u=new i(e+k,{eval:!0}).on("error",n=>t(n,null)).on("message",n=>t(null,n)).on("exit",n=>{n&&!a&&t(new Error("exited with code "+n),null)});return u.postMessage(o,s),u.terminate=()=>(a=!0,i.prototype.terminate.call(u)),u}:(e,r,o,s,t)=>{setImmediate(()=>t(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"),null));const a=_(()=>{},"NOP");return{terminate:a,postMessage:a}}; //# sourceMappingURL=node-worker.min.cjs.map