mapKeysAsync es-toolkit
Returns a new object with keys transformed through an async function.
Usage
mapKeysAsync(object, getNewKey, options?)
Use mapKeysAsync when you want to create a new object by asynchronously transforming each key. Values remain the same, and each key is replaced with the value inside the Promise returned by the getNewKey function.
Parameters
objectT extends Record<PropertyKey, any>required
The object to transform keys from.
getNewKey(value: T[keyof T], key: keyof T, object: T) => Promise<K>required
An async function that generates new keys. Receives value, key, and the entire object as parameters.
optionsMapKeysAsyncOptionsoptional
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 keys.
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.