Object utility functions.
- Source:
Methods
-
<static> merge(original, extended)
-
Deeply merge an object into the another.
Parameters:
Name Type Description original
Object Target object to merge to
extended
Object Object to merge to the first one
- Source:
Returns:
First object
- Type
- Object
Example
merge({ a: { var_1: 1 } }, { a: { var_1: 2 } }); // return { a: { var_1: 2 } }
-
<static> mergeMultiple(a)
-
Merge any number of associative arrays into first.
All arguments are expected to be associative arrays.
If same key appears multiple times the final value
will come from last argument that contains it.Parameters:
Name Type Description a
Object Objects to merge
- Source:
Returns:
first argument
- Type
- object
Example
mergeMultiple({ a: { var_1: 1 } }, { a: { var_1: 2 } }); // return { a: { var_1: 2 } }