goog.collections.maps
Module ID |
---|
Helper methods that operate on Map-like objects (e.g. ES6 Maps).
Exported Functions
equals<K, V1, V2>( map, otherMap, valueEqualityFn ) → boolean
boolean
Compares two maps using their public APIs to determine if they have equal contents, optionally using a custom comparison function when comaring values.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
hasValue<V1, V2>( map, val, valueEqualityFn ) → boolean
boolean
Determines if a given map contains the given value, optionally using a custom comparison function.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setAll<K, V>( map, entries ) → void
void
Iterates over each entry in the given entries and sets the entry in the map, overwriting any existing entries for the key.
Parameters |
|
---|
toObject<K, V>( map ) → Object<(K|null), (V|null)>
Object<(K|null), (V|null)>
transpose<K, V>( map ) → Map<(V|null), (K|null)>
Map<(V|null), (K|null)>
Returns a new ES6 Map in which all the keys and values from the given map are interchanged (keys become values and values become keys). If multiple keys in the given map to the same value, the resulting value in the transposed map is implementation-dependent.
It acts very similarly to {goog.object.transpose(Object)}.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|