@wesjet/function.js
Version:
wesjet javascript library
14 lines (13 loc) • 842 B
TypeScript
/**
* Copyright (c) Wesbitty, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/** Promise.all + Array.map */
export declare const promiseMap: <T, Res>(arr: T[], map: (el: T, index?: number) => Res | Promise<Res>) => Promise<(Awaited<Res> | Awaited<Res>)[]>;
export declare const promiseMapDict: <T, Res>(dict: Record<string, T>, map: (el: T, index?: number) => Res | Promise<Res>) => Promise<Record<string, Res>>;
export declare const promiseMapToDict: <T, Res>(arr: T[], mapValue: (el: T, index?: number) => Res | Promise<Res>, mapKey: (el: T, index?: number) => string) => Promise<Record<string, Res>>;
export declare const promiseMapPool: <T, Res>(arr: T[], map: (el: T, index?: number) => Promise<Res>, poolLimit: number) => Promise<Res[]>;