Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.
/ eqson Public archive

JSON that optimized to have a same reference when a same contents

Notifications You must be signed in to change notification settings

mohayonao/eqson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

JSON that optimized to have a same reference when a same contents

Resources

Stars

Watchers

Forks

Packages

No packages published