Mirror: 🎩 A tiny but capable push & pull stream library for TypeScript and Flow

use asyncIteratorSymbol helper to check for async Iterator (#176)

Changed files
+1 -1
src
+1 -1
src/sources.ts
···
* for the JS Iterable protocol.
*/
export function fromIterable<T>(iterable: Iterable<T> | AsyncIterable<T>): Source<T> {
-
if (iterable[Symbol.asyncIterator]) return fromAsyncIterable(iterable as AsyncIterable<T>);
+
if (iterable[asyncIteratorSymbol()]) return fromAsyncIterable(iterable as AsyncIterable<T>);
return sink => {
const iterator = iterable[Symbol.iterator]();
let ended = false;