1.0.1 • Published 7 years ago

eqson v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

eqson

Build Status NPM Version License

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