https://github.com/sindresorhus/deep-assign
[DEPRECATED] Recursive Object.assign()
https://github.com/sindresorhus/deep-assign
deprecated nodejs
Last synced: about 2 months ago
JSON representation
[DEPRECATED] Recursive Object.assign()
- Host: GitHub
- URL: https://github.com/sindresorhus/deep-assign
- Owner: sindresorhus
- License: mit
- Archived: true
- Created: 2015-09-14T08:54:25.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2021-01-23T09:11:08.000Z (almost 5 years ago)
- Last Synced: 2025-09-11T02:28:05.632Z (2 months ago)
- Topics: deprecated, nodejs
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 247
- Watchers: 11
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-micro-npm-packages-zh - deep-assign
- awesome-micro-npm-packages - deep-assign - Recursive Object.assign(). (Modules / Object)
- fucking-awesome-micro-npm-packages - deep-assign - Recursive Object.assign(). (Modules / Object)
- awesome-nodejs-precise - deep-assign - assign .svg?style=social&label=Star&maxAge=2592000?style=flat-square)]() | Recursive <code>Object.assign()</code>. | (Packages / Miscellaneous)
- awesome-nodejs-cn - deep-assign - Recursive `Object.assign()`. (Number / Miscellaneous)
README
# DEPRECATED
Version 2 of this module ended up being [something I don't want](https://github.com/sindresorhus/deep-assign/issues/6) and I don't have time to fix it.
Check out [`lodash.merge`](https://lodash.com/docs/#merge) or [`merge-options`](https://github.com/schnittstabil/merge-options) instead.
---
# deep-assign [](https://travis-ci.org/sindresorhus/deep-assign)
> Recursive [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
## Install
```
$ npm install --save deep-assign
```
## Usage
```js
var deepAssign = require('deep-assign');
deepAssign({a: {b: 0}}, {a: {b: 1, c: 2}}, {a: {c: 3}});
//=> {a: {b: 1, c: 3}}
```
### deepAssign(target, source, [source, ...])
Recursively assigns own enumerable properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
## Related
- [object-assign](https://github.com/sindresorhus/object-assign) - ES2015 Object.assign() ponyfill
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)