Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/wojtekmaj/async-array-utils. A collection of array-related async utilities.
array array-methods async promise utils
Something went wrong. Try again.
233 B · 8 lines
TypeScript
at main
123456789export default function asyncMap<T, U>( arr: T[], fn: (cur: T, idx: number, arr: T[]) => Promise<U>,): Promise<U[]> { return new Promise((resolve, reject) => { Promise.all(arr.map(fn)).then(resolve).catch(reject); });}