/** * @module @promises/filter-parallel * @copyright © 2017 Yisrael Eliav (https://github.com/yisraelx) * @license MIT */ import { IOptionalPromise, IOptionalPromiseArray, IOptionalPromiseDictionary } from '@promises/interfaces'; export interface IFilterParallel { >(array: IOptionalPromiseArray, iteratee?: (value: T[keyof T & number], index: number, array: T) => IOptionalPromise, limit?: number): Promise; (object: IOptionalPromiseDictionary, iteratee?: (value: T[keyof T], key: keyof T, object: T) => IOptionalPromise, limit?: number): Promise; } /** * @function * @example * * let comparator = (value: number) => { * return value % 2 === 0; * }; * * let array = Array.from({length:5}, (value, index) => index); * * filterParallel(array, comparator).then((result: number[])=>{ * console.log(result); // result => [0, 2, 4] * }); */ declare let filterParallel: IFilterParallel; export default filterParallel;