/utils/merge

Export the default mergeDeep method to mapp.utils{}.

Methods

(inner) isObject(item) → {Boolean}

The method checks whether item param is an object, excluding true, false, null, Array objects.

Parameters:
NameTypeDescription
itemAny
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:
NameTypeDescription
targetObject
sourcesSpread

The sources param is spread into an array.