mapValues es-toolkit
Returns a new object with values transformed through a function.
Usage
mapValues(object, getNewValue)
Use mapValues when you want to create a new object by transforming each value. Keys remain the same, and only the values are changed to the results of the getNewValue function.
Parameters
objectT extends objectrequired
The object to transform values from.
getNewValue(value: T[K], key: K, object: T) => Vrequired
A function that generates new values. Receives value, key, and the entire object as parameters.
Returns
Returns a new object with transformed values.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.