A javascript library for working with objects
Performs a deep comparison of two objects, returns a new object with only the first level values that have been changed or added on the second object
Param | Type |
---|---|
object1 | Object |
object2 | Object |
Example
import { diffUpdate } from 'object-agent';
const item1 = {
a: ['b'],
c: 'd',
e: null
}
const item2 = {
a: ['b'],
c: null,
e: null,
f: 'g'
}
diffUpdate(item1, item2);
// => { c: null, f: 'g' }