Skip to content

sebastianroming/json-multilevel-delta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-multilevel-delta Build Status

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