(val)
| 77 | } |
| 78 | |
| 79 | function makeAsyncIterable(val) { |
| 80 | if (isIterable(val)) { |
| 81 | return val; |
| 82 | } else if (isReadableNodeStream(val)) { |
| 83 | // Legacy streams are not Iterable. |
| 84 | return fromReadable(val); |
| 85 | } |
| 86 | throw new ERR_INVALID_ARG_TYPE( |
| 87 | 'val', ['Readable', 'Iterable', 'AsyncIterable'], val); |
| 88 | } |
| 89 | |
| 90 | async function* fromReadable(val) { |
| 91 | Readable ??= require('internal/streams/readable'); |
no test coverage detected
searching dependent graphs…