filterSequence()function
filterSequence(sequence: AsyncIterable<T>, match: Match, ...args: A): AsyncIterable<T>
| Param | Type | |
|---|---|---|
sequence | AsyncIterable<T> | Async iterable of items to filter. required |
match | Match | Matcher called with each item (plus any extra args); items it returns true for are kept. required |
args | A | 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)) { ... }