* Fast path for validated stateful transforms (e.g. compression). * Skips withFlushAsync (transform handles done internally) and * skips isUint8ArrayBatch validation (transform guarantees valid output). * @yields {Uint8Array[]}
(source, transform, options)
| 678 | * @yields {Uint8Array[]} |
| 679 | */ |
| 680 | async function* applyValidatedStatefulAsyncTransform(source, transform, options) { |
| 681 | const output = transform(source, options); |
| 682 | for await (const batch of output) { |
| 683 | if (batch.length > 0) { |
| 684 | yield batch; |
| 685 | } |
| 686 | } |
| 687 | // Check abort after the transform completes - without the |
| 688 | // withFlushAsync wrapper there is no extra yield to give |
| 689 | // the outer pipeline a chance to see the abort. |
| 690 | options.signal?.throwIfAborted(); |
| 691 | } |
| 692 | |
| 693 | function getOnAbort(reject, signal) { |
| 694 | return () => reject(signal.reason); |
no test coverage detected
searching dependent graphs…