js-structural-sharing
Tests whether two objects (recursively) have structural sharing. In other words, whether they access a common memory location. If the exported method shareMemory returns false then each of the objects can be modified, anywhere in its graph, without affecting the other.
Installation
npm install structural-sharing --save
Usage
Examples
const o = {}; const a1 = a1: a2: v:1 y:2 a3: o a4: 1234; const a2 = a1: a2: 1 23 1 3 1 2 o a4: 1234; assert; assert; assert; assert;
For more examples look in file test.js
Tests
npm test