/utils/merge
Export the default mergeDeep method to mapp.utils{}.
- Source
Methods
(inner) isObject(item) → {Boolean}
The method checks whether item param is an object, excluding true, false, null, Array objects.
Parameters:
Name | Type | Description |
---|---|---|
item | Any |
- Source
Returns:
Return boolean whether item param is an object.
- Type:
- Boolean
(inner) mergeDeep(target, sources)
The mergeDeep utility method will set the source object's own enumerable string-keyed property values on a target object.
mergeDeep will call itself recursively allowing to merge nested objects.
An empty target object can be provided to effectively clone a source object.
Instances of HTMLElement objects will be ignored by the merge method.
Arrays will not be merged. The source array will overwrite a target array.
Parameters:
Name | Type | Description |
---|---|---|
target | Object | |
sources | Spread | The sources param is spread into an array. |
- Source