https://github.com/geta/nestedobjectassign
https://github.com/geta/nestedobjectassign
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/geta/nestedobjectassign
- Owner: Geta
- License: mit
- Created: 2017-06-02T08:48:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T10:34:29.000Z (about 3 years ago)
- Last Synced: 2025-04-05T03:23:35.919Z (9 months ago)
- Language: JavaScript
- Size: 308 KB
- Stars: 7
- Watchers: 22
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NestedObjectAssign
[](https://travis-ci.org/Geta/NestedObjectAssign)
[](https://david-dm.org/geta/NestedObjectAssign)
This package extends the functionality given by Object.assign() to also include the values of nested objects.
## Installation
```
npm install --save nested-object-assign
```
## Usage
Works just like Object.Assign, add an empty object first (the object you want the other objects merged into), then as many objects as you wish afterwards, comma separated.
```js
import nestedObjectAssign from 'nested-object-assign';
const defaults = {}
function test() {
let data = nestedObjectAssign({}, defaults, object1, object2, object3);
}
```
## Tests
Tests were done for these node.js versions:
* 8
* 7
* 6