You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
458 B

4 years ago
  1. function _asyncIterator(iterable) {
  2. var method;
  3. if (typeof Symbol !== "undefined") {
  4. if (Symbol.asyncIterator) {
  5. method = iterable[Symbol.asyncIterator];
  6. if (method != null) return method.call(iterable);
  7. }
  8. if (Symbol.iterator) {
  9. method = iterable[Symbol.iterator];
  10. if (method != null) return method.call(iterable);
  11. }
  12. }
  13. throw new TypeError("Object is not async iterable");
  14. }
  15. module.exports = _asyncIterator;