Socket
Socket
Sign inDemoInstall

structural-sharing

Package Overview
Dependencies
62
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "structural-sharing",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

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

@@ -29,3 +29,4 @@ # js-structural-sharing

assert.isTrue(shareMemory(o, a2));
assert.isTrue(shareMemory(a1, a2));
assert.isTrue(shareMemory(a1, a2));
assert.isFalse(shareMemory(a1, JSON.parse(JSON.stringify(a2))));

@@ -32,0 +33,0 @@ ```

@@ -50,9 +50,15 @@ /* @flow */

, function () {
this.timeout(10000);
this.timeout(20000);
const o = {};
const a1 = {a1: {a2: {v:1, y:2}, a3: o}, a4: [1,2,3,4]};
const a2 = {a1: {a2: [1, 2,3, [1, 3, [1, 2, o]]]}, a4: [1,2,3,4]};
const a2 = {a1: {a2: [1, 2,3, [1, 3, [1, 2, o]]]}, a4: [1,2,3,4]};
assert.isTrue(shareMemory(o, o));
assert.isTrue(shareMemory(o, a1));
assert.isTrue(shareMemory(o, a2));
assert.isTrue(shareMemory(a1, a2));
assert.isTrue(shareMemory(a1, a2));
assert.isTrue(shareMemory(a1, a1));
assert.isFalse(shareMemory(a1, JSON.parse(JSON.stringify(a2))));
assert.isFalse(shareMemory(o, JSON.parse(JSON.stringify(o))));
assert.isFalse(shareMemory(a1, JSON.parse(JSON.stringify(a1))));
assert.isFalse(shareMemory(a2, JSON.parse(JSON.stringify(a2))));
});

@@ -59,0 +65,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc