Skip to content

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.

K extends readonly string[]

Union of string keys

T

Type of a mapped object values

(k) => T

Function mapping a key to a value

K

{ [key in string]: T }

Mapped object of keys