eqson

1.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i eqson

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mohayonao