Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webworkify

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webworkify - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

26

index.js

@@ -11,6 +11,11 @@ var bundleFn = arguments[3];

var cacheKeys = Object.keys(cache);
for (var i = 0, l = cacheKeys.length; i < l; i++) {
var key = cacheKeys[i];
if (cache[key].exports === fn) {
var exp = cache[key].exports;
// Using babel as a transpiler to use esmodule, the export will always
// be an object with the default export as a property of it. To ensure
// the existing api and babel esmodule exports are both supported we
// check for both
if (exp === fn || exp.default === fn) {
wkey = key;

@@ -20,3 +25,3 @@ break;

}
if (!wkey) {

@@ -35,9 +40,14 @@ wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);

var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
var scache = {}; scache[wkey] = wkey;
sources[skey] = [
Function(['require'],'require(' + stringify(wkey) + ')(self)'),
Function(['require'], (
// try to call default if defined to also support babel esmodule
// exports
'var f = require(' + stringify(wkey) + ');' +
'(f.default ? f.default : f)(self);'
)),
scache
];
var src = '(' + bundleFn + ')({'

@@ -52,5 +62,5 @@ + Object.keys(sources).map(function (key) {

;
var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
return new Worker(URL.createObjectURL(

@@ -57,0 +67,0 @@ new Blob([src], { type: 'text/javascript' })

{
"name": "webworkify",
"version": "1.0.2",
"version": "1.1.0",
"description": "launch a web worker that can require() in the browser with browserify",

@@ -5,0 +5,0 @@ "main": "index.js",

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