getMap()function

getMap(input: PossibleStringMap<K, T>): ImmutableMap<K, T>
getMap(input: PossibleMap<K, T>): ImmutableMap<K, T>
ParamType
inputPossibleStringMap<K, T>
The map, object, or iterable of entries to convert. required
inputPossibleMap<K, T>
Things that can be converted to maps. required
Return
ImmutableMap<K, T>
An ImmutableMap — the input unchanged if it's already a Map, otherwise a new Map.
ImmutableMap<K, T>
Map that cannot be changed.

Convert an iterable to a Map (if it's already a Map it passes through unchanged).

Examples

getMap({ a: 1, b: 2 }) // Map { "a" => 1, "b" => 2 }