Co-authored-by: James <james@trbl.design> Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
7 lines
179 B
TypeScript
7 lines
179 B
TypeScript
export async function mapAsync<T, U>(
|
|
arr: T[],
|
|
callbackfn: (item: T, index: number, array: T[]) => Promise<U>,
|
|
): Promise<U[]> {
|
|
return Promise.all(arr.map(callbackfn));
|
|
}
|