module-workers-polyfill
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -13,6 +13,9 @@ (function(W) { | ||
try { | ||
new W("data:text/javascript,", OPTS).terminate(); | ||
} catch (e) { | ||
var url = URL.createObjectURL(new Blob([],{type:'text/javascript'})); | ||
new W(url, OPTS).terminate(); | ||
URL.revokeObjectURL(url); | ||
} catch (e) {} | ||
if (!s) { | ||
try { | ||
new W(URL.createObjectURL(new Blob([],{type:'text/javascript'})), OPTS).terminate(); | ||
new W("data:text/javascript,", OPTS).terminate(); | ||
} catch (e) {} | ||
@@ -19,0 +22,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e){if(!e||!0!==e._$P){var r,t=Object.defineProperty({},"type",{get:function(){r=!0}});try{new e("data:text/javascript,",t).terminate()}catch(r){try{new e(URL.createObjectURL(new Blob([],{type:"text/javascript"})),t).terminate()}catch(e){}}r||((self.Worker=function(r,t){return t&&"module"==t.type&&(t={name:r+"\n"+(t.name||"")},r="undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||(new Error).stack.match(/[(@]((file|https?):\/\/[^)]+?):\d+(:\d+)?(?:\)|$)/m)[1]),new e(r,t)})._$P=!0,"undefined"==typeof document&&function(){var e={},r={};function t(e,r){for(r=r.replace(/^(\.\.\/|\.\/)/,e.replace(/[^/]+$/g,"")+"$1");r!==(r=r.replace(/[^/]+\/\.\.\//g,"")););return r.replace(/\.\//g,"")}var n=[],s=n.push.bind(n);function a(){removeEventListener("message",s),n.map(dispatchEvent)}addEventListener("message",s);var u=self.name.match(/^[^\n]+/)[0];self.name=self.name.replace(/^[^\n]*\n/g,""),function n(s,a){var u,c=s;return a&&(s=t(a,s)),e[s]||(e[s]=fetch(s).then((function(a){if((c=a.url)!==s){if(null!=e[c])return e[c];e[c]=e[s]}return a.text().then((function(e){if(!a.ok)throw e;var o={exports:{}};u=r[c]||(r[c]=o.exports);var i=function(e){return n(e,c)},f=[];return e=function(e,r){r=r||[];var t,n=[],a=0;function u(e,r){for(var s,a=/(?:^|,)\s*([\w$]+)(?:\s+as\s+([\w$]+))?\s*/g,u=[];s=a.exec(e);)r?n.push((s[2]||s[1])+":"+s[1]):u.push((s[2]||s[1])+"="+t+"."+s[1]);return u}return(e=e.replace(/(^\s*|[;}\s\n]\s*)import\s*(?:(?:([\w$]+)(?:\s*\,\s*\{([^}]+)\})?|\{([^}]*)\})\s*from)?\s*(['"])(.+?)\5/g,(function(e,n,s,c,o,i,f){return r.push(f),n+="var "+(t="$im$"+ ++a)+"=$require("+i+f+i+")",s&&(n+=";var "+s+" = 'default' in "+t+" ? "+t+".default : "+t),(c=c||o)&&(n+=";var "+u(c,!1)),n})).replace(/((?:^|[;}\s\n])\s*)export\s*(?:\s+(default)\s+|((?:async\s+)?function\s*\*?|class|const\s|let\s|var\s)\s*([a-zA-Z0-9$_{[]+))/g,(function(e,r,t,s,u){if(t){var c="$im$"+ ++a;return n.push("default:"+c),r+"var "+c+"="}return n.push(u+":"+u),r+s+" "+u})).replace(/((?:^|[;}\s\n])\s*)export\s*\{([^}]+)\}\s*;?/g,(function(e,r,t){return u(t,!0),r})).replace(/((?:^|[^a-zA-Z0-9$_@`'".])\s*)(import\s*\([\s\S]+?\))/g,"$1$$$2")).replace(/((?:^|[^a-zA-Z0-9$_@`'".])\s*)import\.meta\.url/g,"$1"+JSON.stringify(s))+"\n$module.exports={"+n.join(",")+"}"}(e,f),Promise.all(f.map((function(e){var s=t(c,e);return s in r?r[s]:n(s)}))).then((function(r){e+="\n//# sourceURL="+s;var t=new Function("$import","$require","$module","$exports",e)(i,(function(e){return r[f.indexOf(e)]}),o,o.exports);return null!=t&&(o.exports=t),Object.assign(u,o.exports),o.exports}))}))})))}(u).then(a,a)}())}}(self.Worker); | ||
!function(e){if(!e||!0!==e._$P){var r,t=Object.defineProperty({},"type",{get:function(){r=!0}});try{var n=URL.createObjectURL(new Blob([],{type:"text/javascript"}));new e(n,t).terminate(),URL.revokeObjectURL(n)}catch(e){}if(!r)try{new e("data:text/javascript,",t).terminate()}catch(e){}r||((self.Worker=function(r,t){return t&&"module"==t.type&&(t={name:r+"\n"+(t.name||"")},r="undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||(new Error).stack.match(/[(@]((file|https?):\/\/[^)]+?):\d+(:\d+)?(?:\)|$)/m)[1]),new e(r,t)})._$P=!0,"undefined"==typeof document&&function(){var e={},r={};function t(e,r){for(r=r.replace(/^(\.\.\/|\.\/)/,e.replace(/[^/]+$/g,"")+"$1");r!==(r=r.replace(/[^/]+\/\.\.\//g,"")););return r.replace(/\.\//g,"")}var n=[],s=n.push.bind(n);function a(){removeEventListener("message",s),n.map(dispatchEvent)}addEventListener("message",s);var u=self.name.match(/^[^\n]+/)[0];self.name=self.name.replace(/^[^\n]*\n/g,""),function n(s,a){var u,c=s;return a&&(s=t(a,s)),e[s]||(e[s]=fetch(s).then((function(a){if((c=a.url)!==s){if(null!=e[c])return e[c];e[c]=e[s]}return a.text().then((function(e){if(!a.ok)throw e;var o={exports:{}};u=r[c]||(r[c]=o.exports);var i=function(e){return n(e,c)},f=[];return e=function(e,r){r=r||[];var t,n=[],a=0;function u(e,r){for(var s,a=/(?:^|,)\s*([\w$]+)(?:\s+as\s+([\w$]+))?\s*/g,u=[];s=a.exec(e);)r?n.push((s[2]||s[1])+":"+s[1]):u.push((s[2]||s[1])+"="+t+"."+s[1]);return u}return(e=e.replace(/(^\s*|[;}\s\n]\s*)import\s*(?:(?:([\w$]+)(?:\s*\,\s*\{([^}]+)\})?|\{([^}]*)\})\s*from)?\s*(['"])(.+?)\5/g,(function(e,n,s,c,o,i,f){return r.push(f),n+="var "+(t="$im$"+ ++a)+"=$require("+i+f+i+")",s&&(n+=";var "+s+" = 'default' in "+t+" ? "+t+".default : "+t),(c=c||o)&&(n+=";var "+u(c,!1)),n})).replace(/((?:^|[;}\s\n])\s*)export\s*(?:\s+(default)\s+|((?:async\s+)?function\s*\*?|class|const\s|let\s|var\s)\s*([a-zA-Z0-9$_{[]+))/g,(function(e,r,t,s,u){if(t){var c="$im$"+ ++a;return n.push("default:"+c),r+"var "+c+"="}return n.push(u+":"+u),r+s+" "+u})).replace(/((?:^|[;}\s\n])\s*)export\s*\{([^}]+)\}\s*;?/g,(function(e,r,t){return u(t,!0),r})).replace(/((?:^|[^a-zA-Z0-9$_@`'".])\s*)(import\s*\([\s\S]+?\))/g,"$1$$$2")).replace(/((?:^|[^a-zA-Z0-9$_@`'".])\s*)import\.meta\.url/g,"$1"+JSON.stringify(s))+"\n$module.exports={"+n.join(",")+"}"}(e,f),Promise.all(f.map((function(e){var s=t(c,e);return s in r?r[s]:n(s)}))).then((function(r){e+="\n//# sourceURL="+s;var t=new Function("$import","$require","$module","$exports",e)(i,(function(e){return r[f.indexOf(e)]}),o,o.exports);return null!=t&&(o.exports=t),Object.assign(u,o.exports),o.exports}))}))})))}(u).then(a,a)}())}}(self.Worker); |
{ | ||
"name": "module-workers-polyfill", | ||
"main": "module-workers-polyfill.min.js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "homepage": "https://gist.github.com/developit/220246bc99044af74a6680ce13284f59", |
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
9116
131