filter<T, R>(filter: ((v: T, idx: number) => v is R)): Transformer<T, R>
Create a subset of a stream, based on a filter function (like Array.filter)
The filter function receives the current index (zero-based) as well as the
current value. If it returns truth, the value will be passed to the output,
otherwise it will be skipped.
If the filter function is typed as a Typescript type guard (i.e. as returning
v is SomeType), then the resulting source will be typed as
Source.
Create a subset of a stream, based on a filter function (like Array.filter)
The filter function receives the current index (zero-based) as well as the current value. If it returns truth, the value will be passed to the output, otherwise it will be skipped.
If the filter function is typed as a Typescript type guard (i.e. as returning.
v is SomeType
), then the resulting source will be typed as Source