@innoways/ajv 8.0.6 → 8.0.8

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,273 +27,263 @@ 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);
43
- }
39
+ if (info.done) {
40
+ resolve(value);
41
+ } else {
42
+ Promise.resolve(value).then(_next, _throw);
44
43
  }
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
+
68
69
  var _asyncToGenerator = unwrapExports(asyncToGenerator);
69
70
 
70
71
  var defineProperty = createCommonjsModule(function (module) {
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
- }
82
-
83
- return obj;
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;
84
82
  }
85
83
 
86
- module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
84
+ return obj;
85
+ }
86
+
87
+ module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
87
88
  });
89
+
88
90
  var _defineProperty = unwrapExports(defineProperty);
89
91
 
90
- var _typeof_1 = createCommonjsModule(function (module) {
91
- function _typeof(obj) {
92
- "@babel/helpers - typeof";
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
+ */
93
99
 
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);
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
+ };
99
126
  }
100
127
 
101
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
102
- });
103
-
104
- var _typeof = unwrapExports(_typeof_1);
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 || []);
105
133
 
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
- }
134
+ // The ._invoke method unifies the implementations of the .next,
135
+ // .throw, and .return methods.
136
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
133
137
 
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) {
134
153
  try {
135
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
136
- define({}, "");
154
+ return { type: "normal", arg: fn.call(obj, arg) };
137
155
  } catch (err) {
138
- define = function define(obj, key, value) {
139
- return obj[key] = value;
140
- };
141
- }
142
-
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.
149
-
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
- }
156
+ return { type: "throw", arg: err };
177
157
  }
158
+ }
178
159
 
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
-
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
+ }
197
193
 
198
- var IteratorPrototype = {};
199
- define(IteratorPrototype, iteratorSymbol, function () {
200
- return this;
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
+ });
201
212
  });
202
- var getProto = Object.getPrototypeOf;
203
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
204
-
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;
209
- }
213
+ }
210
214
 
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);
222
- });
223
- });
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");
224
231
  }
225
-
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
- };
232
-
233
- exports.mark = function (genFun) {
234
- if (Object.setPrototypeOf) {
235
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
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);
236
249
  } 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);
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);
283
259
  });
284
260
  }
261
+
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);
272
+ });
285
273
  }
274
+ }
286
275
 
287
- var previousPromise;
276
+ var previousPromise;
288
277
 
289
- function enqueue(method, arg) {
290
- function callInvokeWithMethodAndArg() {
291
- return new PromiseImpl(function (resolve, reject) {
292
- invoke(method, arg, resolve, reject);
293
- });
294
- }
278
+ function enqueue(method, arg) {
279
+ function callInvokeWithMethodAndArg() {
280
+ return new PromiseImpl(function(resolve, reject) {
281
+ invoke(method, arg, resolve, reject);
282
+ });
283
+ }
295
284
 
296
- return previousPromise = // If enqueue has been called before, then we want to wait until
285
+ return previousPromise =
286
+ // If enqueue has been called before, then we want to wait until
297
287
  // all previous Promises have been resolved before calling invoke,
298
288
  // so that results are always delivered in the correct order. If
299
289
  // enqueue has not been called before, then it is important to
@@ -305,527 +295,554 @@ var runtime_1 = createCommonjsModule(function (module) {
305
295
  // execute code before the first await. Since we implement simple
306
296
  // async functions in terms of async generators, it is especially
307
297
  // important to get this right, even though it requires care.
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;
298
+ previousPromise ? previousPromise.then(
299
+ callInvokeWithMethodAndArg,
300
+ // Avoid propagating failures to Promises returned by later
301
+ // invocations of the iterator.
302
+ callInvokeWithMethodAndArg
303
+ ) : callInvokeWithMethodAndArg();
316
304
  }
317
305
 
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
- };
306
+ // Define the unified helper method that is used to implement .next,
307
+ // .throw, and .return (see defineIteratorMethods).
308
+ this._invoke = enqueue;
309
+ }
334
310
 
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
- }
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
+ };
341
334
 
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
335
+ function makeInvokeMethod(innerFn, self, context) {
336
+ var state = GenStateSuspendedStart;
347
337
 
338
+ return function invoke(method, arg) {
339
+ if (state === GenStateExecuting) {
340
+ throw new Error("Generator is already running");
341
+ }
348
342
 
349
- return doneResult();
343
+ if (state === GenStateCompleted) {
344
+ if (method === "throw") {
345
+ throw arg;
350
346
  }
351
347
 
352
- context.method = method;
353
- context.arg = arg;
354
-
355
- while (true) {
356
- var delegate = context.delegate;
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
+ }
357
352
 
358
- if (delegate) {
359
- var delegateResult = maybeInvokeDelegate(delegate, context);
353
+ context.method = method;
354
+ context.arg = arg;
360
355
 
361
- if (delegateResult) {
362
- if (delegateResult === ContinueSentinel) continue;
363
- return delegateResult;
364
- }
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;
365
363
  }
364
+ }
366
365
 
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
- }
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;
376
370
 
377
- context.dispatchException(context.arg);
378
- } else if (context.method === "return") {
379
- context.abrupt("return", context.arg);
371
+ } else if (context.method === "throw") {
372
+ if (state === GenStateSuspendedStart) {
373
+ state = GenStateCompleted;
374
+ throw context.arg;
380
375
  }
381
376
 
382
- state = GenStateExecuting;
383
- var record = tryCatch(innerFn, self, context);
377
+ context.dispatchException(context.arg);
384
378
 
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;
379
+ } else if (context.method === "return") {
380
+ context.abrupt("return", context.arg);
381
+ }
389
382
 
