cleverMerge(first?, second?): T | O | T & OAttributes
first:
null | Tfirst object
second:
null | Osecond object
Returns:
T | O | T & Omerged object of first and second object
Merges two given objects and caches the result to avoid computation if same objects passed as arguments again.
// performs cleverMerge(first, second), stores the result in WeakMap and returns result
cachedCleverMerge({a: 1}, {a: 2})
{a: 2}
// when same arguments passed, gets the result from WeakMap and returns it.
cachedCleverMerge({a: 1}, {a: 2})
{a: 2}createHash(algorithm): HashAttributes
algorithm:
HashFunctionthe algorithm name or a constructor creating a hash
Returns:
Hashthe hash
Creates a hash by name or function
compileBooleanMatcher(map): boolean | ((value: string) => string)Attributes
Compile boolean matcher.