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