object

Methods

(static) assign(object, path, […sources]) → {Object}

Source:
Since:
  • 0.1.12
See:
Replaces by an object assigning own enumerable string keyed properties of source objects to the destination object.
Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.
Example
assign({ nested: { a: 1, b: 2 } }, 'nested', { b: 3, c: 4 }) // => { nested: { a:1, b: 3, c: 4 } }
Parameters:
Name Type Attributes Description
object Object The object to modify.
path Array | string The path of the property to set.
sources Object
optional
repeatable
The source objects.
Returns:
Returns the updated object.
Type
Object