(obj: any)
| 29 | } |
| 30 | |
| 31 | function isAsyncIterable<T>(obj: any): obj is AsyncIterable<T> { |
| 32 | return obj && typeof obj[Symbol.asyncIterator] === 'function'; |
| 33 | } |
| 34 | |
| 35 | // Convert a web ReadableStream (not Node stream!) to an Async Iterator |
| 36 | // adapted from https://jakearchibald.com/2017/async-iterators-and-generators/ |