Skip to content

Commit

Permalink
Merge pull request #3 from Geta/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
eirhor authored Jul 29, 2017
2 parents 09c15ee + 6957453 commit d0b20a8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
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

0 comments on commit d0b20a8

Please sign in to comment.