filterSequence()function

filterSequence(sequence: AsyncIterable<T>, match: Match, ...args: A): AsyncIterable<T>
ParamType
sequenceAsyncIterable<T>
Async iterable of items to filter. required
matchMatch
Matcher called with each item (plus any extra args); items it returns true for are kept. required
argsA
Extra arguments passed to match after each item. required
Return
AsyncIterable<T>
Async iterable yielding only the items the matcher returned true for.

Filter a sequence of values using a matcher.

Examples

for await (const n of filterSequence(stream, n => n > 1)) { ... }