Skip to content

Develop #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
language: node_js
node_js:
- 8
- 7
- 6
- "0.10"
- "0.12"
- "iojs"
env:
- TEST_SUITE=unit
script:
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# NestedObjectAssign
[![Build Status](https://travis-ci.org/Geta/NestedObjectAssign.svg?branch=master)](https://travis-ci.org/Geta/NestedObjectAssign)
[![dependencies Status](https://david-dm.org/geta/NestedObjectAssign/status.svg)](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
Add the empty object first, then any objects you want merged into it after. unlimited amount of params.
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 = {}

Example: `nestedObjectAssign({}, defaults, object1, object2, object3)`
function test() {
let data = nestedObjectAssign({}, defaults, object1, object2, object3);
}
```

## Tests
Tests are done using mocha. to run tests, simply type `npm run tests`.
Tests were done for these node.js versions:
* 8
* 7
* 6
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nested-object-assign",
"version": "1.0.0",
"version": "1.0.1",
"description": "Package to support nested merging of objects & properties, using Object.Assign",
"main": "./index.js",
"scripts": {
Expand Down