UNPKG

1.71 kBJavaScriptView Raw
1var _Symbol = require("core-js/library/fn/symbol/index.js");
2var _Symbol$iterator = require("core-js/library/fn/symbol/iterator.js");
3var _Array$isArray = require("core-js/library/fn/array/is-array.js");
4var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
5function _createForOfIteratorHelper(o, allowArrayLike) {
6 var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"];
7 if (!it) {
8 if (_Array$isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
9 if (it) o = it;
10 var i = 0;
11 var F = function F() {};
12 return {
13 s: F,
14 n: function n() {
15 if (i >= o.length) return {
16 done: true
17 };
18 return {
19 done: false,
20 value: o[i++]
21 };
22 },
23 e: function e(_e) {
24 throw _e;
25 },
26 f: F
27 };
28 }
29 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
30 }
31 var normalCompletion = true,
32 didErr = false,
33 err;
34 return {
35 s: function s() {
36 it = it.call(o);
37 },
38 n: function n() {
39 var step = it.next();
40 normalCompletion = step.done;
41 return step;
42 },
43 e: function e(_e2) {
44 didErr = true;
45 err = _e2;
46 },
47 f: function f() {
48 try {
49 if (!normalCompletion && it["return"] != null) it["return"]();
50 } finally {
51 if (didErr) throw err;
52 }
53 }
54 };
55}
56module.exports = _createForOfIteratorHelper, module.exports.__esModule = true, module.exports["default"] = module.exports;
\No newline at end of file