https://github.com/tamino-martinius/meteor-deep-extend
Recursive object extending.
https://github.com/tamino-martinius/meteor-deep-extend
Last synced: 2 months ago
JSON representation
Recursive object extending.
- Host: GitHub
- URL: https://github.com/tamino-martinius/meteor-deep-extend
- Owner: tamino-martinius
- License: mit
- Created: 2014-03-01T13:26:31.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-04-11T14:01:24.000Z (about 7 years ago)
- Last Synced: 2025-01-06T03:22:26.295Z (4 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# deep-extend
[](https://travis-ci.org/tamino-martinius/meteor-deep-extend)
Recursive object extending.
Port from https://github.com/unclechu/node-deep-extend
## Usage
```js
var obj1 = {
a: 1,
b: 2,
d: {
a: 1,
b: [],
c: { test1: 123, test2: 321 }
},
f: 5,
g: 123
};
var obj2 = {
b: 3,
c: 5,
d: {
b: { first: 'one', second: 'two' },
c: { test2: 222 }
},
e: { one: 1, two: 2 },
f: [],
g: (void 0)
};deepExtend(obj1, obj2);
console.log(obj1);
/*
{ a: 1,
b: 3,
d:
{ a: 1,
b: { first: 'one', second: 'two' },
c: { test1: 123, test2: 222 } },
f: [],
c: 5,
e: { one: 1, two: 2 },
g: undefined }
*/
```