On this page

cleverMerge(first?, second?): T | O | T | O
Attributes
first:<null>
first object
second:<null>
second object
Returns:
{T|O|T|O} merged 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): void
  • algorithm {HashFunction} the algorithm name or a constructor creating a hash
  • Returns: {Hash} the hash

Creates a hash by name or function


compileBooleanMatcher(map): void
  • map {Record<string|number, boolean>} value map
  • Returns: <boolean> | <object> true/false, when unconditionally true/false, or a template function to determine the value at runtime