Simple Map
based utilities:
pathGet
- takes a map instance and an array of keys - traverses the map and returns the valuepathSet
- takes a map instance, an array of keys and a value - traverses the map (creating newMap
instance if necessary) and sets the value at the
leaf of the mapmemoize
- takes a function and returns a new memoized function using aMap
structure for the result cache. Currently there is no limit to the size of the cache. However we use aWeakMaps
so if there is no strong reference to all the arguments, then the result will be garbage collected