@innoways/ajv 8.0.14 → 8.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -27,263 +27,273 @@ function commonjsRequire () {
27
27
  }
28
28
 
29
29
  var asyncToGenerator = createCommonjsModule(function (module) {
30
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
31
- try {
32
- var info = gen[key](arg);
33
- var value = info.value;
34
- } catch (error) {
35
- reject(error);
36
- return;
37
- }
30
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
31
+ try {
32
+ var info = gen[key](arg);
33
+ var value = info.value;
34
+ } catch (error) {
35
+ reject(error);
36
+ return;
37
+ }
38
38
 
39
- if (info.done) {
40
- resolve(value);
41
- } else {
42
- Promise.resolve(value).then(_next, _throw);
39
+ if (info.done) {
40
+ resolve(value);
41
+ } else {
42
+ Promise.resolve(value).then(_next, _throw);
43
+ }
43
44
  }
44
- }
45
45
 
46
- function _asyncToGenerator(fn) {
47
- return function () {
48
- var self = this,
49
- args = arguments;
50
- return new Promise(function (resolve, reject) {
51
- var gen = fn.apply(self, args);
46
+ function _asyncToGenerator(fn) {
47
+ return function () {
48
+ var self = this,
49
+ args = arguments;
50
+ return new Promise(function (resolve, reject) {
51
+ var gen = fn.apply(self, args);
52
52
 
53
- function _next(value) {
54
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
55
- }
53
+ function _next(value) {
54
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
55
+ }
56
56
 
57
- function _throw(err) {
58
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
59
- }
57
+ function _throw(err) {
58
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
59
+ }
60
60
 
61
- _next(undefined);
62
- });
63
- };
64
- }
61
+ _next(undefined);
62
+ });
63
+ };
64
+ }
65
65
 
66
- module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
66
+ module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
67
67
  });
68
-
69
68
  var _asyncToGenerator = unwrapExports(asyncToGenerator);
70
69
 
71
70
  var defineProperty = createCommonjsModule(function (module) {
72
- function _defineProperty(obj, key, value) {
73
- if (key in obj) {
74
- Object.defineProperty(obj, key, {
75
- value: value,
76
- enumerable: true,
77
- configurable: true,
78
- writable: true
79
- });
80
- } else {
81
- obj[key] = value;
82
- }
71
+ function _defineProperty(obj, key, value) {
72
+ if (key in obj) {
73
+ Object.defineProperty(obj, key, {
74
+ value: value,
75
+ enumerable: true,
76
+ configurable: true,
77
+ writable: true
78
+ });
79
+ } else {
80
+ obj[key] = value;
81
+ }
83
82
 
84
- return obj;
85
- }
83
+ return obj;
84
+ }
86
85
 
87
- module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
86
+ module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
88
87
  });
89
-
90
88
  var _defineProperty = unwrapExports(defineProperty);
91
89
 
