isMapItem()function

isMapItem(map: ImmutableMap<K, V>, key: unknown): key is K
ParamType
mapImmutableMap<K, V>
The map to look in. required
keyunknown
The candidate key to test. required
Return
key is K
true if key exists in map, otherwise false.

Is an unknown value a key for an item in a map?

Examples

isMapItem(new Map([["a", 1]]), "a") // true