deep-override
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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'
    }
  ]
}
*/

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.2114,896latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.2114,896
1.0.13
1.0.01

Package Sidebar

Install

npm i deep-override

Weekly Downloads

83,730

Version

1.0.2

License

MIT

Unpacked Size

4.9 kB

Total Files

5

Last publish

Collaborators

  • asaianudeep