UNPKG

fflate

Version:

High performance (de)compression in an 8kB package

11 lines (10 loc) 388 B
"use strict"; var ch2 = {}; exports["default"] = (function (c, id, msg, transfer, cb) { var u = ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([c], { type: 'text/javascript' }))); var w = new Worker(u); w.onerror = function (e) { return cb(e.error, null); }; w.onmessage = function (e) { return cb(null, e.data); }; w.postMessage(msg, transfer); return w; });