Skip to content

Commit

Permalink
adding shallow doc
Browse files Browse the repository at this point in the history
  • Loading branch information
selfcontained committed May 8, 2013
1 parent 5ca690f commit 1fd6180
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm install deap
var deap = require('deap');
```

### Available functions
### available functions

+ deap() and deap.extend() - **deep extend**
+ deap.merge() - **deep merge**
Expand Down Expand Up @@ -49,3 +49,17 @@ Takes *n* number of arguments, modifies the first argument and returns it.
var a = { name: 'Joe', phone: '' };
deap.merge(a, { age: 26, phone: '555-555-5555' }); // returns: a => { name: 'Joe', phone: '555-555-5555' }
```

---

## shallow only

If you prefer a shallow-only instance of **deap** you can require it specifically

```javascript
var deap = require('deap/shallow');

deap() && deap.extend(); // shallow extend
deap.merge(); //shallow merge
deap.clone(); // deep clone
```

0 comments on commit 1fd6180

Please sign in to comment.