92
- var runtime_1 = createCommonjsModule(function (module) {
93
- /**
94
- * Copyright (c) 2014-present, Facebook, Inc.
95
- *
96
- * This source code is licensed under the MIT license found in the
97
- * LICENSE file in the root directory of this source tree.
98
- */
90
+ var _typeof_1 = createCommonjsModule(function (module) {
91
+ function _typeof(obj) {
92
+ "@babel/helpers - typeof";
99
93
 
100
- var runtime = (function (exports) {
101
-
102
- var Op = Object.prototype;
103
- var hasOwn = Op.hasOwnProperty;
104
- var undefined$1; // More compressible than void 0.
105
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
106
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
107
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
108
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
109
-
110
- function define(obj, key, value) {
111
- Object.defineProperty(obj, key, {
112
- value: value,
113
- enumerable: true,
114
- configurable: true,
115
- writable: true
116
- });
117
- return obj[key];
118
- }
119
- try {
120
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
121
- define({}, "");
122
- } catch (err) {
123
- define = function(obj, key, value) {
124
- return obj[key] = value;
125
- };
94
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
95
+ return typeof obj;
96
+ } : function (obj) {
97
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
98
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
126
99
  }
127
100
 
128
- function wrap(innerFn, outerFn, self, tryLocsList) {
129
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
130
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
131
- var generator = Object.create(protoGenerator.prototype);
132
- var context = new Context(tryLocsList || []);
101
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
102
+ });
133
103
 
134
- // The ._invoke method unifies the implementations of the .next,
135
- // .throw, and .return methods.
136
- generator._invoke = makeInvokeMethod(innerFn, self, context);
104
+ var _typeof = unwrapExports(_typeof_1);
105
+
106
+ var runtime_1 = createCommonjsModule(function (module) {
107
+ /**
108
+ * Copyright (c) 2014-present, Facebook, Inc.
109
+ *
110
+ * This source code is licensed under the MIT license found in the
111
+ * LICENSE file in the root directory of this source tree.
112
+ */
113
+ var runtime = function (exports) {
114
+
115
+ var Op = Object.prototype;
116
+ var hasOwn = Op.hasOwnProperty;
117
+ var undefined$1; // More compressible than void 0.
118
+
119
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
120
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
121
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
122
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
123
+
124
+ function define(obj, key, value) {
125
+ Object.defineProperty(obj, key, {
126
+ value: value,
127
+ enumerable: true,
128
+ configurable: true,
129
+ writable: true
130
+ });
131
+ return obj[key];
132
+ }
137
133
 
138
- return generator;
139
- }
140
- exports.wrap = wrap;
141
-
142
- // Try/catch helper to minimize deoptimizations. Returns a completion
143
- // record like context.tryEntries[i].completion. This interface could
144
- // have been (and was previously) designed to take a closure to be
145
- // invoked without arguments, but in all the cases we care about we
146
- // already have an existing method we want to call, so there's no need
147
- // to create a new function object. We can even get away with assuming
148
- // the method takes exactly one argument, since that happens to be true
149
- // in every case, so we don't have to touch the arguments object. The
150
- // only additional allocation required is the completion record, which
151
- // has a stable shape and so hopefully should be cheap to allocate.
152
- function tryCatch(fn, obj, arg) {
153
134
  try {
154
- return { type: "normal", arg: fn.call(obj, arg) };
135
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
136
+ define({}, "");
155
137
  } catch (err) {
156
- return { type: "throw", arg: err };
138
+ define = function define(obj, key, value) {
139
+ return obj[key] = value;
140
+ };
157
141
  }
158
- }
159
142
 
160
- var GenStateSuspendedStart = "suspendedStart";
161
- var GenStateSuspendedYield = "suspendedYield";
162
- var GenStateExecuting = "executing";
163
- var GenStateCompleted = "completed";
164
-
165
- // Returning this object from the innerFn has the same effect as
166
- // breaking out of the dispatch switch statement.
167
- var ContinueSentinel = {};
168
-
169
- // Dummy constructor functions that we use as the .constructor and
170
- // .constructor.prototype properties for functions that return Generator
171
- // objects. For full spec compliance, you may wish to configure your
172
- // minifier not to mangle the names of these two functions.
173
- function Generator() {}
174
- function GeneratorFunction() {}
175
- function GeneratorFunctionPrototype() {}
176
-
177
- // This is a polyfill for %IteratorPrototype% for environments that
178
- // don't natively support it.
179
- var IteratorPrototype = {};
180
- define(IteratorPrototype, iteratorSymbol, function () {
181
- return this;
182
- });
183
-
184
- var getProto = Object.getPrototypeOf;
185
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
186
- if (NativeIteratorPrototype &&
187
- NativeIteratorPrototype !== Op &&
188
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
189
- // This environment has a native %IteratorPrototype%; use it instead
190
- // of the polyfill.
191
- IteratorPrototype = NativeIteratorPrototype;
192
- }
143
+ function wrap(innerFn, outerFn, self, tryLocsList) {
144
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
145
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
146
+ var generator = Object.create(protoGenerator.prototype);
147
+ var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
148
+ // .throw, and .return methods.
193
149
 
194
- var Gp = GeneratorFunctionPrototype.prototype =
195
- Generator.prototype = Object.create(IteratorPrototype);
196
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
197
- define(Gp, "constructor", GeneratorFunctionPrototype);
198
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
199
- GeneratorFunction.displayName = define(
200
- GeneratorFunctionPrototype,
201
- toStringTagSymbol,
202
- "GeneratorFunction"
203
- );
204
-
205
- // Helper for defining the .next, .throw, and .return methods of the
206
- // Iterator interface in terms of a single ._invoke method.
207
- function defineIteratorMethods(prototype) {
208
- ["next", "throw", "return"].forEach(function(method) {
209
- define(prototype, method, function(arg) {
210
- return this._invoke(method, arg);
211
- });
150
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
151
+ return generator;
152
+ }
153
+
154
+ exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
155
+ // record like context.tryEntries[i].completion. This interface could
156
+ // have been (and was previously) designed to take a closure to be
157
+ // invoked without arguments, but in all the cases we care about we
158
+ // already have an existing method we want to call, so there's no need
159
+ // to create a new function object. We can even get away with assuming
160
+ // the method takes exactly one argument, since that happens to be true
161
+ // in every case, so we don't have to touch the arguments object. The
162
+ // only additional allocation required is the completion record, which
163
+ // has a stable shape and so hopefully should be cheap to allocate.
164
+
165
+ function tryCatch(fn, obj, arg) {
166
+ try {
167
+ return {
168
+ type: "normal",
169
+ arg: fn.call(obj, arg)
170
+ };
171
+ } catch (err) {
172
+ return {
173
+ type: "throw",
174
+ arg: err
175
+ };
176
+ }
177
+ }
178
+
179
+ var GenStateSuspendedStart = "suspendedStart";
180
+ var GenStateSuspendedYield = "suspendedYield";
181
+ var GenStateExecuting = "executing";
182
+ var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
183
+ // breaking out of the dispatch switch statement.
184
+
185
+ var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
186
+ // .constructor.prototype properties for functions that return Generator
187
+ // objects. For full spec compliance, you may wish to configure your
188
+ // minifier not to mangle the names of these two functions.
189
+
190
+ function Generator() {}
191
+
192
+ function GeneratorFunction() {}
193
+
194
+ function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
195
+ // don't natively support it.
196
+
197
+
198
+ var IteratorPrototype = {};
199
+ define(IteratorPrototype, iteratorSymbol, function () {
200
+ return this;
212
201
  });
213
- }
202
+ var getProto = Object.getPrototypeOf;
203
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
214
204
 
215
- exports.isGeneratorFunction = function(genFun) {
216
- var ctor = typeof genFun === "function" && genFun.constructor;
217
- return ctor
218
- ? ctor === GeneratorFunction ||
219
- // For the native GeneratorFunction constructor, the best we can
220
- // do is to check its .name property.
221
- (ctor.displayName || ctor.name) === "GeneratorFunction"
222
- : false;
223
- };
224
-
225
- exports.mark = function(genFun) {
226
- if (Object.setPrototypeOf) {
227
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
228
- } else {
229
- genFun.__proto__ = GeneratorFunctionPrototype;
230
- define(genFun, toStringTagSymbol, "GeneratorFunction");
205
+ if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
206
+ // This environment has a native %IteratorPrototype%; use it instead
207
+ // of the polyfill.
208
+ IteratorPrototype = NativeIteratorPrototype;
231
209
  }
232
- genFun.prototype = Object.create(Gp);
233
- return genFun;
234
- };
235
-
236
- // Within the body of any async function, `await x` is transformed to
237
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
238
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
239
- // meant to be awaited.
240
- exports.awrap = function(arg) {
241
- return { __await: arg };
242
- };
243
-
244
- function AsyncIterator(generator, PromiseImpl) {
245
- function invoke(method, arg, resolve, reject) {
246
- var record = tryCatch(generator[method], generator, arg);
247
- if (record.type === "throw") {
248
- reject(record.arg);
249
- } else {
250
- var result = record.arg;
251
- var value = result.value;
252
- if (value &&
253
- typeof value === "object" &&
254
- hasOwn.call(value, "__await")) {
255
- return PromiseImpl.resolve(value.__await).then(function(value) {
256
- invoke("next", value, resolve, reject);
257
- }, function(err) {
258
- invoke("throw", err, resolve, reject);
259
- });
260
- }
261
210
 
262
- return PromiseImpl.resolve(value).then(function(unwrapped) {
263
- // When a yielded Promise is resolved, its final value becomes
264
- // the .value of the Promise<{value,done}> result for the
265
- // current iteration.
266
- result.value = unwrapped;
267
- resolve(result);
268
- }, function(error) {
269
- // If a rejected Promise was yielded, throw the rejection back
270
- // into the async generator function so it can be handled there.
271
- return invoke("throw", error, resolve, reject);
211
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
212
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
213
+ define(Gp, "constructor", GeneratorFunctionPrototype);
214
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
215
+ GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
216
+ // Iterator interface in terms of a single ._invoke method.
217
+
218
+ function defineIteratorMethods(prototype) {
219
+ ["next", "throw", "return"].forEach(function (method) {
220
+ define(prototype, method, function (arg) {
221
+ return this._invoke(method, arg);
272
222
  });
273
- }
223
+ });
274
224
  }
275
225
 
276
- var previousPromise;
226
+ exports.isGeneratorFunction = function (genFun) {
227
+ var ctor = typeof genFun === "function" && genFun.constructor;
228
+ return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
229
+ // do is to check its .name property.
230
+ (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
231
+ };
277
232
 
278
- function enqueue(method, arg) {
279
- function callInvokeWithMethodAndArg() {
280
- return new PromiseImpl(function(resolve, reject) {
281
- invoke(method, arg, resolve, reject);
282
- });
233
+ exports.mark = function (genFun) {
234
+ if (Object.setPrototypeOf) {
235
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
236
+ } else {
237
+ genFun.__proto__ = GeneratorFunctionPrototype;
238
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
239
+ }
240
+
241
+ genFun.prototype = Object.create(Gp);
242
+ return genFun;
243
+ }; // Within the body of any async function, `await x` is transformed to
244
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
245
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
246
+ // meant to be awaited.
247
+
248
+
249
+ exports.awrap = function (arg) {
250
+ return {
251
+ __await: arg
252
+ };
253
+ };
254
+
255
+ function AsyncIterator(generator, PromiseImpl) {
256
+ function invoke(method, arg, resolve, reject) {
257
+ var record = tryCatch(generator[method], generator, arg);
258
+
259
+ if (record.type === "throw") {
260
+ reject(record.arg);
261
+ } else {
262
+ var result = record.arg;
263
+ var value = result.value;
264
+
265
+ if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
266
+ return PromiseImpl.resolve(value.__await).then(function (value) {
267
+ invoke("next", value, resolve, reject);
268
+ }, function (err) {
269
+ invoke("throw", err, resolve, reject);
270
+ });
271
+ }
272
+
273
+ return PromiseImpl.resolve(value).then(function (unwrapped) {
274
+ // When a yielded Promise is resolved, its final value becomes
275
+ // the .value of the Promise<{value,done}> result for the
276
+ // current iteration.
277
+ result.value = unwrapped;
278
+ resolve(result);
279
+ }, function (error) {
280
+ // If a rejected Promise was yielded, throw the rejection back
281
+ // into the async generator function so it can be handled there.
282
+ return invoke("throw", error, resolve, reject);
283
+ });
284
+ }
283
285
  }
284
286
 
285
- return previousPromise =
286
- // If enqueue has been called before, then we want to wait until
287
+ var previousPromise;
288
+
289
+ function enqueue(method, arg) {
290
+ function callInvokeWithMethodAndArg() {
291
+ return new PromiseImpl(function (resolve, reject) {
292
+ invoke(method, arg, resolve, reject);
293
+ });
294
+ }
295
+
296
+ return previousPromise = // If enqueue has been called before, then we want to wait until
287
297
  // all previous Promises have been resolved before calling invoke,
288
298
  // so that results are always delivered in the correct order. If
289
299
  // enqueue has not been called before, then it is important to
@@ -295,554 +305,527 @@ var runtime = (function (exports) {
295
305
  // execute code before the first await. Since we implement simple
296
306
  // async functions in terms of async generators, it is especially
297
307
  // important to get this right, even though it requires care.
298
- previousPromise ? previousPromise.then(
299
- callInvokeWithMethodAndArg,
300
- // Avoid propagating failures to Promises returned by later
301
- // invocations of the iterator.
302
- callInvokeWithMethodAndArg
303
- ) : callInvokeWithMethodAndArg();
308
+ previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
309
+ // invocations of the iterator.
310
+ callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
311
+ } // Define the unified helper method that is used to implement .next,
312
+ // .throw, and .return (see defineIteratorMethods).
313
+
314
+
315
+ this._invoke = enqueue;
304
316
  }
305
317
 
306
- // Define the unified helper method that is used to implement .next,
307
- // .throw, and .return (see defineIteratorMethods).
308
- this._invoke = enqueue;
309
- }
318
+ defineIteratorMethods(AsyncIterator.prototype);
319
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
320
+ return this;
321
+ });
322
+ exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
323
+ // AsyncIterator objects; they just return a Promise for the value of
324
+ // the final result produced by the iterator.
325
+
326
+ exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
327
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
328
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
329
+ return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
330
+ : iter.next().then(function (result) {
331
+ return result.done ? result.value : iter.next();
332
+ });
333
+ };
310
334
 
311
- defineIteratorMethods(AsyncIterator.prototype);
312
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
313
- return this;
314
- });
315
- exports.AsyncIterator = AsyncIterator;
316
-
317
- // Note that simple async functions are implemented on top of
318
- // AsyncIterator objects; they just return a Promise for the value of
319
- // the final result produced by the iterator.
320
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
321
- if (PromiseImpl === void 0) PromiseImpl = Promise;
322
-
323
- var iter = new AsyncIterator(
324
- wrap(innerFn, outerFn, self, tryLocsList),
325
- PromiseImpl
326
- );
327
-
328
- return exports.isGeneratorFunction(outerFn)
329
- ? iter // If outerFn is a generator, return the full iterator.
330
- : iter.next().then(function(result) {
331
- return result.done ? result.value : iter.next();
332
- });
333
- };
335
+ function makeInvokeMethod(innerFn, self, context) {
336
+ var state = GenStateSuspendedStart;
337
+ return function invoke(method, arg) {
338
+ if (state === GenStateExecuting) {
339
+ throw new Error("Generator is already running");
340
+ }
334
341
 
335
- function makeInvokeMethod(innerFn, self, context) {
336
- var state = GenStateSuspendedStart;
342
+ if (state === GenStateCompleted) {
343
+ if (method === "throw") {
344
+ throw arg;
345
+ } // Be forgiving, per 25.3.3.3.3 of the spec:
346
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
337
347
 
338
- return function invoke(method, arg) {
339
- if (state === GenStateExecuting) {
340
- throw new Error("Generator is already running");
341
- }
342
348
 
343
- if (state === GenStateCompleted) {
344
- if (method === "throw") {
345
- throw arg;
349
+ return doneResult();
346
350
  }
347
351
 
348
- // Be forgiving, per 25.3.3.3.3 of the spec:
349
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
350
- return doneResult();
351
- }
352
+ context.method = method;
353
+ context.arg = arg;
354
+
355
+ while (true) {
356
+ var delegate = context.delegate;
352
357
 
353
- context.method = method;
354
- context.arg = arg;
358
+ if (delegate) {
359
+ var delegateResult = maybeInvokeDelegate(delegate, context);
355
360
 
356
- while (true) {
357
- var delegate = context.delegate;
358
- if (delegate) {
359
- var delegateResult = maybeInvokeDelegate(delegate, context);
360
- if (delegateResult) {
361
- if (delegateResult === ContinueSentinel) continue;
362
- return delegateResult;
361
+ if (delegateResult) {
362
+ if (delegateResult === ContinueSentinel) continue;
363
+ return delegateResult;
364
+ }
363
365
  }
364
- }
365
366
 
366
- if (context.method === "next") {
367
- // Setting context._sent for legacy support of Babel's
368
- // function.sent implementation.
369
- context.sent = context._sent = context.arg;
367
+ if (context.method === "next") {
368
+ // Setting context._sent for legacy support of Babel's
369
+ // function.sent implementation.
370
+ context.sent = context._sent = context.arg;
371
+ } else if (context.method === "throw") {
372
+ if (state === GenStateSuspendedStart) {
373
+ state = GenStateCompleted;
374
+ throw context.arg;
375
+ }
370
376
 
371
- } else if (context.method === "throw") {
372
- if (state === GenStateSuspendedStart) {
373
- state = GenStateCompleted;
374
- throw context.arg;
377
+ context.dispatchException(context.arg);
378
+ } else if (context.method === "return") {
379
+ context.abrupt("return", context.arg);
375
380
  }
376
381
 
377
- context.dispatchException(context.arg);
382
+ state = GenStateExecuting;
383
+ var record = tryCatch(innerFn, self, context);
378
384
 
379
- } else if (context.method === "return") {
380
- context.abrupt("return", context.arg);
381
- }
385
+ if (record.type === "normal") {
386
+ // If an exception is thrown from innerFn, we leave state ===
387
+ // GenStateExecuting and loop back for another invocation.
388
+ state = context.done ? GenStateCompleted : GenStateSuspendedYield;
382
389
 
383
- state = GenStateExecuting;
390
+ if (record.arg === ContinueSentinel) {
391
+ continue;
392
+ }
384
393
 
385
- var record = tryCatch(innerFn, self, context);
386
- if (record.type === "normal") {
387
- // If an exception is thrown from innerFn, we leave state ===
388
- // GenStateExecuting and loop back for another invocation.
389
- state = context.done
390
- ? GenStateCompleted
391
- : GenStateSuspendedYield;
394
+ return {
395
+ value: record.arg,
396
+ done: context.done
397
+ };
398
+ } else if (record.type === "throw") {
399
+ state = GenStateCompleted; // Dispatch the exception by looping back around to the
400
+ // context.dispatchException(context.arg) call above.
392
401
 
393
- if (record.arg === ContinueSentinel) {
394
- continue;
402
+ context.method = "throw";
403
+ context.arg = record.arg;
404
+ }
405
+ }
406
+ };
407
+ } // Call delegate.iterator[context.method](context.arg) and handle the
408
+ // result, either by returning a { value, done } result from the
409
+ // delegate iterator, or by modifying context.method and context.arg,
410
+ // setting context.delegate to null, and returning the ContinueSentinel.
411
+
412
+
413
+ function maybeInvokeDelegate(delegate, context) {
414
+ var method = delegate.iterator[context.method];
415
+
416
+ if (method === undefined$1) {
417
+ // A .throw or .return when the delegate iterator has no .throw
418
+ // method always terminates the yield* loop.
419
+ context.delegate = null;
420
+
421
+ if (context.method === "throw") {
422
+ // Note: ["return"] must be used for ES3 parsing compatibility.
423
+ if (delegate.iterator["return"]) {
424
+ // If the delegate iterator has a return method, give it a
425
+ // chance to clean up.
426
+ context.method = "return";
427
+ context.arg = undefined$1;
428
+ maybeInvokeDelegate(delegate, context);
429
+
430
+ if (context.method === "throw") {
431
+ // If maybeInvokeDelegate(context) changed context.method from
432
+ // "return" to "throw", let that override the TypeError below.
433
+ return ContinueSentinel;
434
+ }
395
435
  }
396
436
 
397
- return {
398
- value: record.arg,
399
- done: context.done
400
- };
401
-
402
- } else if (record.type === "throw") {
403
- state = GenStateCompleted;
404
- // Dispatch the exception by looping back around to the
405
- // context.dispatchException(context.arg) call above.
406
437
  context.method = "throw";
407
- context.arg = record.arg;
438
+ context.arg = new TypeError("The iterator does not provide a 'throw' method");
408
439
  }
440
+
441
+ return ContinueSentinel;
409
442
  }
410
- };
411
- }
412
443
 
413
- // Call delegate.iterator[context.method](context.arg) and handle the
414
- // result, either by returning a { value, done } result from the
415
- // delegate iterator, or by modifying context.method and context.arg,
416
- // setting context.delegate to null, and returning the ContinueSentinel.
417
- function maybeInvokeDelegate(delegate, context) {
418
- var method = delegate.iterator[context.method];
419
- if (method === undefined$1) {
420
- // A .throw or .return when the delegate iterator has no .throw
421
- // method always terminates the yield* loop.
422
- context.delegate = null;
444
+ var record = tryCatch(method, delegate.iterator, context.arg);
423
445
 
424
- if (context.method === "throw") {
425
- // Note: ["return"] must be used for ES3 parsing compatibility.
426
- if (delegate.iterator["return"]) {
427
- // If the delegate iterator has a return method, give it a
428
- // chance to clean up.
429
- context.method = "return";
430
- context.arg = undefined$1;
431
- maybeInvokeDelegate(delegate, context);
446
+ if (record.type === "throw") {
447
+ context.method = "throw";
448
+ context.arg = record.arg;
449
+ context.delegate = null;
450
+ return ContinueSentinel;
451
+ }
432
452
 
433
- if (context.method === "throw") {
434
- // If maybeInvokeDelegate(context) changed context.method from
435
- // "return" to "throw", let that override the TypeError below.
436
- return ContinueSentinel;
437
- }
438
- }
453
+ var info = record.arg;
439
454
 
455
+ if (!info) {
440
456
  context.method = "throw";
441
- context.arg = new TypeError(
442
- "The iterator does not provide a 'throw' method");
457
+ context.arg = new TypeError("iterator result is not an object");
458
+ context.delegate = null;
459
+ return ContinueSentinel;
443
460
  }
444
461
 
445
- return ContinueSentinel;
446
- }
462
+ if (info.done) {
463
+ // Assign the result of the finished delegate to the temporary
464
+ // variable specified by delegate.resultName (see delegateYield).
465
+ context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
447
466
 
448
- var record = tryCatch(method, delegate.iterator, context.arg);
467
+ context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
468
+ // exception, let the outer generator proceed normally. If
469
+ // context.method was "next", forget context.arg since it has been
470
+ // "consumed" by the delegate iterator. If context.method was
471
+ // "return", allow the original .return call to continue in the
472
+ // outer generator.
449
473
 
450
- if (record.type === "throw") {
451
- context.method = "throw";
452
- context.arg = record.arg;
453
- context.delegate = null;
454
- return ContinueSentinel;
455
- }
474
+ if (context.method !== "return") {
475
+ context.method = "next";
476
+ context.arg = undefined$1;
477
+ }
478
+ } else {
479
+ // Re-yield the result returned by the delegate method.
480
+ return info;
481
+ } // The delegate iterator is finished, so forget it and continue with
482
+ // the outer generator.
456
483
 
457
- var info = record.arg;
458
484
 
459
- if (! info) {
460
- context.method = "throw";
461
- context.arg = new TypeError("iterator result is not an object");
462
485
  context.delegate = null;
463
486
  return ContinueSentinel;
464
- }
465
-
466
- if (info.done) {
467
- // Assign the result of the finished delegate to the temporary
468
- // variable specified by delegate.resultName (see delegateYield).
469
- context[delegate.resultName] = info.value;
470
-
471
- // Resume execution at the desired location (see delegateYield).
472
- context.next = delegate.nextLoc;
473
-
474
- // If context.method was "throw" but the delegate handled the
475
- // exception, let the outer generator proceed normally. If
476
- // context.method was "next", forget context.arg since it has been
477
- // "consumed" by the delegate iterator. If context.method was
478
- // "return", allow the original .return call to continue in the
479
- // outer generator.
480
- if (context.method !== "return") {
481
- context.method = "next";
482
- context.arg = undefined$1;
483
- }
484
-
485
- } else {
486
- // Re-yield the result returned by the delegate method.
487
- return info;
488
- }
487
+ } // Define Generator.prototype.{next,throw,return} in terms of the
488
+ // unified ._invoke helper method.
489
489
 
490
- // The delegate iterator is finished, so forget it and continue with
491
- // the outer generator.
492
- context.delegate = null;
493
- return ContinueSentinel;
494
- }
495
490
 
496
- // Define Generator.prototype.{next,throw,return} in terms of the
497
- // unified ._invoke helper method.
498
- defineIteratorMethods(Gp);
491
+ defineIteratorMethods(Gp);
492
+ define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
493
+ // @@iterator function is called on it. Some browsers' implementations of the
494
+ // iterator prototype chain incorrectly implement this, causing the Generator
495
+ // object to not be returned from this call. This ensures that doesn't happen.
496
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
499
497
 
500
- define(Gp, toStringTagSymbol, "Generator");
498
+ define(Gp, iteratorSymbol, function () {
499
+ return this;
500
+ });
501
+ define(Gp, "toString", function () {
502
+ return "[object Generator]";
503
+ });
501
504
 
502
- // A Generator should always return itself as the iterator object when the
503
- // @@iterator function is called on it. Some browsers' implementations of the
504
- // iterator prototype chain incorrectly implement this, causing the Generator
505
- // object to not be returned from this call. This ensures that doesn't happen.
506
- // See https://github.com/facebook/regenerator/issues/274 for more details.
507
- define(Gp, iteratorSymbol, function() {
508
- return this;
509
- });
505
+ function pushTryEntry(locs) {
506
+ var entry = {
507
+ tryLoc: locs[0]
508
+ };
510
509
 
511
- define(Gp, "toString", function() {
512
- return "[object Generator]";
513
- });
510
+ if (1 in locs) {
511
+ entry.catchLoc = locs[1];
512
+ }
514
513
 
515
- function pushTryEntry(locs) {
516
- var entry = { tryLoc: locs[0] };
514
+ if (2 in locs) {
515
+ entry.finallyLoc = locs[2];
516
+ entry.afterLoc = locs[3];
517
+ }
517
518
 
518
- if (1 in locs) {
519
- entry.catchLoc = locs[1];
519
+ this.tryEntries.push(entry);
520
520
  }
521
521
 
522
- if (2 in locs) {
523
- entry.finallyLoc = locs[2];
524
- entry.afterLoc = locs[3];
522
+ function resetTryEntry(entry) {
523
+ var record = entry.completion || {};
524
+ record.type = "normal";
525
+ delete record.arg;
526
+ entry.completion = record;
525
527
  }
526
528
 
527
- this.tryEntries.push(entry);
528
- }
529
-
530
- function resetTryEntry(entry) {
531
- var record = entry.completion || {};
532
- record.type = "normal";
533
- delete record.arg;
534
- entry.completion = record;
535
- }
536
-
537
- function Context(tryLocsList) {
538
- // The root entry object (effectively a try statement without a catch
539
- // or a finally block) gives us a place to store values thrown from
540
- // locations where there is no enclosing try statement.
541
- this.tryEntries = [{ tryLoc: "root" }];
542
- tryLocsList.forEach(pushTryEntry, this);
543
- this.reset(true);
544
- }
545
-
546
- exports.keys = function(object) {
547
- var keys = [];
548
- for (var key in object) {
549
- keys.push(key);
529
+ function Context(tryLocsList) {
530
+ // The root entry object (effectively a try statement without a catch
531
+ // or a finally block) gives us a place to store values thrown from
532
+ // locations where there is no enclosing try statement.
533
+ this.tryEntries = [{
534
+ tryLoc: "root"
535
+ }];
536
+ tryLocsList.forEach(pushTryEntry, this);
537
+ this.reset(true);
550
538
  }
551
- keys.reverse();
552
-
553
- // Rather than returning an object with a next method, we keep
554
- // things simple and return the next function itself.
555
- return function next() {
556
- while (keys.length) {
557
- var key = keys.pop();
558
- if (key in object) {
559
- next.value = key;
560
- next.done = false;
561
- return next;
562
- }
563
- }
564
539
 
565
- // To avoid creating an additional object, we just hang the .value
566
- // and .done properties off the next function object itself. This
567
- // also ensures that the minifier will not anonymize the function.
568
- next.done = true;
569
- return next;
570
- };
571
- };
540
+ exports.keys = function (object) {
541
+ var keys = [];
572
542
 
573
- function values(iterable) {
574
- if (iterable) {
575
- var iteratorMethod = iterable[iteratorSymbol];
576
- if (iteratorMethod) {
577
- return iteratorMethod.call(iterable);
543
+ for (var key in object) {
544
+ keys.push(key);
578
545
  }
579
546
 
580
- if (typeof iterable.next === "function") {
581
- return iterable;
582
- }
547
+ keys.reverse(); // Rather than returning an object with a next method, we keep
548
+ // things simple and return the next function itself.
583
549
 
584
- if (!isNaN(iterable.length)) {
585
- var i = -1, next = function next() {
586
- while (++i < iterable.length) {
587
- if (hasOwn.call(iterable, i)) {
588
- next.value = iterable[i];
589
- next.done = false;
590
- return next;
591
- }
550
+ return function next() {
551
+ while (keys.length) {
552
+ var key = keys.pop();
553
+
554
+ if (key in object) {
555
+ next.value = key;
556
+ next.done = false;
557
+ return next;
592
558
  }
559
+ } // To avoid creating an additional object, we just hang the .value
560
+ // and .done properties off the next function object itself. This
561
+ // also ensures that the minifier will not anonymize the function.
593
562
 
594
- next.value = undefined$1;
595
- next.done = true;
596
563
 
597
- return next;
598
- };
564
+ next.done = true;
565
+ return next;
566
+ };
567
+ };
599
568
 
600
- return next.next = next;
601
- }
602
- }
569
+ function values(iterable) {
570
+ if (iterable) {
571
+ var iteratorMethod = iterable[iteratorSymbol];
603
572
 
604
- // Return an iterator with no values.
605
- return { next: doneResult };
606
- }
607
- exports.values = values;
573
+ if (iteratorMethod) {
574
+ return iteratorMethod.call(iterable);
575
+ }
608
576
 
609
- function doneResult() {
610
- return { value: undefined$1, done: true };
611
- }
577
+ if (typeof iterable.next === "function") {
578
+ return iterable;
579
+ }
612
580
 
613
- Context.prototype = {
614
- constructor: Context,
615
-
616
- reset: function(skipTempReset) {
617
- this.prev = 0;
618
- this.next = 0;
619
- // Resetting context._sent for legacy support of Babel's
620
- // function.sent implementation.
621
- this.sent = this._sent = undefined$1;
622
- this.done = false;
623
- this.delegate = null;
624
-
625
- this.method = "next";
626
- this.arg = undefined$1;
627
-
628
- this.tryEntries.forEach(resetTryEntry);
629
-
630
- if (!skipTempReset) {
631
- for (var name in this) {
632
- // Not sure about the optimal order of these conditions:
633
- if (name.charAt(0) === "t" &&
634
- hasOwn.call(this, name) &&
635
- !isNaN(+name.slice(1))) {
636
- this[name] = undefined$1;
637
- }
581
+ if (!isNaN(iterable.length)) {
582
+ var i = -1,
583
+ next = function next() {
584
+ while (++i < iterable.length) {
585
+ if (hasOwn.call(iterable, i)) {
586
+ next.value = iterable[i];
587
+ next.done = false;
588
+ return next;
589
+ }
590
+ }
591
+
592
+ next.value = undefined$1;
593
+ next.done = true;
594
+ return next;
595
+ };
596
+
597
+ return next.next = next;
638
598
  }
639
- }
640
- },
599
+ } // Return an iterator with no values.
641
600
 
642
- stop: function() {
643
- this.done = true;
644
601
 
645
- var rootEntry = this.tryEntries[0];
646
- var rootRecord = rootEntry.completion;
647
- if (rootRecord.type === "throw") {
648
- throw rootRecord.arg;
649
- }
602
+ return {
603
+ next: doneResult
604
+ };
605
+ }
650
606
 
651
- return this.rval;
652
- },
607
+ exports.values = values;
653
608
 
654
- dispatchException: function(exception) {
655
- if (this.done) {
656
- throw exception;
657
- }
609
+ function doneResult() {
610
+ return {
611
+ value: undefined$1,
612
+ done: true
613
+ };
614
+ }
658
615
 
659
- var context = this;
660
- function handle(loc, caught) {
661
- record.type = "throw";
662
- record.arg = exception;
663
- context.next = loc;
616
+ Context.prototype = {
617
+ constructor: Context,
618
+ reset: function reset(skipTempReset) {
619
+ this.prev = 0;
620
+ this.next = 0; // Resetting context._sent for legacy support of Babel's
621
+ // function.sent implementation.
664
622
 
665
- if (caught) {
666
- // If the dispatched exception was caught by a catch block,
667
- // then let that catch block handle the exception normally.
668
- context.method = "next";
669
- context.arg = undefined$1;
623
+ this.sent = this._sent = undefined$1;
624
+ this.done = false;
625
+ this.delegate = null;
626
+ this.method = "next";
627
+ this.arg = undefined$1;
628
+ this.tryEntries.forEach(resetTryEntry);
629
+
630
+ if (!skipTempReset) {
631
+ for (var name in this) {
632
+ // Not sure about the optimal order of these conditions:
633
+ if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
634
+ this[name] = undefined$1;
635
+ }
636
+ }
637
+ }
638
+ },
639
+ stop: function stop() {
640
+ this.done = true;
641
+ var rootEntry = this.tryEntries[0];
642
+ var rootRecord = rootEntry.completion;
643
+
644
+ if (rootRecord.type === "throw") {
645
+ throw rootRecord.arg;
670
646
  }
671
647
 
672
- return !! caught;
673
- }
648
+ return this.rval;
649
+ },
650
+ dispatchException: function dispatchException(exception) {
651
+ if (this.done) {
652
+ throw exception;
653
+ }
674
654
 
675
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
676
- var entry = this.tryEntries[i];
677
- var record = entry.completion;
655
+ var context = this;
678
656
 
679
- if (entry.tryLoc === "root") {
680
- // Exception thrown outside of any try block that could handle
681
- // it, so set the completion value of the entire function to
682
- // throw the exception.
683
- return handle("end");
657
+ function handle(loc, caught) {
658
+ record.type = "throw";
659
+ record.arg = exception;
660
+ context.next = loc;
661
+
662
+ if (caught) {
663
+ // If the dispatched exception was caught by a catch block,
664
+ // then let that catch block handle the exception normally.
665
+ context.method = "next";
666
+ context.arg = undefined$1;
667
+ }
668
+
669
+ return !!caught;
684
670
  }
685
671
 
686
- if (entry.tryLoc <= this.prev) {
687
- var hasCatch = hasOwn.call(entry, "catchLoc");
688
- var hasFinally = hasOwn.call(entry, "finallyLoc");
672
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
673
+ var entry = this.tryEntries[i];
674
+ var record = entry.completion;
689
675
 
690
- if (hasCatch && hasFinally) {
691
- if (this.prev < entry.catchLoc) {
692
- return handle(entry.catchLoc, true);
693
- } else if (this.prev < entry.finallyLoc) {
694
- return handle(entry.finallyLoc);
695
- }
676
+ if (entry.tryLoc === "root") {
677
+ // Exception thrown outside of any try block that could handle
678
+ // it, so set the completion value of the entire function to
679
+ // throw the exception.
680
+ return handle("end");
681
+ }
696
682
 
697
- } else if (hasCatch) {
698
- if (this.prev < entry.catchLoc) {
699
- return handle(entry.catchLoc, true);
700
- }
683
+ if (entry.tryLoc <= this.prev) {
684
+ var hasCatch = hasOwn.call(entry, "catchLoc");
685
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
701
686
 
702
- } else if (hasFinally) {
703
- if (this.prev < entry.finallyLoc) {
704
- return handle(entry.finallyLoc);
687
+ if (hasCatch && hasFinally) {
688
+ if (this.prev < entry.catchLoc) {
689
+ return handle(entry.catchLoc, true);
690
+ } else if (this.prev < entry.finallyLoc) {
691
+ return handle(entry.finallyLoc);
692
+ }
693
+ } else if (hasCatch) {
694
+ if (this.prev < entry.catchLoc) {
695
+ return handle(entry.catchLoc, true);
696
+ }
697
+ } else if (hasFinally) {
698
+ if (this.prev < entry.finallyLoc) {
699
+ return handle(entry.finallyLoc);
700
+ }
701
+ } else {
702
+ throw new Error("try statement without catch or finally");
705
703
  }
706
-
707
- } else {
708
- throw new Error("try statement without catch or finally");
709
704
  }
710
705
  }
711
- }
712
- },
713
-
714
- abrupt: function(type, arg) {
715
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
716
- var entry = this.tryEntries[i];
717
- if (entry.tryLoc <= this.prev &&
718
- hasOwn.call(entry, "finallyLoc") &&
719
- this.prev < entry.finallyLoc) {
720
- var finallyEntry = entry;
721
- break;
706
+ },
707
+ abrupt: function abrupt(type, arg) {
708
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
709
+ var entry = this.tryEntries[i];
710
+
711
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
712
+ var finallyEntry = entry;
713
+ break;
714
+ }
722
715
  }
723
- }
724
-
725
- if (finallyEntry &&
726
- (type === "break" ||
727
- type === "continue") &&
728
- finallyEntry.tryLoc <= arg &&
729
- arg <= finallyEntry.finallyLoc) {
730
- // Ignore the finally entry if control is not jumping to a
731
- // location outside the try/catch block.
732
- finallyEntry = null;
733
- }
734
-
735
- var record = finallyEntry ? finallyEntry.completion : {};
736
- record.type = type;
737
- record.arg = arg;
738
716
 
739
- if (finallyEntry) {
740
- this.method = "next";
741
- this.next = finallyEntry.finallyLoc;
742
- return ContinueSentinel;
743
- }
717
+ if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
718
+ // Ignore the finally entry if control is not jumping to a
719
+ // location outside the try/catch block.
720
+ finallyEntry = null;
721
+ }
744
722
 
745
- return this.complete(record);
746
- },
723
+ var record = finallyEntry ? finallyEntry.completion : {};
724
+ record.type = type;
725
+ record.arg = arg;
747
726
 
748
- complete: function(record, afterLoc) {
749
- if (record.type === "throw") {
750
- throw record.arg;
751
- }
727
+ if (finallyEntry) {
728
+ this.method = "next";
729
+ this.next = finallyEntry.finallyLoc;
730
+ return ContinueSentinel;
731
+ }
752
732
 
753
- if (record.type === "break" ||
754
- record.type === "continue") {
755
- this.next = record.arg;
756
- } else if (record.type === "return") {
757
- this.rval = this.arg = record.arg;
758
- this.method = "return";
759
- this.next = "end";
760
- } else if (record.type === "normal" && afterLoc) {
761
- this.next = afterLoc;
762
- }
733
+ return this.complete(record);
734
+ },
735
+ complete: function complete(record, afterLoc) {
736
+ if (record.type === "throw") {
737
+ throw record.arg;
738
+ }
763
739
 
764
- return ContinueSentinel;
765
- },
766
-
767
- finish: function(finallyLoc) {
768
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
769
- var entry = this.tryEntries[i];
770
- if (entry.finallyLoc === finallyLoc) {
771
- this.complete(entry.completion, entry.afterLoc);
772
- resetTryEntry(entry);
773
- return ContinueSentinel;
740
+ if (record.type === "break" || record.type === "continue") {
741
+ this.next = record.arg;
742
+ } else if (record.type === "return") {
743
+ this.rval = this.arg = record.arg;
744
+ this.method = "return";
745
+ this.next = "end";
746
+ } else if (record.type === "normal" && afterLoc) {
747
+ this.next = afterLoc;
774
748
  }
775
- }
776
- },
777
749
 
778
- "catch": function(tryLoc) {
779
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
780
- var entry = this.tryEntries[i];
781
- if (entry.tryLoc === tryLoc) {
782
- var record = entry.completion;
783
- if (record.type === "throw") {
784
- var thrown = record.arg;
750
+ return ContinueSentinel;
751
+ },
752
+ finish: function finish(finallyLoc) {
753
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
754
+ var entry = this.tryEntries[i];
755
+
756
+ if (entry.finallyLoc === finallyLoc) {
757
+ this.complete(entry.completion, entry.afterLoc);
785
758
  resetTryEntry(entry);
759
+ return ContinueSentinel;
786
760
  }
787
- return thrown;
788
761
  }
789
- }
762
+ },
763
+ "catch": function _catch(tryLoc) {
764
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
765
+ var entry = this.tryEntries[i];
790
766
 
791
- // The context.catch method must only be called with a location
792
- // argument that corresponds to a known catch block.
793
- throw new Error("illegal catch attempt");
794
- },
767
+ if (entry.tryLoc === tryLoc) {
768
+ var record = entry.completion;
795
769
 
796
- delegateYield: function(iterable, resultName, nextLoc) {
797
- this.delegate = {
798
- iterator: values(iterable),
799
- resultName: resultName,
800
- nextLoc: nextLoc
801
- };
770
+ if (record.type === "throw") {
771
+ var thrown = record.arg;
772
+ resetTryEntry(entry);
773
+ }
802
774
 
803
- if (this.method === "next") {
804
- // Deliberately forget the last sent value so that we don't
805
- // accidentally pass it on to the delegate.
806
- this.arg = undefined$1;
807
- }
775
+ return thrown;
776
+ }
777
+ } // The context.catch method must only be called with a location
778
+ // argument that corresponds to a known catch block.
808
779
 
809
- return ContinueSentinel;
810
- }
811
- };
812
780
 
813
- // Regardless of whether this script is executing as a CommonJS module
814
- // or not, return the runtime object so that we can declare the variable
815
- // regeneratorRuntime in the outer scope, which allows this module to be
816
- // injected easily by `bin/regenerator --include-runtime script.js`.
817
- return exports;
781
+ throw new Error("illegal catch attempt");
782
+ },
783
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
784
+ this.delegate = {
785
+ iterator: values(iterable),
786
+ resultName: resultName,
787
+ nextLoc: nextLoc
788
+ };
789
+
790
+ if (this.method === "next") {
791
+ // Deliberately forget the last sent value so that we don't
792
+ // accidentally pass it on to the delegate.
793
+ this.arg = undefined$1;
794
+ }
795
+
796
+ return ContinueSentinel;
797
+ }
798
+ }; // Regardless of whether this script is executing as a CommonJS module
799
+ // or not, return the runtime object so that we can declare the variable
800
+ // regeneratorRuntime in the outer scope, which allows this module to be
801
+ // injected easily by `bin/regenerator --include-runtime script.js`.
818
802
 
819
- }(
820
- // If this script is executing as a CommonJS module, use module.exports
803
+ return exports;
804
+ }( // If this script is executing as a CommonJS module, use module.exports
821
805
  // as the regeneratorRuntime namespace. Otherwise create a new empty
822
806
  // object. Either way, the resulting object will be used to initialize
823
807
  // the regeneratorRuntime variable at the top of this file.
824
- module.exports
825
- ));
826
-
827
- try {
828
- regeneratorRuntime = runtime;
829
- } catch (accidentalStrictMode) {
830
- // This module should not be running in strict mode, so the above
831
- // assignment should always work unless something is misconfigured. Just
832
- // in case runtime.js accidentally runs in strict mode, in modern engines
833
- // we can explicitly access globalThis. In older engines we can escape
834
- // strict mode using a global Function call. This could conceivably fail
835
- // if a Content Security Policy forbids using Function, but in that case
836
- // the proper solution is to fix the accidental strict mode problem. If
837
- // you've misconfigured your bundler to force strict mode and applied a
838
- // CSP to forbid Function, and you're not willing to fix either of those
839
- // problems, please detail your unique predicament in a GitHub issue.
840
- if (typeof globalThis === "object") {
841
- globalThis.regeneratorRuntime = runtime;
842
- } else {
843
- Function("r", "regeneratorRuntime = r")(runtime);
808
+ module.exports );
809
+
810
+ try {
811
+ regeneratorRuntime = runtime;
812
+ } catch (accidentalStrictMode) {
813
+ // This module should not be running in strict mode, so the above
814
+ // assignment should always work unless something is misconfigured. Just
815
+ // in case runtime.js accidentally runs in strict mode, in modern engines
816
+ // we can explicitly access globalThis. In older engines we can escape
817
+ // strict mode using a global Function call. This could conceivably fail
818
+ // if a Content Security Policy forbids using Function, but in that case
819
+ // the proper solution is to fix the accidental strict mode problem. If
820
+ // you've misconfigured your bundler to force strict mode and applied a
821
+ // CSP to forbid Function, and you're not willing to fix either of those
822
+ // problems, please detail your unique predicament in a GitHub issue.
823
+ if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object") {
824
+ globalThis.regeneratorRuntime = runtime;
825
+ } else {
826
+ Function("r", "regeneratorRuntime = r")(runtime);
827
+ }
844
828
  }
845
- }
846
829
  });
847
830
 
848
831
  var regenerator = runtime_1;