14 lines
360 B
JavaScript
14 lines
360 B
JavaScript
|
export default (function (iterable) {
|
||
|
if (typeof Symbol === "function") {
|
||
|
if (Symbol.asyncIterator) {
|
||
|
var method = iterable[Symbol.asyncIterator];
|
||
|
if (method != null) return method.call(iterable);
|
||
|
}
|
||
|
|
||
|
if (Symbol.iterator) {
|
||
|
return iterable[Symbol.iterator]();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
throw new TypeError("Object is not async iterable");
|
||
|
});
|