asyncIterator.js 571 B

1234567891011121314151617181920212223
  1. var _Symbol$iterator = require("../core-js/symbol/iterator");
  2. var _Symbol = require("../core-js/symbol");
  3. function _asyncIterator(iterable) {
  4. var method;
  5. if (typeof _Symbol !== "undefined") {
  6. if (_Symbol.asyncIterator) {
  7. method = iterable[_Symbol.asyncIterator];
  8. if (method != null) return method.call(iterable);
  9. }
  10. if (_Symbol$iterator) {
  11. method = iterable[_Symbol$iterator];
  12. if (method != null) return method.call(iterable);
  13. }
  14. }
  15. throw new TypeError("Object is not async iterable");
  16. }
  17. module.exports = _asyncIterator;