Skip to main content
Module

x/rimbu/mod.ts>Transformer.filter

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
variable Transformer.filter
import { Transformer } from "https://deno.land/x/rimbu@1.2.0/mod.ts";
const { filter } = Transformer;

Returns a transformer that filters elements from the input stream based on the provided predicate function.

type

{ <T, TF extends T>(pred: (
value: T,
index: number,
halt: () => void,
) => value is TF
, options?: { negate?: boolean | undefined; }
): Transformer<T, TF>; <T, TF extends T>(pred: (
value: T,
index: number,
halt: () => void,
) => value is TF
, options: { negate: true; }
): Transformer<T, Exclude<T, TF>>; <T>(pred: (
value: T,
index: number,
halt: () => void,
) => boolean
, options?: { negate?: boolean | undefined; }
): Transformer<T>; }