1 |
3a515b92
|
cagy
|
# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow)
|
2 |
|
|
|
3 |
|
|
> Extend an object with the properties of additional objects. node.js/javascript util.
|
4 |
|
|
|
5 |
|
|
## Install
|
6 |
|
|
|
7 |
|
|
Install with [npm](https://www.npmjs.com/)
|
8 |
|
|
|
9 |
|
|
```sh
|
10 |
|
|
$ npm i extend-shallow --save
|
11 |
|
|
```
|
12 |
|
|
|
13 |
|
|
## Usage
|
14 |
|
|
|
15 |
|
|
```js
|
16 |
|
|
var extend = require('extend-shallow');
|
17 |
|
|
|
18 |
|
|
extend({a: 'b'}, {c: 'd'})
|
19 |
|
|
//=> {a: 'b', c: 'd'}
|
20 |
|
|
```
|
21 |
|
|
|
22 |
|
|
Pass an empty object to shallow clone:
|
23 |
|
|
|
24 |
|
|
```js
|
25 |
|
|
var obj = {};
|
26 |
|
|
extend(obj, {a: 'b'}, {c: 'd'})
|
27 |
|
|
//=> {a: 'b', c: 'd'}
|
28 |
|
|
```
|
29 |
|
|
|
30 |
|
|
## Related
|
31 |
|
|
|
32 |
|
|
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
|
33 |
|
|
* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own)
|
34 |
|
|
* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in)
|
35 |
|
|
* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
|
36 |
|
|
* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
|
37 |
|
|
* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
|
38 |
|
|
|
39 |
|
|
## Running tests
|
40 |
|
|
|
41 |
|
|
Install dev dependencies:
|
42 |
|
|
|
43 |
|
|
```sh
|
44 |
|
|
$ npm i -d && npm test
|
45 |
|
|
```
|
46 |
|
|
|
47 |
|
|
## Author
|
48 |
|
|
|
49 |
|
|
**Jon Schlinkert**
|
50 |
|
|
|
51 |
|
|
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
52 |
|
|
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
53 |
|
|
|
54 |
|
|
## License
|
55 |
|
|
|
56 |
|
|
Copyright © 2015 Jon Schlinkert
|
57 |
|
|
Released under the MIT license.
|
58 |
|
|
|
59 |
|
|
***
|
60 |
|
|
|
61 |
|
|
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._
|