UNPKG

390 BJavaScriptView Raw
1function _asyncIterator(iterable) {
2 if (typeof Symbol === "function") {
3 if (Symbol.asyncIterator) {
4 var method = iterable[Symbol.asyncIterator];
5 if (method != null) return method.call(iterable);
6 }
7
8 if (Symbol.iterator) {
9 return iterable[Symbol.iterator]();
10 }
11 }
12
13 throw new TypeError("Object is not async iterable");
14}
15
16module.exports = _asyncIterator;
\No newline at end of file