mapValuesAsync es-toolkit
Returns a new object with values transformed through an async function.
Usage
mapValuesAsync(object, getNewValue, options?)
Use mapValuesAsync when you want to create a new object by asynchronously transforming each value. Keys remain the same, and each value is replaced with the value inside the Promise returned by the getNewValue function.
Parameters
objectT extends objectrequired
The object to transform values from.
getNewValue(value: T[K], key: K, object: T) => Promise<V>required
An async function that generates new values. Receives value, key, and the entire object as parameters.
optionsMapValuesAsyncOptionsoptional
Options to control concurrency.
concurrency(number, optional): Maximum number of concurrent operations. If not specified, all operations run concurrently.
Returns
Returns a promise that resolves to 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.