390
- if (record.arg === ContinueSentinel) {
391
- continue;
392
- }
383
+ state = GenStateExecuting;
393
384
 
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.
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;
401
392
 
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
- }
393
+ if (record.arg === ContinueSentinel) {
394
+ continue;
435
395
  }
436
396
 
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.
437
406
  context.method = "throw";
438
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
407
+ context.arg = record.arg;
439
408
  }
440
-
441
- return ContinueSentinel;
442
409
  }
410
+ };
411
+ }
443
412
 
444
- var record = tryCatch(method, delegate.iterator, context.arg);
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;
445
423
 
446
- if (record.type === "throw") {
447
- context.method = "throw";
448
- context.arg = record.arg;
449
- context.delegate = null;
450
- return ContinueSentinel;
451
- }
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);
452
432
 
453
- var info = record.arg;
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
+ }
454
439
 
455
- if (!info) {
456
440
  context.method = "throw";
457
- context.arg = new TypeError("iterator result is not an object");
458
- context.delegate = null;
459
- return ContinueSentinel;
441
+ context.arg = new TypeError(
442
+ "The iterator does not provide a 'throw' method");
460
443
  }
461
444
 
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).
466
-
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.
473
-
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.
445
+ return ContinueSentinel;
446
+ }
483
447
 
448
+ var record = tryCatch(method, delegate.iterator, context.arg);
484
449
 
450
+ if (record.type === "throw") {
451
+ context.method = "throw";
452
+ context.arg = record.arg;
485
453
  context.delegate = null;
486
454
  return ContinueSentinel;
487
- } // Define Generator.prototype.{next,throw,return} in terms of the
488
- // unified ._invoke helper method.
489
-
490
-
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.
497
-
498
- define(Gp, iteratorSymbol, function () {
499
- return this;
500
- });
501
- define(Gp, "toString", function () {
502
- return "[object Generator]";
503
- });
455
+ }
504
456
 
505
- function pushTryEntry(locs) {
506
- var entry = {
507
- tryLoc: locs[0]
508
- };
457
+ var info = record.arg;
509
458
 
510
- if (1 in locs) {
511
- entry.catchLoc = locs[1];
512
- }
459
+ if (! info) {
460
+ context.method = "throw";
461
+ context.arg = new TypeError("iterator result is not an object");
462
+ context.delegate = null;
463
+ return ContinueSentinel;
464
+ }
513
465
 
514
- if (2 in locs) {
515
- entry.finallyLoc = locs[2];
516
- entry.afterLoc = locs[3];
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;
517
483
  }
518
484
 
519
- this.tryEntries.push(entry);
485
+ } else {
486
+ // Re-yield the result returned by the delegate method.
487
+ return info;
520
488
  }
521
489
 
