eqson
v1.0.1
Published
JSON that optimized to have a same reference when a same contents
Downloads
1
Readme
eqson
JSON that optimized to have a same reference when a same contents.
Installation
$ npm install --save eqson
Example
const eqson = require("eqson");
const a = { foo: [ 100 ], bar: [ 100 ], baz: [ 10, [ 100 ] ] };
const b = eqson(a);
b
has the same contents as a
.
assert.deepEqual(a, b);
b.foo
and b.bar
, b.baz[1]
have a same reference.
assert(b.foo === b.bar);
assert(b.foo === b.baz[1]);
License
MIT