UNPKG

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