522
- function resetTryEntry(entry) {
523
- var record = entry.completion || {};
524
- record.type = "normal";
525
- delete record.arg;
526
- entry.completion = record;
527
- }
490
+ // The delegate iterator is finished, so forget it and continue with
491
+ // the outer generator.
492
+ context.delegate = null;
493
+ return ContinueSentinel;
494
+ }
528
495
 
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);
538
- }
496
+ // Define Generator.prototype.{next,throw,return} in terms of the
497
+ // unified ._invoke helper method.
498
+ defineIteratorMethods(Gp);
539
499
 
540
- exports.keys = function (object) {
541
- var keys = [];
500
+ define(Gp, toStringTagSymbol, "Generator");
542
501
 
543
- for (var key in object) {
544
- keys.push(key);
545
- }
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
+ });
546
510
 
547
- keys.reverse(); // Rather than returning an object with a next method, we keep
548
- // things simple and return the next function itself.
511
+ define(Gp, "toString", function() {
512
+ return "[object Generator]";
513
+ });
549
514
 
550
- return function next() {
551
- while (keys.length) {
552
- var key = keys.pop();
515
+ function pushTryEntry(locs) {
516
+ var entry = { tryLoc: locs[0] };
553
517
 
554
- if (key in object) {
555
- next.value = key;
556
- next.done = false;
557
- return next;
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.
518
+ if (1 in locs) {
519
+ entry.catchLoc = locs[1];
520
+ }
562
521
 
522
+ if (2 in locs) {
523
+ entry.finallyLoc = locs[2];
524
+ entry.afterLoc = locs[3];
525
+ }
563
526
 
564
- next.done = true;
565
- return next;
566
- };
567
- };
527
+ this.tryEntries.push(entry);
528
+ }
568
529
 
569
- function values(iterable) {
570
- if (iterable) {
571
- var iteratorMethod = iterable[iteratorSymbol];
530
+ function resetTryEntry(entry) {
531
+ var record = entry.completion || {};
532
+ record.type = "normal";
533
+ delete record.arg;
534
+ entry.completion = record;
535
+ }
572
536
 
573
- if (iteratorMethod) {
574
- return iteratorMethod.call(iterable);
575
- }
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
+ }
576
545
 
577
- if (typeof iterable.next === "function") {
578
- return iterable;
546
+ exports.keys = function(object) {
547
+ var keys = [];
548
+ for (var key in object) {
549
+ keys.push(key);
550
+ }
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;
579
562
  }
563
+ }
580
564
 
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
- }
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
+ };
591
572
 
592
- next.value = undefined$1;
593
- next.done = true;
594
- return next;
595
- };
573
+ function values(iterable) {
574
+ if (iterable) {
575
+ var iteratorMethod = iterable[iteratorSymbol];
576
+ if (iteratorMethod) {
577
+ return iteratorMethod.call(iterable);
578
+ }
596
579
 
597
- return next.next = next;
598
- }
599
- } // Return an iterator with no values.
580
+ if (typeof iterable.next === "function") {
581
+ return iterable;
582
+ }
600
583
 
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
+ }
592
+ }
601
593
 
602
- return {
603
- next: doneResult
604
- };
605
- }
594
+ next.value = undefined$1;
595
+ next.done = true;
606
596
 
607
- exports.values = values;
597
+ return next;
598
+ };
608
599
 
609
- function doneResult() {
610
- return {
611
- value: undefined$1,
612
- done: true
613
- };
600
+ return next.next = next;
601
+ }
614
602
  }
615
603
 
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.
604
+ // Return an iterator with no values.
605
+ return { next: doneResult };
606
+ }
607
+ exports.values = values;
622
608
 
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);
609
+ function doneResult() {
610
+ return { value: undefined$1, done: true };
611
+ }
629
612
 
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
- }
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;
636
637
  }
637
638
  }
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;
646
- }
639
+ }
640
+ },
647
641
 
648
- return this.rval;
649
- },
650
- dispatchException: function dispatchException(exception) {
651
- if (this.done) {
652
- throw exception;
653
- }
642
+ stop: function() {
643
+ this.done = true;
654
644
 
655
- var context = this;
645
+ var rootEntry = this.tryEntries[0];
646
+ var rootRecord = rootEntry.completion;
647
+ if (rootRecord.type === "throw") {
648
+ throw rootRecord.arg;
649
+ }
656
650
 
657
- function handle(loc, caught) {
658
- record.type = "throw";
659
- record.arg = exception;
660
- context.next = loc;
651
+ return this.rval;
652
+ },
661
653
 
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
- }
654
+ dispatchException: function(exception) {
655
+ if (this.done) {
656
+ throw exception;
657
+ }
658
+
659
+ var context = this;
660
+ function handle(loc, caught) {
661
+ record.type = "throw";
662
+ record.arg = exception;
663
+ context.next = loc;
668
664
 
669
- return !!caught;
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;
670
670
  }
671
671
 
672
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
673
- var entry = this.tryEntries[i];
674
- var record = entry.completion;
672
+ return !! caught;
673
+ }
675
674
 
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
- }
675
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
676
+ var entry = this.tryEntries[i];
677
+ var record = entry.completion;
682
678
 
