mapValues
Callable
Type parameters
- T: object | ArrayLike<unknown>
- Mapper: (v: T[keyof T], k: keyof T) => unknown
Parameters
obj: T
The object to map the values from.
mapper: Mapper
Returns { [ K in keyof T ]: Mapper extends (v: T[K], k: K) => infer O ? O : never }
The keys as an array.
Returns an object with same keys, where the original values are converted using a mapper.
Example
Alternatives