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

isoworker

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isoworker - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

22

esm/browser.js

@@ -41,2 +41,6 @@ var wk = function (c, msg, transfer, cb) {

};
// optional chaining
var chainWrap = function (name, expr, short) {
return "(" + expr + "||(" + short + "={}))" + name;
};
var encoder = {

@@ -165,8 +169,22 @@ undefined: function () { return 'void 0'; },

var key = depNames[i], value = depValues[i];
var parts = key
.replace(/\\/, '')
.match(/^(.*?)(?=(\.|\[|$))|\[(.*?)\]|(\.(.*?))(?=(\.|\[|$))/g);
var v = encoder[typeof value](value, reg, ab);
if (typeof v == 'string') {
out += "self[" + encoder.string(key) + "]=" + v + ";";
var pfx = 'self.' + parts[0];
var chain = pfx;
for (var i_1 = 1; i_1 < parts.length; ++i_1) {
chain = chainWrap(parts[i_1], chain, pfx);
pfx += parts[i_1];
}
out += chain + "=" + v + ";";
}
else {
dat[key] = v;
// TODO: overwrite instead of assign
var obj = dat;
for (var i_2 = 0; i_2 < parts.length - 1; ++i_2) {
obj = obj[parts[i_2]] = {};
}
obj[parts[parts.length - 1]] = v;
}

@@ -173,0 +191,0 @@ }

@@ -44,2 +44,6 @@ "use strict";

};
// optional chaining
var chainWrap = function (name, expr, short) {
return "(" + expr + "||(" + short + "={}))" + name;
};
var encoder = {

@@ -168,8 +172,22 @@ undefined: function () { return 'void 0'; },

var key = depNames[i], value = depValues[i];
var parts = key
.replace(/\\/, '')
.match(/^(.*?)(?=(\.|\[|$))|\[(.*?)\]|(\.(.*?))(?=(\.|\[|$))/g);
var v = encoder[typeof value](value, reg, ab);
if (typeof v == 'string') {
out += "self[" + encoder.string(key) + "]=" + v + ";";
var pfx = 'self.' + parts[0];
var chain = pfx;
for (var i_1 = 1; i_1 < parts.length; ++i_1) {
chain = chainWrap(parts[i_1], chain, pfx);
pfx += parts[i_1];
}
out += chain + "=" + v + ";";
}
else {
dat[key] = v;
// TODO: overwrite instead of assign
var obj = dat;
for (var i_2 = 0; i_2 < parts.length - 1; ++i_2) {
obj = obj[parts[i_2]] = {};
}
obj[parts[parts.length - 1]] = v;
}

@@ -176,0 +194,0 @@ }

@@ -30,2 +30,6 @@ "use strict";

};
// optional chaining
var chainWrap = function (name, expr, short) {
return "(" + expr + "||(" + short + "={}))" + name;
};
var encoder = {

@@ -154,8 +158,22 @@ undefined: function () { return 'void 0'; },

var key = depNames[i], value = depValues[i];
var parts = key
.replace(/\\/, '')
.match(/^(.*?)(?=(\.|\[|$))|\[(.*?)\]|(\.(.*?))(?=(\.|\[|$))/g);
var v = encoder[typeof value](value, reg, ab);
if (typeof v == 'string') {
out += "self[" + encoder.string(key) + "]=" + v + ";";
var pfx = 'self.' + parts[0];
var chain = pfx;
for (var i_1 = 1; i_1 < parts.length; ++i_1) {
chain = chainWrap(parts[i_1], chain, pfx);
pfx += parts[i_1];
}
out += chain + "=" + v + ";";
}
else {
dat[key] = v;
// TODO: overwrite instead of assign
var obj = dat;
for (var i_2 = 0; i_2 < parts.length - 1; ++i_2) {
obj = obj[parts[i_2]] = {};
}
obj[parts[parts.length - 1]] = v;
}

@@ -162,0 +180,0 @@ }

@@ -45,2 +45,6 @@ "use strict";

};
// optional chaining
var chainWrap = function (name, expr, short) {
return "(" + expr + "||(" + short + "={}))" + name;
};
var encoder = {

@@ -169,8 +173,22 @@ undefined: function () { return 'void 0'; },

var key = depNames[i], value = depValues[i];
var parts = key
.replace(/\\/, '')
.match(/^(.*?)(?=(\.|\[|$))|\[(.*?)\]|(\.(.*?))(?=(\.|\[|$))/g);
var v = encoder[typeof value](value, reg, ab);
if (typeof v == 'string') {
out += "self[" + encoder.string(key) + "]=" + v + ";";
var pfx = 'self.' + parts[0];
var chain = pfx;
for (var i_1 = 1; i_1 < parts.length; ++i_1) {
chain = chainWrap(parts[i_1], chain, pfx);
pfx += parts[i_1];
}
out += chain + "=" + v + ";";
}
else {
dat[key] = v;
// TODO: overwrite instead of assign
var obj = dat;
for (var i_2 = 0; i_2 < parts.length - 1; ++i_2) {
obj = obj[parts[i_2]] = {};
}
obj[parts[parts.length - 1]] = v;
}

@@ -177,0 +195,0 @@ }

2

package.json
{
"name": "isoworker",
"version": "0.0.1",
"version": "0.1.0",
"description": "Isomorphic workerization with dependencies",

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

@@ -18,3 +18,3 @@ # isoworker

Install:
```
```sh
npm i isoworker # or yarn add isoworker, or pnpm add isoworker

@@ -21,0 +21,0 @@ ```

Sorry, the diff of this file is not supported yet

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