Compare two objects and return the difference
npm install --save json-multilevel-delta
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' }
MIT © Sebastian Roming