Skip to main content

Function: filter()

filter<T>(stream, predicate): Stream<T>

Defined in: packages/core/src/graph/transforms.ts:129

Drop rows that don't match the predicate.

const cleaned = filter(rowStream, (r) => r.valid); // Stream

Passing rows propagate unchanged. Failing rows cause the filter node to emit a dropped outcome with {kind: 'filtered_out', droppedAt}; every descendant cascades with the same reason. Implemented by throwing FilterDroppedRowError, which the graph runner classifies as a skip (not an error) so descendants see filtered_out rather than upstream_failed.

Type Parameters​

T​

T

Parameters​

stream​

Stream<T>

predicate​

(row) => boolean

Returns​

Stream<T>