@mcabreradev/filter
Version:
A powerful, SQL-like array filtering library for TypeScript and JavaScript with advanced pattern matching, MongoDB-style operators, deep object comparison, and zero dependencies
14 lines • 1.56 kB
TypeScript
export declare function take<T>(iterable: Iterable<T>, count: number): Generator<T, void, undefined>;
export declare function skip<T>(iterable: Iterable<T>, count: number): Generator<T, void, undefined>;
export declare function map<T, U>(iterable: Iterable<T>, mapper: (item: T, index: number) => U): Generator<U, void, undefined>;
export declare function reduce<T, U>(iterable: Iterable<T>, reducer: (acc: U, item: T, index: number) => U, initialValue: U): U;
export declare function toArray<T>(iterable: Iterable<T>): T[];
export declare function forEach<T>(iterable: Iterable<T>, callback: (item: T, index: number) => void): void;
export declare function every<T>(iterable: Iterable<T>, predicate: (item: T, index: number) => boolean): boolean;
export declare function some<T>(iterable: Iterable<T>, predicate: (item: T, index: number) => boolean): boolean;
export declare function find<T>(iterable: Iterable<T>, predicate: (item: T, index: number) => boolean): T | undefined;
export declare function chunk<T>(iterable: Iterable<T>, size: number): Generator<T[], void, undefined>;
export declare function flatten<T>(iterable: Iterable<T | Iterable<T>>): Generator<T, void, undefined>;
export declare function asyncMap<T, U>(iterable: AsyncIterable<T>, mapper: (item: T, index: number) => Promise<U> | U): AsyncGenerator<U, void, undefined>;
export declare function asyncFilter<T>(iterable: AsyncIterable<T>, predicate: (item: T, index: number) => Promise<boolean> | boolean): AsyncGenerator<T, void, undefined>;
//# sourceMappingURL=lazy-iterators.d.ts.map