UNPKG

@thi.ng/transducers

Version:

Collection of ~170 lightweight, composable transducers, reducers, generators, iterators for functional data transformations

12 lines 573 B
import type { Fn, Nullable } from "@thi.ng/api"; import type { Transducer } from "./api.js"; /** * Transducer. Only keeps values for which (optional) predicate returns a * non-null result. If no `pred` is given, uses values as is. * * @param pred - */ export declare function keep<T>(pred?: Fn<Nullable<T>, any>): Transducer<Nullable<T>, T>; export declare function keep<T>(src: Iterable<Nullable<T>>): IterableIterator<T>; export declare function keep<T>(pred: Fn<Nullable<T>, any>, src: Iterable<Nullable<T>>): IterableIterator<T>; //# sourceMappingURL=keep.d.ts.map