json-multilevel-delta
v0.0.1
Published
A small delta calculator of two json objects (files)
Downloads
418
Maintainers
Readme
json-multilevel-delta
Compare two objects and return the difference
Install
npm install --save json-multilevel-delta
Usage
const jsonMultilevelDelta = require('json-multilevel-delta');
const objectA = { 'a': 'b', 'foo': { 'bar': 'baz', 'lorem': 'ipsum' } };
const objectB = { 'foo': { 'bar': 'baz' }, 'c': 'd' };
jsonMultilevelDelta(objectA, objectB);
// => [ 'a', 'foo.lorem', 'c' ]
jsonMultilevelDelta.json(objectA, objectB);
// => { 'a': 'b', 'foo': { 'lorem': 'ipsum' }, 'c': 'd' }
License
MIT © Sebastian Roming