Licence
MIT
Version
2.1.2
Deps
12
Size
510 kB
Vulns
0
Weekly
0
object-assign-x
Used to copy the values of all enumerable own properties from one or more source objects to a target object.
module.exports ⇒ Object
This method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.
Kind: Exported member
Returns: Object - The target object.
Throws:
TypeErrorIf target is null or undefined.
| Param | Type | Description |
|---|---|---|
| target | * |
The target object. |
| [...source] | * |
The source object(s). |
Example
import assign from 'object-assign-x';
const obj = {a: 1};
const copy = assign({}, obj);
console.log(copy); // { a: 1 }