* Draw items from the stream until it is exhausted, or a predicate fails. * * This can be useful when the stream has side effects but no output. In * that case, calling this function guarantees that the stream will be * fully processed.
(predicate: (r: T) => boolean)
| 224 | * fully processed. |
| 225 | */ |
| 226 | async resolveWhile(predicate: (r: T) => boolean): Promise<void> { |
| 227 | let x = await this.next(); |
| 228 | let shouldContinue = predicate(x.value); |
| 229 | while ((!x.done) && shouldContinue) { |
| 230 | x = await this.next(); |
| 231 | shouldContinue = predicate(x.value); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Handles errors thrown on this stream using a provided handler function. |
nothing calls this directly
no test coverage detected
searching dependent graphs…