deep-override
v1.0.2
Published
recursive object extending & overriding
Downloads
730,894
Maintainers
Readme
deep-override
recursive object extending & overriding
const override = require('deep-override');
const target = {
Name: 'Snow',
Age: 10,
Addresses: [
{
House: 'Stark',
Castle: 'WinterFell'
}
]
};
const source = {
Pet: 'Ghost',
Addresses: [
{
House: 'Dragon'
}
]
}
override(target, source);
console.log(target);
/*
{
Name: 'Snow',
Age: 10,
Pet: 'Ghost',
Addresses: [
{
House: 'Dragon',
Castle: 'WinterFell'
}
]
}
*/