predictype / predicates/maps / mapValue
mapValue<
K
,V
>(source
,oper
,target
):boolean
Defined in: predicates/maps/mapValue.ts:27
Checks if a Map contains (or lacks) a specific value using the specified operation.
K
V
Map
<K
, V
>
The Map to check.
The value operation to perform (e.g. ‘has_value’, ‘lacks_value’).
V
The value to check for.
boolean
True if the value check is valid according to the operator, otherwise false.
If the operation is not recognized.
const m1 = new Map([[1, 'a'], [2, 'b']]);
const m2 = new Map([[1, 'a']]);
const valueA = 'a';
const valueB = 'b';
mapValue(m1, 'has_value', valueA); // true
mapValue(m2, 'lacks_value', valueB); // true
Supported Operators: