* Create an async pull-through pipeline with transforms. * @param {Iterable|AsyncIterable} source - The streamable source * @param {...(Function|object)} args - Transforms, with optional PullOptions * as last argument * @returns {AsyncIterable }
(source, ...args)
| 895 | * @returns {AsyncIterable<Uint8Array[]>} |
| 896 | */ |
| 897 | function pull(source, ...args) { |
| 898 | const { transforms, options } = parsePullArgs(args); |
| 899 | const signal = options?.signal; |
| 900 | if (signal !== undefined) { |
| 901 | validateAbortSignal(signal, 'options.signal'); |
| 902 | // Eagerly check abort at call time per spec |
| 903 | if (signal.aborted) { |
| 904 | return { |
| 905 | __proto__: null, |
| 906 | // eslint-disable-next-line require-yield |
| 907 | async *[SymbolAsyncIterator]() { |
| 908 | throw signal.reason; |
| 909 | }, |
| 910 | }; |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | return { |
| 915 | __proto__: null, |
| 916 | async *[SymbolAsyncIterator]() { |
| 917 | yield* createAsyncPipeline(from(source), transforms, signal); |
| 918 | }, |
| 919 | }; |
| 920 | } |
| 921 | |
| 922 | // ============================================================================= |
| 923 | // Public API: pipeTo() and pipeToSync() |
nothing calls this directly
no test coverage detected