mapKeys
mapKeys<
K
,T
>(mapFn
,keys
):{ [key in string]: T }
Build a key-value mapped object
Constructs a mapped object where values of properties corresponding to each key from the union are evaluated by the provided mapping function called on these keys.
Type Parameters
Section titled “Type Parameters”K
extends readonly string
[]
Union of string keys
T
Type of a mapped object values
Parameters
Section titled “Parameters”(k
) => T
Function mapping a key to a value
K
Returns
Section titled “Returns”{ [key in string]: T }
Mapped object of keys