683
- if (entry.tryLoc <= this.prev) {
684
- var hasCatch = hasOwn.call(entry, "catchLoc");
685
- var hasFinally = hasOwn.call(entry, "finallyLoc");
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");
684
+ }
686
685
 
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");
686
+ if (entry.tryLoc <= this.prev) {
687
+ var hasCatch = hasOwn.call(entry, "catchLoc");
688
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
689
+
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
+ }
696
+
697
+ } else if (hasCatch) {
698
+ if (this.prev < entry.catchLoc) {
699
+ return handle(entry.catchLoc, true);
700
+ }
701
+
702
+ } else if (hasFinally) {
703
+ if (this.prev < entry.finallyLoc) {
704
+ return handle(entry.finallyLoc);
703
705
  }
706
+
707
+ } else {
708
+ throw new Error("try statement without catch or finally");
704
709
  }
705
710
  }
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
- }
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;
715
722
  }
723
+ }
716
724
 
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
- }
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
+ }
722
734
 
723
- var record = finallyEntry ? finallyEntry.completion : {};
724
- record.type = type;
725
- record.arg = arg;
735
+ var record = finallyEntry ? finallyEntry.completion : {};
736
+ record.type = type;
737
+ record.arg = arg;
726
738
 
727
- if (finallyEntry) {
728
- this.method = "next";
729
- this.next = finallyEntry.finallyLoc;
730
- return ContinueSentinel;
731
- }
739
+ if (finallyEntry) {
740
+ this.method = "next";
741
+ this.next = finallyEntry.finallyLoc;
742
+ return ContinueSentinel;
743
+ }
732
744
 
733
- return this.complete(record);
734
- },
735
- complete: function complete(record, afterLoc) {
736
- if (record.type === "throw") {
737
- throw record.arg;
738
- }
745
+ return this.complete(record);
746
+ },
739
747
 
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;
748
- }
748
+ complete: function(record, afterLoc) {
749
+ if (record.type === "throw") {
750
+ throw record.arg;
751
+ }
749
752
 
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];
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
+ }
763
+
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;
774
+ }
775
+ }
776
+ },
755
777
 
756
- if (entry.finallyLoc === finallyLoc) {
757
- this.complete(entry.completion, entry.afterLoc);
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;
758
785
  resetTryEntry(entry);
759
- return ContinueSentinel;
760
786
  }
787
+ return thrown;
761
788
  }
762
- },
763
- "catch": function _catch(tryLoc) {
764
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
765
- var entry = this.tryEntries[i];
766
-
767
- if (entry.tryLoc === tryLoc) {
768
- var record = entry.completion;
769
-
770
- if (record.type === "throw") {
771
- var thrown = record.arg;
772
- resetTryEntry(entry);
773
- }
789
+ }
774
790
 
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.
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
+ },
779
795
 
796
+ delegateYield: function(iterable, resultName, nextLoc) {
797
+ this.delegate = {
798
+ iterator: values(iterable),
799
+ resultName: resultName,
800
+ nextLoc: nextLoc
801
+ };
780
802
 
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
- };
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
+ }
789
808
 
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
- }
809
+ return ContinueSentinel;
810
+ }
811
+ };
795
812
 
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`.
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;
802
818
 
803
- return exports;
804
- }( // If this script is executing as a CommonJS module, use module.exports
819
+ }(
820
+ // If this script is executing as a CommonJS module, use module.exports
805
821
  // as the regeneratorRuntime namespace. Otherwise create a new empty
806
822
  // object. Either way, the resulting object will be used to initialize
807
823
  // the regeneratorRuntime variable at the top of this file.
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
- }
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);
828
844
  }
845
+ }
829
846
  });
830
847
 
831
848
  var regenerator = runtime_1;