- Preparing search index...
- The search index is not available
lightdash
- toMapBy<TValue, UKey, VInitialValue>(object: Record<PropertyKey, VInitialValue> | ArrayLike<VInitialValue>, keyMapper: ((key: string, val: VInitialValue) => UKey), valueMapper: ((key: string, value: VInitialValue) => TValue)): Map<UKey, TValue>
-
Type Parameters
-
TValue
-
UKey
-
VInitialValue
Parameters
-
object: Record<PropertyKey, VInitialValue> | ArrayLike<VInitialValue>
-
keyMapper: ((key: string, val: VInitialValue) => UKey)
-
- (key: string, val: VInitialValue): UKey
-
Parameters
-
key: string
-
val: VInitialValue
Returns UKey
-
valueMapper: ((key: string, value: VInitialValue) => TValue)
-
- (key: string, value: VInitialValue): TValue
-
Parameters
-
key: string
-
value: VInitialValue
Returns TValue
Returns Map<UKey, TValue>
Creates a map from the own entries of an object.
Since
13.0.0
See
toMap
Returns
Map created from the object.
Example