arnaucube
arnaucube/socketioMEANseedPublic Self-hosted repository
socketioMEANseed/server/node_modules/object-assign/readme.md
server/node_modules/object-assign/readme.mdRaw
 1# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)
 2
 3> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill
 4
 5> Ponyfill: A polyfill that doesn't overwrite the native method
 6
 7
 8## Install
 9
10```
11$ npm install --save object-assign
12```
13
14
15## Usage
16
17```js
18const objectAssign = require('object-assign');
19
20objectAssign({foo: 0}, {bar: 1});
21//=> {foo: 0, bar: 1}
22
23// multiple sources
24objectAssign({foo: 0}, {bar: 1}, {baz: 2});
25//=> {foo: 0, bar: 1, baz: 2}
26
27// overwrites equal keys
28objectAssign({foo: 0}, {foo: 1}, {foo: 2});
29//=> {foo: 2}
30
31// ignores null and undefined sources
32objectAssign({foo: 0}, null, {bar: 1}, undefined);
33//=> {foo: 0, bar: 1}
34```
35
36
37## API
38
39### objectAssign(target, source, [source, ...])
40
41Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
42
43
44## Resources
45
46- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)
47
48
49## Related
50
51- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()`
52
53
54## License
55
56MIT © [Sindre Sorhus](https://sindresorhus.com)