Updates ONLY existing properties!!
var updateObj = require('object-deep-update');
var obj1 = {
t: 'test1',
te: {
t: tt,
e: ee
},
ff: ['tt', 'ee', 'te']
};
var obj2 = {
t: 'test2',
te: {
t: xx,
e: yy
},
ff: ['xx', 'yy', 'zz'],
qq: 'omg!'
};
var result = updateObj(obj1, obj2);
{
t: 'test2',
te: {
t: xx,
e: yy
},
ff: ['xx', 'yy', 'zz']
}
npm test
MIT © Zarko Selak