Methods
(inner) deepEquals(a, b) → {Boolean}
Compares two values
normal comparison for fundamental data types (number, string etc) element wise comparison for objects and arrays recursive handling for nested objects and arrays
Parameters:
Name | Type | Description |
---|---|---|
a |
Any | some value |
b |
Any | some value |
Returns:
- if the two values are equal
- Type
- Boolean
(inner) isSubset(set, candidate) → {Boolean}
A function that checks if an object or array contains only the entries contained in some other array or object
the other object(|array) might contain additional entries
(set doesn't mean that the arrays can contain a value only once in this case)
Parameters:
Name | Type | Description |
---|---|---|
set |
Object | Array | the object or array we want to compare against |
candidate |
Object | Array | the object we want to check |
Throws:
Will throw an error if the two given values are not of the same type or if they are not of the specified type (null is also not allowed)
Returns:
if the candidate contains only elements of the original object
- Type
- Boolean
(inner) mergeIntoObject(target, toMerge, deepMerge, noNewValues, typesafe) → {Object}
Function that allows overwriting entries in an object with values given in another object
Parameters:
Name | Type | Description |
---|---|---|
target |
Object | the object to merge into |
toMerge |
Object | the object containing the new values |
deepMerge |
Boolean | if nested objects are supposed to be merged recursively (else they are just overwritten) |
noNewValues |
Boolean | String | flag to disallow new entries being added to the target object ('strict' for error, true for silent ignore) |
typesafe |
Boolean | String | if entries are not allowed to change their type ('strict' for error, true for silent ignore) |
Returns:
object containing the values that were actually changed (some changes might be silently ignored due to flags)
- Type
- Object