- mapKeys<T, K>(obj: T, fn: ((value: T[K], key: K, object: T) => string)): Record<string, unknown>
-
Type Parameters
-
T extends Record<string, unknown>
-
K extends string | number | symbol
Parameters
-
obj: T
-
fn: ((value: T[K], key: K, object: T) => string)
-
- (value: T[K], key: K, object: T): string
-
Parameters
-
value: T[K]
-
key: K
-
object: T
Returns string
Returns Record<string, unknown>
Creates an object with keys generated by running the provided function for each key and the same values as the provided object
Example