@blackglory/structures 0.3.2 → 0.3.5

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.
@@ -233,30 +233,2458 @@ class Queue {
233
233
 
234
234
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
235
235
 
236
- var es2018$6 = {};
236
+ var es2018$b = {};
237
+
238
+ var customError$1 = {};
239
+
240
+ var es2018$a = {};
241
+
242
+ var middleware$1 = {};
243
+
244
+ var chunkAsync$3 = {};
245
+
246
+ var es2018$9 = {};
247
+
248
+ var go$3 = {};
249
+
250
+ go$3.go = void 0;
251
+ function go$2(fn) {
252
+ return fn();
253
+ }
254
+ go$3.go = go$2;
255
+
256
+ (function (exports) {
257
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
258
+ if (k2 === undefined) k2 = k;
259
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
260
+ }) : (function(o, m, k, k2) {
261
+ if (k2 === undefined) k2 = k;
262
+ o[k2] = m[k];
263
+ }));
264
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
265
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
266
+ };__exportStar(go$3, exports);
267
+
268
+ }(es2018$9));
269
+
270
+ var es2018$8 = {};
271
+
272
+ var customError = {};
273
+
274
+ customError.CustomError = void 0;
275
+ class CustomError$1 extends Error {
276
+ get name() {
277
+ return this.constructor.name;
278
+ }
279
+ }
280
+ customError.CustomError = CustomError$1;
281
+
282
+ var expectedError = {};
283
+
284
+ expectedError.ExpectedError = void 0;
285
+ const custom_error_1$2 = customError;
286
+ class ExpectedError extends custom_error_1$2.CustomError {
287
+ }
288
+ expectedError.ExpectedError = ExpectedError;
289
+
290
+ var assertionError$1 = {};
291
+
292
+ assertionError$1.AssertionError = void 0;
293
+ const custom_error_1$1 = customError;
294
+ class AssertionError$1 extends custom_error_1$1.CustomError {
295
+ }
296
+ assertionError$1.AssertionError = AssertionError$1;
297
+
298
+ var normalize$3 = {};
299
+
300
+ normalize$3.normalize = void 0;
301
+ function normalize$2(err) {
302
+ var _a;
303
+ return {
304
+ name: err.name,
305
+ message: err.message,
306
+ stack: (_a = err.stack) !== null && _a !== void 0 ? _a : null
307
+ };
308
+ }
309
+ normalize$3.normalize = normalize$2;
310
+
311
+ var refute$1 = {};
312
+
313
+ refute$1.refute = void 0;
314
+ const expected_error_1 = expectedError;
315
+ function refute(condition, message) {
316
+ if (condition)
317
+ throw new expected_error_1.ExpectedError(message);
318
+ }
319
+ refute$1.refute = refute;
320
+
321
+ var assert$3 = {};
322
+
323
+ assert$3.assert = void 0;
324
+ const assertion_error_1$1 = assertionError$1;
325
+ function assert$2(condition, message) {
326
+ if (!condition)
327
+ throw new assertion_error_1$1.AssertionError(message);
328
+ }
329
+ assert$3.assert = assert$2;
330
+
331
+ (function (exports) {
332
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
333
+ if (k2 === undefined) k2 = k;
334
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
335
+ }) : (function(o, m, k, k2) {
336
+ if (k2 === undefined) k2 = k;
337
+ o[k2] = m[k];
338
+ }));
339
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
340
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
341
+ };__exportStar(customError, exports);
342
+ __exportStar(expectedError, exports);
343
+ __exportStar(assertionError$1, exports);
344
+ __exportStar(normalize$3, exports);
345
+ __exportStar(refute$1, exports);
346
+ __exportStar(assert$3, exports);
347
+
348
+ }(es2018$8));
349
+
350
+ chunkAsync$3.chunkAsync = void 0;
351
+ const go_1$v = es2018$9;
352
+ const errors_1$v = es2018$8;
353
+ function chunkAsync$2(iterable, size) {
354
+ (0, errors_1$v.assert)(Number.isInteger(size), 'The parameter size must be an integer');
355
+ (0, errors_1$v.assert)(size > 0, 'The parameter size must be greater than 0');
356
+ return (0, go_1$v.go)(async function* () {
357
+ let buffer = [];
358
+ for await (const element of iterable) {
359
+ buffer.push(element);
360
+ if (buffer.length >= size) {
361
+ yield buffer;
362
+ buffer = [];
363
+ }
364
+ }
365
+ if (buffer.length)
366
+ yield buffer;
367
+ });
368
+ }
369
+ chunkAsync$3.chunkAsync = chunkAsync$2;
370
+
371
+ var chunkByAsync$3 = {};
372
+
373
+ var es2018$7 = {};
374
+
375
+ var array$2 = {};
376
+
377
+ array$2.isntEmptyArray = array$2.isEmptyArray = array$2.isntArray = array$2.isArray = void 0;
378
+ function isArray$2(val) {
379
+ return Array.isArray(val);
380
+ }
381
+ array$2.isArray = isArray$2;
382
+ function isntArray$2(val) {
383
+ return !isArray$2(val);
384
+ }
385
+ array$2.isntArray = isntArray$2;
386
+ function isEmptyArray$2(val) {
387
+ return val.length === 0;
388
+ }
389
+ array$2.isEmptyArray = isEmptyArray$2;
390
+ function isntEmptyArray$2(val) {
391
+ return val.length !== 0;
392
+ }
393
+ array$2.isntEmptyArray = isntEmptyArray$2;
394
+
395
+ var asyncIterable$2 = {};
396
+
397
+ var _null$2 = {};
398
+
399
+ _null$2.isntNull = _null$2.isNull = void 0;
400
+ function isNull$2(val) {
401
+ return val === null;
402
+ }
403
+ _null$2.isNull = isNull$2;
404
+ function isntNull$2(val) {
405
+ return !isNull$2(val);
406
+ }
407
+ _null$2.isntNull = isntNull$2;
408
+
409
+ var _undefined$2 = {};
410
+
411
+ _undefined$2.isntUndefined = _undefined$2.isUndefined = void 0;
412
+ function isUndefined$2(val) {
413
+ return val === undefined;
414
+ }
415
+ _undefined$2.isUndefined = isUndefined$2;
416
+ function isntUndefined$2(val) {
417
+ return !isUndefined$2(val);
418
+ }
419
+ _undefined$2.isntUndefined = isntUndefined$2;
420
+
421
+ asyncIterable$2.isntAsyncIterable = asyncIterable$2.isAsyncIterable = void 0;
422
+ const null_1$6 = _null$2;
423
+ const undefined_1$7 = _undefined$2;
424
+ function isAsyncIterable$2(val) {
425
+ return (0, null_1$6.isntNull)(val)
426
+ && (0, undefined_1$7.isntUndefined)(val)
427
+ && typeof val[Symbol.asyncIterator] === 'function';
428
+ }
429
+ asyncIterable$2.isAsyncIterable = isAsyncIterable$2;
430
+ function isntAsyncIterable$2(val) {
431
+ return !isAsyncIterable$2(val);
432
+ }
433
+ asyncIterable$2.isntAsyncIterable = isntAsyncIterable$2;
434
+
435
+ var bigint$2 = {};
436
+
437
+ bigint$2.isntBigInt = bigint$2.isBigInt = void 0;
438
+ function isBigInt$2(val) {
439
+ return typeof val === 'bigint';
440
+ }
441
+ bigint$2.isBigInt = isBigInt$2;
442
+ function isntBigInt$2(val) {
443
+ return !isBigInt$2(val);
444
+ }
445
+ bigint$2.isntBigInt = isntBigInt$2;
446
+
447
+ var boolean$2 = {};
448
+
449
+ boolean$2.isntBoolean = boolean$2.isBoolean = void 0;
450
+ function isBoolean$2(val) {
451
+ return typeof val === 'boolean';
452
+ }
453
+ boolean$2.isBoolean = isBoolean$2;
454
+ function isntBoolean$2(val) {
455
+ return !isBoolean$2(val);
456
+ }
457
+ boolean$2.isntBoolean = isntBoolean$2;
458
+
459
+ var char$2 = {};
460
+
461
+ var string$2 = {};
462
+
463
+ string$2.isntString = string$2.isString = void 0;
464
+ function isString$2(val) {
465
+ return typeof val === 'string';
466
+ }
467
+ string$2.isString = isString$2;
468
+ function isntString$2(val) {
469
+ return !isString$2(val);
470
+ }
471
+ string$2.isntString = isntString$2;
472
+
473
+ char$2.isntChar = char$2.isChar = void 0;
474
+ const string_1$5 = string$2;
475
+ function isChar$2(val) {
476
+ return (0, string_1$5.isString)(val)
477
+ && val.length === 1;
478
+ }
479
+ char$2.isChar = isChar$2;
480
+ function isntChar$2(val) {
481
+ return !isChar$2(val);
482
+ }
483
+ char$2.isntChar = isntChar$2;
484
+
485
+ var date$2 = {};
486
+
487
+ date$2.isntDate = date$2.isDate = void 0;
488
+ function isDate$2(val) {
489
+ return val instanceof Date;
490
+ }
491
+ date$2.isDate = isDate$2;
492
+ function isntDate$2(val) {
493
+ return !isDate$2(val);
494
+ }
495
+ date$2.isntDate = isntDate$2;
496
+
497
+ var _enum$2 = {};
498
+
499
+ _enum$2.inEnum = void 0;
500
+ function inEnum$2(val, _enum) {
501
+ return Object.values(_enum).includes(val);
502
+ }
503
+ _enum$2.inEnum = inEnum$2;
504
+
505
+ var error$2 = {};
506
+
507
+ error$2.isntError = error$2.isError = void 0;
508
+ function isError$2(val) {
509
+ return val instanceof Error;
510
+ }
511
+ error$2.isError = isError$2;
512
+ function isntError$2(val) {
513
+ return !isError$2(val);
514
+ }
515
+ error$2.isntError = isntError$2;
516
+
517
+ var falsy$2 = {};
518
+
519
+ falsy$2.isntFalsy = falsy$2.isFalsy = void 0;
520
+ function isFalsy$2(val) {
521
+ return !val;
522
+ }
523
+ falsy$2.isFalsy = isFalsy$2;
524
+ function isntFalsy$2(val) {
525
+ return !isFalsy$2(val);
526
+ }
527
+ falsy$2.isntFalsy = isntFalsy$2;
528
+
529
+ var _function$2 = {};
530
+
531
+ _function$2.isntFunction = _function$2.isFunction = void 0;
532
+ function isFunction$3(val) {
533
+ return typeof val === 'function';
534
+ }
535
+ _function$2.isFunction = isFunction$3;
536
+ function isntFunction$2(val) {
537
+ return !isFunction$3(val);
538
+ }
539
+ _function$2.isntFunction = isntFunction$2;
540
+
541
+ var iterable$2 = {};
542
+
543
+ iterable$2.isntIterable = iterable$2.isIterable = void 0;
544
+ const null_1$5 = _null$2;
545
+ const undefined_1$6 = _undefined$2;
546
+ function isIterable$2(val) {
547
+ return (0, null_1$5.isntNull)(val)
548
+ && (0, undefined_1$6.isntUndefined)(val)
549
+ && typeof val[Symbol.iterator] === 'function';
550
+ }
551
+ iterable$2.isIterable = isIterable$2;
552
+ function isntIterable$2(val) {
553
+ return !isIterable$2(val);
554
+ }
555
+ iterable$2.isntIterable = isntIterable$2;
556
+
557
+ var jsonRpc$1 = {};
558
+
559
+ var object$2 = {};
560
+
561
+ /**
562
+ * lodash (Custom Build) <https://lodash.com/>
563
+ * Build: `lodash modularize exports="npm" -o ./`
564
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
565
+ * Released under MIT license <https://lodash.com/license>
566
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
567
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
568
+ */
569
+
570
+ /** `Object#toString` result references. */
571
+ var objectTag = '[object Object]';
572
+
573
+ /**
574
+ * Checks if `value` is a host object in IE < 9.
575
+ *
576
+ * @private
577
+ * @param {*} value The value to check.
578
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
579
+ */
580
+ function isHostObject(value) {
581
+ // Many host objects are `Object` objects that can coerce to strings
582
+ // despite having improperly defined `toString` methods.
583
+ var result = false;
584
+ if (value != null && typeof value.toString != 'function') {
585
+ try {
586
+ result = !!(value + '');
587
+ } catch (e) {}
588
+ }
589
+ return result;
590
+ }
591
+
592
+ /**
593
+ * Creates a unary function that invokes `func` with its argument transformed.
594
+ *
595
+ * @private
596
+ * @param {Function} func The function to wrap.
597
+ * @param {Function} transform The argument transform.
598
+ * @returns {Function} Returns the new function.
599
+ */
600
+ function overArg(func, transform) {
601
+ return function(arg) {
602
+ return func(transform(arg));
603
+ };
604
+ }
605
+
606
+ /** Used for built-in method references. */
607
+ var funcProto = Function.prototype,
608
+ objectProto = Object.prototype;
609
+
610
+ /** Used to resolve the decompiled source of functions. */
611
+ var funcToString = funcProto.toString;
612
+
613
+ /** Used to check objects for own properties. */
614
+ var hasOwnProperty = objectProto.hasOwnProperty;
615
+
616
+ /** Used to infer the `Object` constructor. */
617
+ var objectCtorString = funcToString.call(Object);
618
+
619
+ /**
620
+ * Used to resolve the
621
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
622
+ * of values.
623
+ */
624
+ var objectToString = objectProto.toString;
625
+
626
+ /** Built-in value references. */
627
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
628
+
629
+ /**
630
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
631
+ * and has a `typeof` result of "object".
632
+ *
633
+ * @static
634
+ * @memberOf _
635
+ * @since 4.0.0
636
+ * @category Lang
637
+ * @param {*} value The value to check.
638
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
639
+ * @example
640
+ *
641
+ * _.isObjectLike({});
642
+ * // => true
643
+ *
644
+ * _.isObjectLike([1, 2, 3]);
645
+ * // => true
646
+ *
647
+ * _.isObjectLike(_.noop);
648
+ * // => false
649
+ *
650
+ * _.isObjectLike(null);
651
+ * // => false
652
+ */
653
+ function isObjectLike(value) {
654
+ return !!value && typeof value == 'object';
655
+ }
656
+
657
+ /**
658
+ * Checks if `value` is a plain object, that is, an object created by the
659
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
660
+ *
661
+ * @static
662
+ * @memberOf _
663
+ * @since 0.8.0
664
+ * @category Lang
665
+ * @param {*} value The value to check.
666
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
667
+ * @example
668
+ *
669
+ * function Foo() {
670
+ * this.a = 1;
671
+ * }
672
+ *
673
+ * _.isPlainObject(new Foo);
674
+ * // => false
675
+ *
676
+ * _.isPlainObject([1, 2, 3]);
677
+ * // => false
678
+ *
679
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
680
+ * // => true
681
+ *
682
+ * _.isPlainObject(Object.create(null));
683
+ * // => true
684
+ */
685
+ function isPlainObject$3(value) {
686
+ if (!isObjectLike(value) ||
687
+ objectToString.call(value) != objectTag || isHostObject(value)) {
688
+ return false;
689
+ }
690
+ var proto = getPrototype(value);
691
+ if (proto === null) {
692
+ return true;
693
+ }
694
+ var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
695
+ return (typeof Ctor == 'function' &&
696
+ Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
697
+ }
698
+
699
+ var lodash_isplainobject = isPlainObject$3;
700
+
701
+ var __importDefault$2 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
702
+ return (mod && mod.__esModule) ? mod : { "default": mod };
703
+ };object$2.isntEmptyObject = object$2.isEmptyObject = object$2.isntPlainObject = object$2.isPlainObject = object$2.isntObject = object$2.isObject = void 0;
704
+ const lodash_isplainobject_1$2 = __importDefault$2(lodash_isplainobject);
705
+ function isObject$2(val) {
706
+ return val !== null
707
+ && typeof val === 'object';
708
+ }
709
+ object$2.isObject = isObject$2;
710
+ function isntObject$2(val) {
711
+ return !isObject$2(val);
712
+ }
713
+ object$2.isntObject = isntObject$2;
714
+ function isPlainObject$2(val) {
715
+ return (0, lodash_isplainobject_1$2.default)(val);
716
+ }
717
+ object$2.isPlainObject = isPlainObject$2;
718
+ function isntPlainObject$2(val) {
719
+ return !isPlainObject$2(val);
720
+ }
721
+ object$2.isntPlainObject = isntPlainObject$2;
722
+ function isEmptyObject$2(val) {
723
+ return Object.keys(val).length === 0;
724
+ }
725
+ object$2.isEmptyObject = isEmptyObject$2;
726
+ function isntEmptyObject$2(val) {
727
+ return Object.keys(val).length !== 0;
728
+ }
729
+ object$2.isntEmptyObject = isntEmptyObject$2;
730
+
731
+ var number$2 = {};
732
+
733
+ number$2.isntNumber = number$2.isNumber = void 0;
734
+ function isNumber$2(val) {
735
+ return typeof val === 'number';
736
+ }
737
+ number$2.isNumber = isNumber$2;
738
+ function isntNumber$2(val) {
739
+ return !isNumber$2(val);
740
+ }
741
+ number$2.isntNumber = isntNumber$2;
742
+
743
+ jsonRpc$1.isntJsonRpcError = jsonRpc$1.isJsonRpcError = jsonRpc$1.isntJsonRpcSuccess = jsonRpc$1.isJsonRpcSuccess = jsonRpc$1.isntJsonRpcRequest = jsonRpc$1.isJsonRpcRequest = jsonRpc$1.isntJsonRpcNotification = jsonRpc$1.isJsonRpcNotification = void 0;
744
+ const array_1$2 = array$2;
745
+ const object_1$3 = object$2;
746
+ const string_1$4 = string$2;
747
+ const number_1$2 = number$2;
748
+ const undefined_1$5 = _undefined$2;
749
+ function isJsonRpcId$1(val) {
750
+ return (0, string_1$4.isString)(val) || (0, number_1$2.isNumber)(val);
751
+ }
752
+ function isJsonRpcParams$1(val) {
753
+ return (0, array_1$2.isArray)(val) || (0, object_1$3.isObject)(val);
754
+ }
755
+ function isJsonRpcNotification$1(val) {
756
+ return (0, object_1$3.isPlainObject)(val)
757
+ && (0, string_1$4.isString)(val.jsonrpc)
758
+ && (0, string_1$4.isString)(val.method)
759
+ && (0, undefined_1$5.isUndefined)(val.id)
760
+ && isJsonRpcParams$1(val.params);
761
+ }
762
+ jsonRpc$1.isJsonRpcNotification = isJsonRpcNotification$1;
763
+ function isntJsonRpcNotification$1(val) {
764
+ return !isJsonRpcNotification$1(val);
765
+ }
766
+ jsonRpc$1.isntJsonRpcNotification = isntJsonRpcNotification$1;
767
+ function isJsonRpcRequest$1(val) {
768
+ return (0, object_1$3.isPlainObject)(val)
769
+ && (0, string_1$4.isString)(val.jsonrpc)
770
+ && (0, string_1$4.isString)(val.method)
771
+ && isJsonRpcId$1(val.id)
772
+ && isJsonRpcParams$1(val.params);
773
+ }
774
+ jsonRpc$1.isJsonRpcRequest = isJsonRpcRequest$1;
775
+ function isntJsonRpcRequest$1(val) {
776
+ return !isJsonRpcRequest$1(val);
777
+ }
778
+ jsonRpc$1.isntJsonRpcRequest = isntJsonRpcRequest$1;
779
+ function isJsonRpcSuccess$1(val) {
780
+ return (0, object_1$3.isPlainObject)(val)
781
+ && (0, string_1$4.isString)(val.jsonrpc)
782
+ && (0, string_1$4.isString)(val.id)
783
+ && 'result' in val;
784
+ }
785
+ jsonRpc$1.isJsonRpcSuccess = isJsonRpcSuccess$1;
786
+ function isntJsonRpcSuccess$1(val) {
787
+ return !isJsonRpcSuccess$1(val);
788
+ }
789
+ jsonRpc$1.isntJsonRpcSuccess = isntJsonRpcSuccess$1;
790
+ function isJsonRpcError$1(val) {
791
+ return (0, object_1$3.isPlainObject)(val)
792
+ && (0, string_1$4.isString)(val.jsonrpc)
793
+ && isJsonRpcId$1(val.id)
794
+ && isJsonRpcErrorObject$1(val.error);
795
+ }
796
+ jsonRpc$1.isJsonRpcError = isJsonRpcError$1;
797
+ function isntJsonRpcError$1(val) {
798
+ return !isJsonRpcError$1(val);
799
+ }
800
+ jsonRpc$1.isntJsonRpcError = isntJsonRpcError$1;
801
+ function isJsonRpcErrorObject$1(val) {
802
+ return (0, object_1$3.isPlainObject)(val)
803
+ && (0, number_1$2.isNumber)(val.code)
804
+ && (0, string_1$4.isString)(val.message)
805
+ && ((0, undefined_1$5.isUndefined)(val.data) || (0, object_1$3.isObject)(val.data));
806
+ }
807
+
808
+ var json$2 = {};
809
+
810
+ json$2.isntJson = json$2.isJson = void 0;
811
+ function isJson$2(val) {
812
+ try {
813
+ JSON.stringify(val);
814
+ return true;
815
+ }
816
+ catch (_a) {
817
+ return false;
818
+ }
819
+ }
820
+ json$2.isJson = isJson$2;
821
+ function isntJson$2(val) {
822
+ return !isntJson$2();
823
+ }
824
+ json$2.isntJson = isntJson$2;
825
+
826
+ var url$2 = {};
827
+
828
+ url$2.isAbsoluteURL = void 0;
829
+ function isAbsoluteURL$2(str) {
830
+ try {
831
+ new URL(str);
832
+ return true;
833
+ }
834
+ catch (_a) {
835
+ return false;
836
+ }
837
+ }
838
+ url$2.isAbsoluteURL = isAbsoluteURL$2;
839
+
840
+ (function (exports) {
841
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
842
+ if (k2 === undefined) k2 = k;
843
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
844
+ }) : (function(o, m, k, k2) {
845
+ if (k2 === undefined) k2 = k;
846
+ o[k2] = m[k];
847
+ }));
848
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
849
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
850
+ };__exportStar(array$2, exports);
851
+ __exportStar(asyncIterable$2, exports);
852
+ __exportStar(bigint$2, exports);
853
+ __exportStar(boolean$2, exports);
854
+ __exportStar(char$2, exports);
855
+ __exportStar(date$2, exports);
856
+ __exportStar(_enum$2, exports);
857
+ __exportStar(error$2, exports);
858
+ __exportStar(falsy$2, exports);
859
+ __exportStar(_function$2, exports);
860
+ __exportStar(iterable$2, exports);
861
+ __exportStar(jsonRpc$1, exports);
862
+ __exportStar(json$2, exports);
863
+ __exportStar(_null$2, exports);
864
+ __exportStar(number$2, exports);
865
+ __exportStar(object$2, exports);
866
+ __exportStar(string$2, exports);
867
+ __exportStar(_undefined$2, exports);
868
+ __exportStar(url$2, exports);
869
+
870
+ }(es2018$7));
871
+
872
+ chunkByAsync$3.chunkByAsync = void 0;
873
+ const types_1$C = es2018$7;
874
+ function chunkByAsync$2(iterable, predicate) {
875
+ if ((0, types_1$C.isAsyncIterable)(iterable)) {
876
+ return chunkByAsyncIterable(iterable);
877
+ }
878
+ else {
879
+ return chunkByIterable(iterable);
880
+ }
881
+ async function* chunkByAsyncIterable(iterable) {
882
+ let buffer = [];
883
+ let index = 0;
884
+ for await (const element of iterable) {
885
+ buffer.push(element);
886
+ if (await predicate(element, index)) {
887
+ yield buffer;
888
+ buffer = [];
889
+ }
890
+ index++;
891
+ }
892
+ if (buffer.length)
893
+ yield buffer;
894
+ }
895
+ async function* chunkByIterable(iterable) {
896
+ let buffer = [];
897
+ let index = 0;
898
+ for (const element of iterable) {
899
+ buffer.push(element);
900
+ if (await predicate(element, index)) {
901
+ yield buffer;
902
+ buffer = [];
903
+ }
904
+ index++;
905
+ }
906
+ if (buffer.length)
907
+ yield buffer;
908
+ }
909
+ }
910
+ chunkByAsync$3.chunkByAsync = chunkByAsync$2;
911
+
912
+ var chunkBy$3 = {};
913
+
914
+ chunkBy$3.chunkBy = void 0;
915
+ function* chunkBy$2(iterable, predicate) {
916
+ let buffer = [];
917
+ let index = 0;
918
+ for (const element of iterable) {
919
+ buffer.push(element);
920
+ if (predicate(element, index)) {
921
+ yield buffer;
922
+ buffer = [];
923
+ }
924
+ index++;
925
+ }
926
+ if (buffer.length)
927
+ yield buffer;
928
+ }
929
+ chunkBy$3.chunkBy = chunkBy$2;
930
+
931
+ var chunk$3 = {};
932
+
933
+ chunk$3.chunk = void 0;
934
+ const go_1$u = es2018$9;
935
+ const errors_1$u = es2018$8;
936
+ function chunk$2(iterable, size) {
937
+ (0, errors_1$u.assert)(Number.isInteger(size), 'The parameter size must be an integer');
938
+ (0, errors_1$u.assert)(size > 0, 'The parameter size must be greater than 0');
939
+ return (0, go_1$u.go)(function* () {
940
+ let buffer = [];
941
+ for (const element of iterable) {
942
+ buffer.push(element);
943
+ if (buffer.length >= size) {
944
+ yield buffer;
945
+ buffer = [];
946
+ }
947
+ }
948
+ if (buffer.length)
949
+ yield buffer;
950
+ });
951
+ }
952
+ chunk$3.chunk = chunk$2;
953
+
954
+ var concatAsync$3 = {};
955
+
956
+ concatAsync$3.concatAsync = void 0;
957
+ const types_1$B = es2018$7;
958
+ const go_1$t = es2018$9;
959
+ function concatAsync$2(iterable, ...otherIterables) {
960
+ return (0, go_1$t.go)(async function* () {
961
+ for (const iter of [iterable, ...otherIterables]) {
962
+ if ((0, types_1$B.isAsyncIterable)(iter)) {
963
+ for await (const element of iter) {
964
+ yield element;
965
+ }
966
+ }
967
+ else {
968
+ for (const element of iter) {
969
+ yield element;
970
+ }
971
+ }
972
+ }
973
+ });
974
+ }
975
+ concatAsync$3.concatAsync = concatAsync$2;
976
+
977
+ var concat$3 = {};
978
+
979
+ concat$3.concat = void 0;
980
+ const go_1$s = es2018$9;
981
+ function concat$2(iterable, ...otherIterables) {
982
+ return (0, go_1$s.go)(function* () {
983
+ for (const iter of [iterable, ...otherIterables]) {
984
+ yield* iter;
985
+ }
986
+ });
987
+ }
988
+ concat$3.concat = concat$2;
989
+
990
+ var dropAsync$3 = {};
991
+
992
+ var utils$1 = {};
993
+
994
+ utils$1.copyIterable = utils$1.copyAsyncIterable = void 0;
995
+ async function* copyAsyncIterable$1(iterable) {
996
+ for await (const element of iterable) {
997
+ yield element;
998
+ }
999
+ }
1000
+ utils$1.copyAsyncIterable = copyAsyncIterable$1;
1001
+ function* copyIterable$1(iterable) {
1002
+ for (const element of iterable) {
1003
+ yield element;
1004
+ }
1005
+ }
1006
+ utils$1.copyIterable = copyIterable$1;
1007
+
1008
+ dropAsync$3.dropAsync = void 0;
1009
+ const go_1$r = es2018$9;
1010
+ const utils_1$7 = utils$1;
1011
+ const errors_1$t = es2018$8;
1012
+ function dropAsync$2(iterable, count) {
1013
+ (0, errors_1$t.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1014
+ (0, errors_1$t.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1015
+ if (count === 0)
1016
+ return (0, utils_1$7.copyAsyncIterable)(iterable);
1017
+ return (0, go_1$r.go)(async function* () {
1018
+ var _a;
1019
+ const iterator = iterable[Symbol.asyncIterator]();
1020
+ let done;
1021
+ try {
1022
+ let value;
1023
+ while ({ value, done } = await iterator.next(), !done) {
1024
+ if (count <= 0)
1025
+ break;
1026
+ count--;
1027
+ }
1028
+ while (!done) {
1029
+ yield value;
1030
+ ({ value, done } = await iterator.next());
1031
+ }
1032
+ }
1033
+ finally {
1034
+ if (!done)
1035
+ await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
1036
+ }
1037
+ });
1038
+ }
1039
+ dropAsync$3.dropAsync = dropAsync$2;
1040
+
1041
+ var dropRightAsync$3 = {};
1042
+
1043
+ dropRightAsync$3.dropRightAsync = void 0;
1044
+ const go_1$q = es2018$9;
1045
+ const utils_1$6 = utils$1;
1046
+ const errors_1$s = es2018$8;
1047
+ function dropRightAsync$2(iterable, count) {
1048
+ (0, errors_1$s.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1049
+ (0, errors_1$s.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1050
+ if (count === 0)
1051
+ return (0, utils_1$6.copyAsyncIterable)(iterable);
1052
+ return (0, go_1$q.go)(async function* () {
1053
+ const arr = await toArrayAsync$5(iterable);
1054
+ const result = arr.slice(0, -count);
1055
+ for (const value of result) {
1056
+ yield value;
1057
+ }
1058
+ });
1059
+ }
1060
+ dropRightAsync$3.dropRightAsync = dropRightAsync$2;
1061
+ async function toArrayAsync$5(iterable) {
1062
+ const result = [];
1063
+ for await (const element of iterable) {
1064
+ result.push(element);
1065
+ }
1066
+ return result;
1067
+ }
1068
+
1069
+ var dropRight$3 = {};
1070
+
1071
+ dropRight$3.dropRight = void 0;
1072
+ const go_1$p = es2018$9;
1073
+ const utils_1$5 = utils$1;
1074
+ const errors_1$r = es2018$8;
1075
+ function dropRight$2(iterable, count) {
1076
+ (0, errors_1$r.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1077
+ (0, errors_1$r.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1078
+ if (count === 0)
1079
+ return (0, utils_1$5.copyIterable)(iterable);
1080
+ return (0, go_1$p.go)(function* () {
1081
+ const arr = Array.from(iterable);
1082
+ yield* arr.slice(0, -count);
1083
+ });
1084
+ }
1085
+ dropRight$3.dropRight = dropRight$2;
1086
+
1087
+ var dropUntilAsync$3 = {};
1088
+
1089
+ dropUntilAsync$3.dropUntilAsync = void 0;
1090
+ const types_1$A = es2018$7;
1091
+ function dropUntilAsync$2(iterable, predicate) {
1092
+ if ((0, types_1$A.isAsyncIterable)(iterable)) {
1093
+ return dropUntilAsyncIterable(iterable);
1094
+ }
1095
+ else {
1096
+ return dropUntilIterable(iterable);
1097
+ }
1098
+ async function* dropUntilAsyncIterable(iterable) {
1099
+ var _a;
1100
+ const iterator = iterable[Symbol.asyncIterator]();
1101
+ let done;
1102
+ try {
1103
+ let index = 0;
1104
+ let value;
1105
+ while ({ value, done } = await iterator.next(), !done) {
1106
+ if (await predicate(value, index++))
1107
+ break;
1108
+ }
1109
+ while (!done) {
1110
+ yield value;
1111
+ ({ value, done } = await iterator.next());
1112
+ }
1113
+ }
1114
+ finally {
1115
+ if (!done)
1116
+ await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
1117
+ }
1118
+ }
1119
+ async function* dropUntilIterable(iterable) {
1120
+ var _a;
1121
+ const iterator = iterable[Symbol.iterator]();
1122
+ let done;
1123
+ try {
1124
+ let index = 0;
1125
+ let value;
1126
+ while ({ value, done } = iterator.next(), !done) {
1127
+ if (await predicate(value, index++))
1128
+ break;
1129
+ }
1130
+ while (!done) {
1131
+ yield value;
1132
+ ({ value, done } = iterator.next());
1133
+ }
1134
+ }
1135
+ finally {
1136
+ if (!done)
1137
+ (_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
1138
+ }
1139
+ }
1140
+ }
1141
+ dropUntilAsync$3.dropUntilAsync = dropUntilAsync$2;
1142
+
1143
+ var dropUntil$3 = {};
1144
+
1145
+ dropUntil$3.dropUntil = void 0;
1146
+ function* dropUntil$2(iterable, predicate) {
1147
+ var _a;
1148
+ const iterator = iterable[Symbol.iterator]();
1149
+ let done;
1150
+ try {
1151
+ let index = 0;
1152
+ let value;
1153
+ while ({ value, done } = iterator.next(), !done) {
1154
+ if (predicate(value, index++))
1155
+ break;
1156
+ }
1157
+ while (!done) {
1158
+ yield value;
1159
+ ({ value, done } = iterator.next());
1160
+ }
1161
+ }
1162
+ finally {
1163
+ if (!done)
1164
+ (_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
1165
+ }
1166
+ }
1167
+ dropUntil$3.dropUntil = dropUntil$2;
1168
+
1169
+ var drop$3 = {};
1170
+
1171
+ drop$3.drop = void 0;
1172
+ const go_1$o = es2018$9;
1173
+ const utils_1$4 = utils$1;
1174
+ const errors_1$q = es2018$8;
1175
+ function drop$2(iterable, count) {
1176
+ (0, errors_1$q.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1177
+ (0, errors_1$q.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1178
+ if (count === 0)
1179
+ return (0, utils_1$4.copyIterable)(iterable);
1180
+ return (0, go_1$o.go)(function* () {
1181
+ var _a;
1182
+ const iterator = iterable[Symbol.iterator]();
1183
+ let done;
1184
+ try {
1185
+ let value;
1186
+ while ({ value, done } = iterator.next(), !done) {
1187
+ if (count <= 0)
1188
+ break;
1189
+ count--;
1190
+ }
1191
+ while (!done) {
1192
+ yield value;
1193
+ ({ value, done } = iterator.next());
1194
+ }
1195
+ }
1196
+ finally {
1197
+ if (!done)
1198
+ (_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
1199
+ }
1200
+ });
1201
+ }
1202
+ drop$3.drop = drop$2;
1203
+
1204
+ var filterAsync$3 = {};
1205
+
1206
+ filterAsync$3.filterAsync = void 0;
1207
+ const types_1$z = es2018$7;
1208
+ function filterAsync$2(iterable, predicate) {
1209
+ if ((0, types_1$z.isAsyncIterable)(iterable)) {
1210
+ return filterAsyncIterable(iterable);
1211
+ }
1212
+ else {
1213
+ return filterIterable(iterable);
1214
+ }
1215
+ async function* filterAsyncIterable(iterable) {
1216
+ let index = 0;
1217
+ for await (const element of iterable) {
1218
+ if (await predicate(element, index))
1219
+ yield element;
1220
+ index++;
1221
+ }
1222
+ }
1223
+ async function* filterIterable(iterable) {
1224
+ let index = 0;
1225
+ for (const element of iterable) {
1226
+ if (await predicate(element, index))
1227
+ yield element;
1228
+ index++;
1229
+ }
1230
+ }
1231
+ }
1232
+ filterAsync$3.filterAsync = filterAsync$2;
1233
+
1234
+ var filter$3 = {};
1235
+
1236
+ filter$3.filter = void 0;
1237
+ function* filter$2(iterable, predicate) {
1238
+ let index = 0;
1239
+ for (const element of iterable) {
1240
+ if (predicate(element, index))
1241
+ yield element;
1242
+ index++;
1243
+ }
1244
+ }
1245
+ filter$3.filter = filter$2;
1246
+
1247
+ var flattenAsync$3 = {};
1248
+
1249
+ var flattenDeepAsync$3 = {};
1250
+
1251
+ var flattenByAsync$3 = {};
1252
+
1253
+ flattenByAsync$3.flattenByAsync = void 0;
1254
+ const types_1$y = es2018$7;
1255
+ function flattenByAsync$2(iterable, predicate) {
1256
+ if ((0, types_1$y.isAsyncIterable)(iterable)) {
1257
+ return flattenByAsyncIterable(iterable);
1258
+ }
1259
+ else {
1260
+ return flattenByIterable(iterable);
1261
+ }
1262
+ async function* flattenByAsyncIterable(iterable) {
1263
+ const level = 1;
1264
+ for await (const element of iterable) {
1265
+ if (isFiniteIterable$3(element) && await predicate(element, level)) {
1266
+ yield* flatten(element, level + 1);
1267
+ }
1268
+ else {
1269
+ yield element;
1270
+ }
1271
+ }
1272
+ }
1273
+ function flattenByIterable(iterable) {
1274
+ return flatten(iterable, 1);
1275
+ }
1276
+ async function* flatten(iterable, level) {
1277
+ for (const element of iterable) {
1278
+ if (isFiniteIterable$3(element) && await predicate(element, level)) {
1279
+ yield* flatten(element, level + 1);
1280
+ }
1281
+ else {
1282
+ yield element;
1283
+ }
1284
+ }
1285
+ }
1286
+ }
1287
+ flattenByAsync$3.flattenByAsync = flattenByAsync$2;
1288
+ function isFiniteIterable$3(val) {
1289
+ return (0, types_1$y.isIterable)(val) && (0, types_1$y.isntChar)(val);
1290
+ }
1291
+
1292
+ flattenDeepAsync$3.flattenDeepAsync = void 0;
1293
+ const flatten_by_async_1$1 = flattenByAsync$3;
1294
+ const errors_1$p = es2018$8;
1295
+ function flattenDeepAsync$2(iterable, depth = Infinity) {
1296
+ (0, errors_1$p.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1297
+ (0, errors_1$p.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
1298
+ return (0, flatten_by_async_1$1.flattenByAsync)(iterable, (_, level) => level <= depth);
1299
+ }
1300
+ flattenDeepAsync$3.flattenDeepAsync = flattenDeepAsync$2;
1301
+
1302
+ flattenAsync$3.flattenAsync = void 0;
1303
+ const flatten_deep_async_1$1 = flattenDeepAsync$3;
1304
+ function flattenAsync$2(iterable) {
1305
+ return (0, flatten_deep_async_1$1.flattenDeepAsync)(iterable, 1);
1306
+ }
1307
+ flattenAsync$3.flattenAsync = flattenAsync$2;
1308
+
1309
+ var flattenBy$3 = {};
1310
+
1311
+ flattenBy$3.flattenBy = void 0;
1312
+ const types_1$x = es2018$7;
1313
+ function flattenBy$2(iterable, predicate) {
1314
+ return flatten(iterable, 1);
1315
+ function* flatten(iterable, level) {
1316
+ for (const element of iterable) {
1317
+ if (isFiniteIterable$2(element) && predicate(element, level)) {
1318
+ yield* flatten(element, level + 1);
1319
+ }
1320
+ else {
1321
+ yield element;
1322
+ }
1323
+ }
1324
+ }
1325
+ }
1326
+ flattenBy$3.flattenBy = flattenBy$2;
1327
+ function isFiniteIterable$2(val) {
1328
+ return (0, types_1$x.isIterable)(val) && (0, types_1$x.isntChar)(val);
1329
+ }
1330
+
1331
+ var flattenDeep$3 = {};
1332
+
1333
+ flattenDeep$3.flattenDeep = void 0;
1334
+ const flatten_by_1$1 = flattenBy$3;
1335
+ const errors_1$o = es2018$8;
1336
+ function flattenDeep$2(iterable, depth = Infinity) {
1337
+ (0, errors_1$o.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1338
+ (0, errors_1$o.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
1339
+ return (0, flatten_by_1$1.flattenBy)(iterable, (_, level) => level <= depth);
1340
+ }
1341
+ flattenDeep$3.flattenDeep = flattenDeep$2;
1342
+
1343
+ var flatten$3 = {};
1344
+
1345
+ flatten$3.flatten = void 0;
1346
+ const flatten_deep_1$1 = flattenDeep$3;
1347
+ function flatten$2(iterable) {
1348
+ return (0, flatten_deep_1$1.flattenDeep)(iterable, 1);
1349
+ }
1350
+ flatten$3.flatten = flatten$2;
1351
+
1352
+ var mapAsync$3 = {};
1353
+
1354
+ mapAsync$3.mapAsync = void 0;
1355
+ const types_1$w = es2018$7;
1356
+ function mapAsync$2(iterable, fn) {
1357
+ if ((0, types_1$w.isAsyncIterable)(iterable)) {
1358
+ return mapAsyncIterable(iterable);
1359
+ }
1360
+ else {
1361
+ return mapIterable(iterable);
1362
+ }
1363
+ async function* mapAsyncIterable(iterable) {
1364
+ let index = 0;
1365
+ for await (const element of iterable) {
1366
+ yield await fn(element, index);
1367
+ index++;
1368
+ }
1369
+ }
1370
+ async function* mapIterable(iterable) {
1371
+ let index = 0;
1372
+ for (const element of iterable) {
1373
+ yield await fn(element, index);
1374
+ index++;
1375
+ }
1376
+ }
1377
+ }
1378
+ mapAsync$3.mapAsync = mapAsync$2;
1379
+
1380
+ var map$3 = {};
1381
+
1382
+ map$3.map = void 0;
1383
+ function* map$2(iterable, fn) {
1384
+ let index = 0;
1385
+ for (const element of iterable) {
1386
+ yield fn(element, index);
1387
+ index++;
1388
+ }
1389
+ }
1390
+ map$3.map = map$2;
1391
+
1392
+ var repeatAsync$3 = {};
1393
+
1394
+ repeatAsync$3.repeatAsync = void 0;
1395
+ const go_1$n = es2018$9;
1396
+ const errors_1$n = es2018$8;
1397
+ function repeatAsync$2(iterable, times) {
1398
+ (0, errors_1$n.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1399
+ (0, errors_1$n.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
1400
+ if (times === Infinity)
1401
+ warnInfiniteLoop$3();
1402
+ return (0, go_1$n.go)(async function* () {
1403
+ const cache = [];
1404
+ if (times > 0) {
1405
+ for await (const element of iterable) {
1406
+ yield element;
1407
+ cache.push(element);
1408
+ }
1409
+ times--;
1410
+ }
1411
+ while (times > 0) {
1412
+ yield* cache;
1413
+ times--;
1414
+ }
1415
+ });
1416
+ }
1417
+ repeatAsync$3.repeatAsync = repeatAsync$2;
1418
+ function warnInfiniteLoop$3() {
1419
+ if (isProduction$3())
1420
+ return;
1421
+ console.warn('When iterable has no elements and times is Infinity, repeat() will be in dead loop');
1422
+ }
1423
+ function isProduction$3() {
1424
+ return process.env.NODE_ENV === 'production';
1425
+ }
1426
+
1427
+ var repeat$3 = {};
1428
+
1429
+ repeat$3.repeat = void 0;
1430
+ const go_1$m = es2018$9;
1431
+ const errors_1$m = es2018$8;
1432
+ function repeat$2(iterable, times) {
1433
+ (0, errors_1$m.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1434
+ (0, errors_1$m.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
1435
+ if (times === Infinity)
1436
+ warnInfiniteLoop$2();
1437
+ return (0, go_1$m.go)(function* () {
1438
+ const cache = [];
1439
+ if (times > 0) {
1440
+ for (const element of iterable) {
1441
+ yield element;
1442
+ cache.push(element);
1443
+ }
1444
+ times--;
1445
+ }
1446
+ while (times > 0) {
1447
+ yield* cache;
1448
+ times--;
1449
+ }
1450
+ });
1451
+ }
1452
+ repeat$3.repeat = repeat$2;
1453
+ function warnInfiniteLoop$2() {
1454
+ if (isProduction$2())
1455
+ return;
1456
+ console.warn('When iterable has no elements and times is Infinity, repeat() will be in dead loop');
1457
+ }
1458
+ function isProduction$2() {
1459
+ return process.env.NODE_ENV === 'production';
1460
+ }
1461
+
1462
+ var sliceAsync$3 = {};
1463
+
1464
+ sliceAsync$3.sliceAsync = void 0;
1465
+ const go_1$l = es2018$9;
1466
+ const errors_1$l = es2018$8;
1467
+ function sliceAsync$2(iterable, start, end = Infinity) {
1468
+ (0, errors_1$l.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1469
+ (0, errors_1$l.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
1470
+ (0, errors_1$l.assert)(Number.isInteger(end), 'The parameter end must be an integer');
1471
+ (0, errors_1$l.assert)(end >= start, 'The parameter end must be greater than or equal to start');
1472
+ return (0, go_1$l.go)(async function* () {
1473
+ let index = 0;
1474
+ for await (const element of iterable) {
1475
+ if (index >= end)
1476
+ break;
1477
+ if (index >= start)
1478
+ yield element;
1479
+ index++;
1480
+ }
1481
+ });
1482
+ }
1483
+ sliceAsync$3.sliceAsync = sliceAsync$2;
1484
+
1485
+ var slice$3 = {};
1486
+
1487
+ slice$3.slice = void 0;
1488
+ const go_1$k = es2018$9;
1489
+ const errors_1$k = es2018$8;
1490
+ function slice$2(iterable, start, end = Infinity) {
1491
+ (0, errors_1$k.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1492
+ (0, errors_1$k.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
1493
+ (0, errors_1$k.assert)(Number.isInteger(end), 'The parameter end must be an integer');
1494
+ (0, errors_1$k.assert)(end >= start, 'The parameter end must be greater than or equal to start');
1495
+ return (0, go_1$k.go)(function* () {
1496
+ let index = 0;
1497
+ for (const element of iterable) {
1498
+ if (index >= end)
1499
+ break;
1500
+ if (index >= start)
1501
+ yield element;
1502
+ index++;
1503
+ }
1504
+ });
1505
+ }
1506
+ slice$3.slice = slice$2;
1507
+
1508
+ var splitAsync$3 = {};
1509
+
1510
+ splitAsync$3.splitAsync = void 0;
1511
+ async function* splitAsync$2(iterable, separator) {
1512
+ let buffer = [];
1513
+ for await (const element of iterable) {
1514
+ if (element === separator) {
1515
+ yield buffer;
1516
+ buffer = [];
1517
+ }
1518
+ else {
1519
+ buffer.push(element);
1520
+ }
1521
+ }
1522
+ yield buffer;
1523
+ }
1524
+ splitAsync$3.splitAsync = splitAsync$2;
1525
+
1526
+ var splitByAsync$3 = {};
1527
+
1528
+ splitByAsync$3.splitByAsync = void 0;
1529
+ const types_1$v = es2018$7;
1530
+ function splitByAsync$2(iterable, predicate) {
1531
+ if ((0, types_1$v.isAsyncIterable)(iterable)) {
1532
+ return splitByAsyncIterable(iterable);
1533
+ }
1534
+ else {
1535
+ return splitByIterable(iterable);
1536
+ }
1537
+ async function* splitByIterable(iterable) {
1538
+ let buffer = [];
1539
+ let index = 0;
1540
+ for (const element of iterable) {
1541
+ if (await predicate(element, index)) {
1542
+ yield buffer;
1543
+ buffer = [];
1544
+ }
1545
+ else {
1546
+ buffer.push(element);
1547
+ }
1548
+ index++;
1549
+ }
1550
+ yield buffer;
1551
+ }
1552
+ async function* splitByAsyncIterable(iterable) {
1553
+ let buffer = [];
1554
+ let index = 0;
1555
+ for await (const element of iterable) {
1556
+ if (await predicate(element, index)) {
1557
+ yield buffer;
1558
+ buffer = [];
1559
+ }
1560
+ else {
1561
+ buffer.push(element);
1562
+ }
1563
+ index++;
1564
+ }
1565
+ yield buffer;
1566
+ }
1567
+ }
1568
+ splitByAsync$3.splitByAsync = splitByAsync$2;
1569
+
1570
+ var splitBy$3 = {};
1571
+
1572
+ splitBy$3.splitBy = void 0;
1573
+ function* splitBy$2(iterable, predicate) {
1574
+ let buffer = [];
1575
+ let index = 0;
1576
+ for (const element of iterable) {
1577
+ if (predicate(element, index)) {
1578
+ yield buffer;
1579
+ buffer = [];
1580
+ }
1581
+ else {
1582
+ buffer.push(element);
1583
+ }
1584
+ index++;
1585
+ }
1586
+ yield buffer;
1587
+ }
1588
+ splitBy$3.splitBy = splitBy$2;
1589
+
1590
+ var split$3 = {};
1591
+
1592
+ split$3.split = void 0;
1593
+ function* split$2(iterable, separator) {
1594
+ let buffer = [];
1595
+ for (const element of iterable) {
1596
+ if (element === separator) {
1597
+ yield buffer;
1598
+ buffer = [];
1599
+ }
1600
+ else {
1601
+ buffer.push(element);
1602
+ }
1603
+ }
1604
+ yield buffer;
1605
+ }
1606
+ split$3.split = split$2;
1607
+
1608
+ var takeAsync$3 = {};
1609
+
1610
+ takeAsync$3.takeAsync = void 0;
1611
+ const go_1$j = es2018$9;
1612
+ const errors_1$j = es2018$8;
1613
+ function takeAsync$2(iterable, count) {
1614
+ (0, errors_1$j.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1615
+ (0, errors_1$j.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1616
+ return (0, go_1$j.go)(async function* () {
1617
+ if (count === 0)
1618
+ return;
1619
+ for await (const element of iterable) {
1620
+ yield element;
1621
+ count--;
1622
+ if (count === 0)
1623
+ break;
1624
+ }
1625
+ });
1626
+ }
1627
+ takeAsync$3.takeAsync = takeAsync$2;
1628
+
1629
+ var takeRightAsync$3 = {};
1630
+
1631
+ takeRightAsync$3.takeRightAsync = void 0;
1632
+ const go_1$i = es2018$9;
1633
+ const errors_1$i = es2018$8;
1634
+ function takeRightAsync$2(iterable, count) {
1635
+ (0, errors_1$i.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1636
+ (0, errors_1$i.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1637
+ return (0, go_1$i.go)(async function* () {
1638
+ var _a;
1639
+ const iterator = iterable[Symbol.asyncIterator]();
1640
+ let done;
1641
+ try {
1642
+ const buffer = [];
1643
+ let value;
1644
+ while ({ value, done } = await iterator.next(), !done) {
1645
+ buffer.push(value);
1646
+ if (buffer.length > count)
1647
+ buffer.shift();
1648
+ }
1649
+ yield* buffer;
1650
+ }
1651
+ finally {
1652
+ if (!done)
1653
+ await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
1654
+ }
1655
+ });
1656
+ }
1657
+ takeRightAsync$3.takeRightAsync = takeRightAsync$2;
1658
+
1659
+ var takeRight$3 = {};
1660
+
1661
+ takeRight$3.takeRight = void 0;
1662
+ const go_1$h = es2018$9;
1663
+ const errors_1$h = es2018$8;
1664
+ function takeRight$2(iterable, count) {
1665
+ (0, errors_1$h.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1666
+ (0, errors_1$h.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1667
+ return (0, go_1$h.go)(function* () {
1668
+ var _a;
1669
+ const iterator = iterable[Symbol.iterator]();
1670
+ let done;
1671
+ try {
1672
+ const buffer = [];
1673
+ let value;
1674
+ while ({ value, done } = iterator.next(), !done) {
1675
+ buffer.push(value);
1676
+ if (buffer.length > count)
1677
+ buffer.shift();
1678
+ }
1679
+ yield* buffer;
1680
+ }
1681
+ finally {
1682
+ if (!done)
1683
+ (_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
1684
+ }
1685
+ });
1686
+ }
1687
+ takeRight$3.takeRight = takeRight$2;
1688
+
1689
+ var takeUntilAsync$3 = {};
1690
+
1691
+ takeUntilAsync$3.takeUntilAsync = void 0;
1692
+ const types_1$u = es2018$7;
1693
+ function takeUntilAsync$2(iterable, predicate) {
1694
+ if ((0, types_1$u.isAsyncIterable)(iterable)) {
1695
+ return takeUntilAsyncIterable(iterable);
1696
+ }
1697
+ else {
1698
+ return takeUntilIterable(iterable);
1699
+ }
1700
+ async function* takeUntilAsyncIterable(iterable) {
1701
+ let index = 0;
1702
+ for await (const element of iterable) {
1703
+ if (await predicate(element, index))
1704
+ break;
1705
+ yield element;
1706
+ index++;
1707
+ }
1708
+ }
1709
+ async function* takeUntilIterable(iterable) {
1710
+ let index = 0;
1711
+ for (const element of iterable) {
1712
+ if (await predicate(element, index))
1713
+ break;
1714
+ yield element;
1715
+ index++;
1716
+ }
1717
+ }
1718
+ }
1719
+ takeUntilAsync$3.takeUntilAsync = takeUntilAsync$2;
1720
+
1721
+ var takeUntil$3 = {};
1722
+
1723
+ takeUntil$3.takeUntil = void 0;
1724
+ function* takeUntil$2(iterable, predicate) {
1725
+ let index = 0;
1726
+ for (const element of iterable) {
1727
+ if (predicate(element, index))
1728
+ break;
1729
+ yield element;
1730
+ index++;
1731
+ }
1732
+ }
1733
+ takeUntil$3.takeUntil = takeUntil$2;
1734
+
1735
+ var take$3 = {};
1736
+
1737
+ take$3.take = void 0;
1738
+ const go_1$g = es2018$9;
1739
+ const errors_1$g = es2018$8;
1740
+ function take$2(iterable, count) {
1741
+ (0, errors_1$g.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1742
+ (0, errors_1$g.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
1743
+ return (0, go_1$g.go)(function* () {
1744
+ if (count === 0)
1745
+ return;
1746
+ for (const element of iterable) {
1747
+ yield element;
1748
+ count--;
1749
+ if (count === 0)
1750
+ break;
1751
+ }
1752
+ });
1753
+ }
1754
+ take$3.take = take$2;
1755
+
1756
+ var tapAsync$3 = {};
1757
+
1758
+ tapAsync$3.tapAsync = void 0;
1759
+ const types_1$t = es2018$7;
1760
+ function tapAsync$2(iterable, fn) {
1761
+ if ((0, types_1$t.isAsyncIterable)(iterable)) {
1762
+ return tapAsyncIterable(iterable);
1763
+ }
1764
+ else {
1765
+ return tapIterable(iterable);
1766
+ }
1767
+ async function* tapIterable(iterable) {
1768
+ let index = 0;
1769
+ for (const element of iterable) {
1770
+ await fn(element, index);
1771
+ yield element;
1772
+ index++;
1773
+ }
1774
+ }
1775
+ async function* tapAsyncIterable(iterable) {
1776
+ let index = 0;
1777
+ for await (const element of iterable) {
1778
+ await fn(element, index);
1779
+ yield element;
1780
+ index++;
1781
+ }
1782
+ }
1783
+ }
1784
+ tapAsync$3.tapAsync = tapAsync$2;
1785
+
1786
+ var tap$3 = {};
1787
+
1788
+ tap$3.tap = void 0;
1789
+ function* tap$2(iterable, fn) {
1790
+ let index = 0;
1791
+ for (const element of iterable) {
1792
+ fn(element, index);
1793
+ yield element;
1794
+ index++;
1795
+ }
1796
+ }
1797
+ tap$3.tap = tap$2;
1798
+
1799
+ var toAsyncIterable$3 = {};
1800
+
1801
+ toAsyncIterable$3.toAsyncIterable = void 0;
1802
+ async function* toAsyncIterable$2(iterable) {
1803
+ for (const value of iterable) {
1804
+ yield value;
1805
+ }
1806
+ }
1807
+ toAsyncIterable$3.toAsyncIterable = toAsyncIterable$2;
1808
+
1809
+ var transformAsync$3 = {};
1810
+
1811
+ transformAsync$3.transformAsync = void 0;
1812
+ async function* transformAsync$2(iterable, transformer) {
1813
+ yield* transformer(iterable);
1814
+ }
1815
+ transformAsync$3.transformAsync = transformAsync$2;
1816
+
1817
+ var transform$3 = {};
1818
+
1819
+ transform$3.transform = void 0;
1820
+ function* transform$2(iterable, transformer) {
1821
+ yield* transformer(iterable);
1822
+ }
1823
+ transform$3.transform = transform$2;
1824
+
1825
+ var uniqAsync$3 = {};
1826
+
1827
+ uniqAsync$3.uniqAsync = void 0;
1828
+ async function* uniqAsync$2(iterable) {
1829
+ const bucket = new Set();
1830
+ for await (const element of iterable) {
1831
+ if (!bucket.has(element)) {
1832
+ yield element;
1833
+ bucket.add(element);
1834
+ }
1835
+ }
1836
+ }
1837
+ uniqAsync$3.uniqAsync = uniqAsync$2;
1838
+
1839
+ var uniqByAsync$3 = {};
1840
+
1841
+ uniqByAsync$3.uniqByAsync = void 0;
1842
+ const types_1$s = es2018$7;
1843
+ function uniqByAsync$2(iterable, fn) {
1844
+ if ((0, types_1$s.isAsyncIterable)(iterable)) {
1845
+ return uniqByAsyncIterable(iterable);
1846
+ }
1847
+ else {
1848
+ return uniqByIterable(iterable);
1849
+ }
1850
+ async function* uniqByAsyncIterable(iterable) {
1851
+ const bucket = new Set();
1852
+ let index = 0;
1853
+ for await (const element of iterable) {
1854
+ const result = await fn(element, index);
1855
+ if (!bucket.has(result)) {
1856
+ yield element;
1857
+ bucket.add(result);
1858
+ }
1859
+ index++;
1860
+ }
1861
+ }
1862
+ async function* uniqByIterable(iterable) {
1863
+ const bucket = new Set();
1864
+ let index = 0;
1865
+ for (const element of iterable) {
1866
+ const result = await fn(element, index);
1867
+ if (!bucket.has(result)) {
1868
+ yield element;
1869
+ bucket.add(result);
1870
+ }
1871
+ index++;
1872
+ }
1873
+ }
1874
+ }
1875
+ uniqByAsync$3.uniqByAsync = uniqByAsync$2;
1876
+
1877
+ var uniqBy$3 = {};
1878
+
1879
+ uniqBy$3.uniqBy = void 0;
1880
+ function* uniqBy$2(iterable, fn) {
1881
+ const bucket = new Set();
1882
+ let index = 0;
1883
+ for (const element of iterable) {
1884
+ const result = fn(element, index);
1885
+ if (!bucket.has(result)) {
1886
+ yield element;
1887
+ bucket.add(result);
1888
+ }
1889
+ index++;
1890
+ }
1891
+ }
1892
+ uniqBy$3.uniqBy = uniqBy$2;
1893
+
1894
+ var uniq$3 = {};
1895
+
1896
+ uniq$3.uniq = void 0;
1897
+ function* uniq$2(iterable) {
1898
+ const bucket = new Set();
1899
+ for (const element of iterable) {
1900
+ if (!bucket.has(element)) {
1901
+ yield element;
1902
+ bucket.add(element);
1903
+ }
1904
+ }
1905
+ }
1906
+ uniq$3.uniq = uniq$2;
1907
+
1908
+ var zipAsync$3 = {};
1909
+
1910
+ zipAsync$3.zipAsync = void 0;
1911
+ const types_1$r = es2018$7;
1912
+ var Kind$1;
1913
+ (function (Kind) {
1914
+ Kind[Kind["Sync"] = 0] = "Sync";
1915
+ Kind[Kind["Async"] = 1] = "Async";
1916
+ })(Kind$1 || (Kind$1 = {}));
1917
+ function zipAsync$2(iterable, ...otherIterables) {
1918
+ return zipWithSize$3(iterable, ...otherIterables);
1919
+ }
1920
+ zipAsync$3.zipAsync = zipAsync$2;
1921
+ async function* zipWithSize$3(...iterables) {
1922
+ var _a, _b, _c, _d;
1923
+ const length = iterables.length;
1924
+ const iterators = iterables.map(iterable => {
1925
+ if ((0, types_1$r.isAsyncIterable)(iterable)) {
1926
+ return [Kind$1.Async, iterable[Symbol.asyncIterator]()];
1927
+ }
1928
+ else {
1929
+ return [Kind$1.Sync, iterable[Symbol.iterator]()];
1930
+ }
1931
+ });
1932
+ const dones = iterators.map(() => false);
1933
+ try {
1934
+ while (true) {
1935
+ const result = new Array(length);
1936
+ for (let i = 0; i < length; i++) {
1937
+ const [kind, iterator] = iterators[i];
1938
+ let temp;
1939
+ if (kind === Kind$1.Async) {
1940
+ temp = await iterator.next();
1941
+ }
1942
+ else {
1943
+ temp = iterator.next();
1944
+ }
1945
+ if (temp.done) {
1946
+ dones[i] = true;
1947
+ return;
1948
+ }
1949
+ result[i] = temp.value;
1950
+ }
1951
+ yield result;
1952
+ }
1953
+ }
1954
+ finally {
1955
+ const undoneIterators = iterators.filter((_, i) => !dones[i]);
1956
+ for (const [kind, iterator] of undoneIterators) {
1957
+ if (kind === Kind$1.Async) {
1958
+ await ((_b = (_a = iterator).return) === null || _b === void 0 ? void 0 : _b.call(_a));
1959
+ }
1960
+ else {
1961
+ (_d = (_c = iterator).return) === null || _d === void 0 ? void 0 : _d.call(_c);
1962
+ }
1963
+ }
1964
+ }
1965
+ }
1966
+
1967
+ var zip$3 = {};
1968
+
1969
+ zip$3.zip = void 0;
1970
+ function zip$2(iterable, ...otherIterables) {
1971
+ return zipWithSize$2(iterable, ...otherIterables);
1972
+ }
1973
+ zip$3.zip = zip$2;
1974
+ function* zipWithSize$2(...iterables) {
1975
+ const length = iterables.length;
1976
+ const iterators = iterables.map(iterable => iterable[Symbol.iterator]());
1977
+ const dones = iterators.map(() => false);
1978
+ try {
1979
+ while (true) {
1980
+ const result = new Array(length);
1981
+ for (let i = 0; i < length; i++) {
1982
+ const { value, done } = iterators[i].next();
1983
+ if (done) {
1984
+ dones[i] = true;
1985
+ return;
1986
+ }
1987
+ result[i] = value;
1988
+ }
1989
+ yield result;
1990
+ }
1991
+ }
1992
+ finally {
1993
+ const undoneIterators = iterators.filter((_, i) => !dones[i]);
1994
+ undoneIterators.forEach(x => { var _a; return (_a = x.return) === null || _a === void 0 ? void 0 : _a.call(x); });
1995
+ }
1996
+ }
1997
+
1998
+ (function (exports) {
1999
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2000
+ if (k2 === undefined) k2 = k;
2001
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2002
+ }) : (function(o, m, k, k2) {
2003
+ if (k2 === undefined) k2 = k;
2004
+ o[k2] = m[k];
2005
+ }));
2006
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2007
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2008
+ };__exportStar(chunkAsync$3, exports);
2009
+ __exportStar(chunkByAsync$3, exports);
2010
+ __exportStar(chunkBy$3, exports);
2011
+ __exportStar(chunk$3, exports);
2012
+ __exportStar(concatAsync$3, exports);
2013
+ __exportStar(concat$3, exports);
2014
+ __exportStar(dropAsync$3, exports);
2015
+ __exportStar(dropRightAsync$3, exports);
2016
+ __exportStar(dropRight$3, exports);
2017
+ __exportStar(dropUntilAsync$3, exports);
2018
+ __exportStar(dropUntil$3, exports);
2019
+ __exportStar(drop$3, exports);
2020
+ __exportStar(filterAsync$3, exports);
2021
+ __exportStar(filter$3, exports);
2022
+ __exportStar(flattenAsync$3, exports);
2023
+ __exportStar(flattenByAsync$3, exports);
2024
+ __exportStar(flattenBy$3, exports);
2025
+ __exportStar(flattenDeepAsync$3, exports);
2026
+ __exportStar(flattenDeep$3, exports);
2027
+ __exportStar(flatten$3, exports);
2028
+ __exportStar(mapAsync$3, exports);
2029
+ __exportStar(map$3, exports);
2030
+ __exportStar(repeatAsync$3, exports);
2031
+ __exportStar(repeat$3, exports);
2032
+ __exportStar(sliceAsync$3, exports);
2033
+ __exportStar(slice$3, exports);
2034
+ __exportStar(splitAsync$3, exports);
2035
+ __exportStar(splitByAsync$3, exports);
2036
+ __exportStar(splitBy$3, exports);
2037
+ __exportStar(split$3, exports);
2038
+ __exportStar(takeAsync$3, exports);
2039
+ __exportStar(takeRightAsync$3, exports);
2040
+ __exportStar(takeRight$3, exports);
2041
+ __exportStar(takeUntilAsync$3, exports);
2042
+ __exportStar(takeUntil$3, exports);
2043
+ __exportStar(take$3, exports);
2044
+ __exportStar(tapAsync$3, exports);
2045
+ __exportStar(tap$3, exports);
2046
+ __exportStar(toAsyncIterable$3, exports);
2047
+ __exportStar(transformAsync$3, exports);
2048
+ __exportStar(transform$3, exports);
2049
+ __exportStar(uniqAsync$3, exports);
2050
+ __exportStar(uniqByAsync$3, exports);
2051
+ __exportStar(uniqBy$3, exports);
2052
+ __exportStar(uniq$3, exports);
2053
+ __exportStar(zipAsync$3, exports);
2054
+ __exportStar(zip$3, exports);
2055
+
2056
+ }(middleware$1));
2057
+
2058
+ var output$1 = {};
2059
+
2060
+ var consume$3 = {};
2061
+
2062
+ consume$3.consume = void 0;
2063
+ function consume$2(iterable, consumer) {
2064
+ return consumer(iterable);
2065
+ }
2066
+ consume$3.consume = consume$2;
2067
+
2068
+ var eachAsync$3 = {};
2069
+
2070
+ eachAsync$3.eachAsync = void 0;
2071
+ const types_1$q = es2018$7;
2072
+ function eachAsync$2(iterable, fn) {
2073
+ if ((0, types_1$q.isAsyncIterable)(iterable)) {
2074
+ return eachAsyncIterable(iterable);
2075
+ }
2076
+ else {
2077
+ return eachIterable(iterable);
2078
+ }
2079
+ async function eachAsyncIterable(iterable) {
2080
+ let index = 0;
2081
+ for await (const element of iterable) {
2082
+ await fn(element, index);
2083
+ index++;
2084
+ }
2085
+ }
2086
+ async function eachIterable(iterable) {
2087
+ let index = 0;
2088
+ for (const element of iterable) {
2089
+ await fn(element, index);
2090
+ index++;
2091
+ }
2092
+ }
2093
+ }
2094
+ eachAsync$3.eachAsync = eachAsync$2;
2095
+
2096
+ var each$3 = {};
2097
+
2098
+ each$3.each = void 0;
2099
+ function each$2(iterable, fn) {
2100
+ let index = 0;
2101
+ for (const element of iterable) {
2102
+ fn(element, index);
2103
+ index++;
2104
+ }
2105
+ }
2106
+ each$3.each = each$2;
2107
+
2108
+ var everyAsync$3 = {};
2109
+
2110
+ everyAsync$3.everyAsync = void 0;
2111
+ const types_1$p = es2018$7;
2112
+ function everyAsync$2(iterable, predicate) {
2113
+ if ((0, types_1$p.isAsyncIterable)(iterable)) {
2114
+ return everyAsyncIterable(iterable);
2115
+ }
2116
+ else {
2117
+ return everyIterable(iterable);
2118
+ }
2119
+ async function everyIterable(iterable) {
2120
+ let index = 0;
2121
+ for (const element of iterable) {
2122
+ if (!await predicate(element, index))
2123
+ return false;
2124
+ index++;
2125
+ }
2126
+ return true;
2127
+ }
2128
+ async function everyAsyncIterable(iterable) {
2129
+ let index = 0;
2130
+ for await (const element of iterable) {
2131
+ if (!await predicate(element, index))
2132
+ return false;
2133
+ index++;
2134
+ }
2135
+ return true;
2136
+ }
2137
+ }
2138
+ everyAsync$3.everyAsync = everyAsync$2;
2139
+
2140
+ var every$3 = {};
2141
+
2142
+ every$3.every = void 0;
2143
+ function every$2(iterable, predicate) {
2144
+ let index = 0;
2145
+ for (const element of iterable) {
2146
+ if (!predicate(element, index))
2147
+ return false;
2148
+ index++;
2149
+ }
2150
+ return true;
2151
+ }
2152
+ every$3.every = every$2;
2153
+
2154
+ var findAsync$3 = {};
2155
+
2156
+ findAsync$3.findAsync = void 0;
2157
+ const types_1$o = es2018$7;
2158
+ function findAsync$2(iterable, predicate) {
2159
+ if ((0, types_1$o.isAsyncIterable)(iterable)) {
2160
+ return findAsyncIterable(iterable);
2161
+ }
2162
+ else {
2163
+ return findIterable(iterable);
2164
+ }
2165
+ async function findIterable(iterable) {
2166
+ let index = 0;
2167
+ for (const element of iterable) {
2168
+ if (await predicate(element, index))
2169
+ return element;
2170
+ index++;
2171
+ }
2172
+ return undefined;
2173
+ }
2174
+ async function findAsyncIterable(iterable) {
2175
+ let index = 0;
2176
+ for await (const element of iterable) {
2177
+ if (await predicate(element, index))
2178
+ return element;
2179
+ index++;
2180
+ }
2181
+ return undefined;
2182
+ }
2183
+ }
2184
+ findAsync$3.findAsync = findAsync$2;
2185
+
2186
+ var find$3 = {};
2187
+
2188
+ find$3.find = void 0;
2189
+ function find$2(iterable, predicate) {
2190
+ let index = 0;
2191
+ for (const element of iterable) {
2192
+ if (predicate(element, index))
2193
+ return element;
2194
+ index++;
2195
+ }
2196
+ return undefined;
2197
+ }
2198
+ find$3.find = find$2;
2199
+
2200
+ var firstAsync$3 = {};
2201
+
2202
+ firstAsync$3.firstAsync = void 0;
2203
+ async function firstAsync$2(iterable) {
2204
+ for await (const element of iterable) {
2205
+ return element;
2206
+ }
2207
+ return undefined;
2208
+ }
2209
+ firstAsync$3.firstAsync = firstAsync$2;
2210
+
2211
+ var first$3 = {};
2212
+
2213
+ first$3.first = void 0;
2214
+ function first$2(iterable) {
2215
+ for (const element of iterable) {
2216
+ return element;
2217
+ }
2218
+ return undefined;
2219
+ }
2220
+ first$3.first = first$2;
2221
+
2222
+ var includesAsync$3 = {};
2223
+
2224
+ includesAsync$3.includesAsync = void 0;
2225
+ async function includesAsync$2(iterable, value) {
2226
+ for await (const element of iterable) {
2227
+ if (element === value)
2228
+ return true;
2229
+ }
2230
+ return false;
2231
+ }
2232
+ includesAsync$3.includesAsync = includesAsync$2;
2233
+
2234
+ var includes$3 = {};
2235
+
2236
+ includes$3.includes = void 0;
2237
+ function includes$2(iterable, value) {
2238
+ for (const element of iterable) {
2239
+ if (element === value)
2240
+ return true;
2241
+ }
2242
+ return false;
2243
+ }
2244
+ includes$3.includes = includes$2;
2245
+
2246
+ var matchAsync$3 = {};
2247
+
2248
+ matchAsync$3.matchAsync = void 0;
2249
+ async function matchAsync$2(iterable, sequence) {
2250
+ const sequenceLength = sequence.length;
2251
+ let matchCount = 0;
2252
+ for await (const element of iterable) {
2253
+ if (element === sequence[matchCount])
2254
+ matchCount++;
2255
+ if (matchCount === sequenceLength)
2256
+ return true;
2257
+ }
2258
+ return false;
2259
+ }
2260
+ matchAsync$3.matchAsync = matchAsync$2;
2261
+
2262
+ var match$3 = {};
2263
+
2264
+ match$3.match = void 0;
2265
+ function match$2(iterable, sequence) {
2266
+ const sequenceLength = sequence.length;
2267
+ let matchCount = 0;
2268
+ for (const element of iterable) {
2269
+ if (element === sequence[matchCount])
2270
+ matchCount++;
2271
+ if (matchCount === sequenceLength)
2272
+ return true;
2273
+ }
2274
+ return false;
2275
+ }
2276
+ match$3.match = match$2;
2277
+
2278
+ var reduceAsync$3 = {};
2279
+
2280
+ reduceAsync$3.reduceAsync = void 0;
2281
+ const types_1$n = es2018$7;
2282
+ function reduceAsync$2(iterable, fn, initialValue) {
2283
+ if ((0, types_1$n.isUndefined)(initialValue)) {
2284
+ return reduceAsyncWithoutInitialValue$1(iterable, fn);
2285
+ }
2286
+ else {
2287
+ return reduceAsyncWithInitialValue$1(iterable, fn, initialValue);
2288
+ }
2289
+ }
2290
+ reduceAsync$3.reduceAsync = reduceAsync$2;
2291
+ function reduceAsyncWithInitialValue$1(iterable, fn, initialValue) {
2292
+ if ((0, types_1$n.isAsyncIterable)(iterable)) {
2293
+ return reduceAsyncIterable(iterable);
2294
+ }
2295
+ else {
2296
+ return reduceIterable(iterable);
2297
+ }
2298
+ async function reduceIterable(iterable) {
2299
+ let result = initialValue, index = 0;
2300
+ for (const currentValue of iterable) {
2301
+ result = await fn(result, currentValue, index++);
2302
+ }
2303
+ return result;
2304
+ }
2305
+ async function reduceAsyncIterable(iterable) {
2306
+ let result = initialValue, index = 0;
2307
+ for await (const currentValue of iterable) {
2308
+ result = await fn(result, currentValue, index++);
2309
+ }
2310
+ return result;
2311
+ }
2312
+ }
2313
+ function reduceAsyncWithoutInitialValue$1(iterable, fn) {
2314
+ if ((0, types_1$n.isAsyncIterable)(iterable)) {
2315
+ return reduceAsyncIterable(iterable);
2316
+ }
2317
+ else {
2318
+ return reduceIterable(iterable);
2319
+ }
2320
+ async function reduceAsyncIterable(iterable) {
2321
+ var _a;
2322
+ const iterator = iterable[Symbol.asyncIterator]();
2323
+ let done;
2324
+ try {
2325
+ let result = await readInitialValue(iterator);
2326
+ let index = 1;
2327
+ let value;
2328
+ while ({ value, done } = await iterator.next(), !done) {
2329
+ result = await fn(result, value, index++);
2330
+ }
2331
+ return result;
2332
+ }
2333
+ finally {
2334
+ if (!done)
2335
+ await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
2336
+ }
2337
+ async function readInitialValue(iterator) {
2338
+ const result = await iterator.next();
2339
+ if (result.done) {
2340
+ done = true;
2341
+ throw new Error('Reduce of empty iterable with no initial value');
2342
+ }
2343
+ return result.value;
2344
+ }
2345
+ }
2346
+ async function reduceIterable(iterable) {
2347
+ var _a;
2348
+ const iterator = iterable[Symbol.iterator]();
2349
+ let done;
2350
+ try {
2351
+ let result = readInitialValue(iterator);
2352
+ let index = 1;
2353
+ let value;
2354
+ while ({ value, done } = iterator.next(), !done) {
2355
+ result = await fn(result, value, index++);
2356
+ }
2357
+ return result;
2358
+ }
2359
+ finally {
2360
+ if (!done)
2361
+ (_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
2362
+ }
2363
+ function readInitialValue(iterator) {
2364
+ const result = iterator.next();
2365
+ if (result.done) {
2366
+ done = true;
2367
+ throw new Error('Reduce of empty iterable with no initial value');
2368
+ }
2369
+ return result.value;
2370
+ }
2371
+ }
2372
+ }
2373
+
2374
+ var reduce$3 = {};
2375
+
2376
+ reduce$3.reduce = void 0;
2377
+ const types_1$m = es2018$7;
2378
+ function reduce$2(iterable, fn, initialValue) {
2379
+ if ((0, types_1$m.isUndefined)(initialValue)) {
2380
+ return reduceWithoutInitialValue$1(iterable, fn);
2381
+ }
2382
+ else {
2383
+ return reduceWithInitialValue$1(iterable, fn, initialValue);
2384
+ }
2385
+ }
2386
+ reduce$3.reduce = reduce$2;
2387
+ function reduceWithInitialValue$1(iterable, fn, initialValue) {
2388
+ let result = initialValue, index = 0;
2389
+ for (const currentValue of iterable) {
2390
+ result = fn(result, currentValue, index++);
2391
+ }
2392
+ return result;
2393
+ }
2394
+ function reduceWithoutInitialValue$1(iterable, fn) {
2395
+ var _a;
2396
+ const iterator = iterable[Symbol.iterator]();
2397
+ let done;
2398
+ try {
2399
+ let result = readInitialValue(iterator);
2400
+ let index = 1;
2401
+ let value;
2402
+ while ({ value, done } = iterator.next(), !done) {
2403
+ result = fn(result, value, index++);
2404
+ }
2405
+ return result;
2406
+ }
2407
+ finally {
2408
+ if (!done)
2409
+ (_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
2410
+ }
2411
+ function readInitialValue(iterator) {
2412
+ const result = iterator.next();
2413
+ if (result.done) {
2414
+ done = true;
2415
+ throw new Error('Reduce of empty iterable with no initial value');
2416
+ }
2417
+ return result.value;
2418
+ }
2419
+ }
2420
+
2421
+ var someAsync$3 = {};
2422
+
2423
+ someAsync$3.someAsync = void 0;
2424
+ const types_1$l = es2018$7;
2425
+ function someAsync$2(iterable, predicate) {
2426
+ if ((0, types_1$l.isAsyncIterable)(iterable)) {
2427
+ return someAsyncIterable(iterable);
2428
+ }
2429
+ else {
2430
+ return someIterable(iterable);
2431
+ }
2432
+ async function someIterable(iterable) {
2433
+ let index = 0;
2434
+ for (const element of iterable) {
2435
+ if (await predicate(element, index))
2436
+ return true;
2437
+ index++;
2438
+ }
2439
+ return false;
2440
+ }
2441
+ async function someAsyncIterable(iterable) {
2442
+ let index = 0;
2443
+ for await (const element of iterable) {
2444
+ if (await predicate(element, index))
2445
+ return true;
2446
+ index++;
2447
+ }
2448
+ return false;
2449
+ }
2450
+ }
2451
+ someAsync$3.someAsync = someAsync$2;
2452
+
2453
+ var some$3 = {};
2454
+
2455
+ some$3.some = void 0;
2456
+ function some$2(iterable, predicate) {
2457
+ let index = 0;
2458
+ for (const element of iterable) {
2459
+ if (predicate(element, index))
2460
+ return true;
2461
+ index++;
2462
+ }
2463
+ return false;
2464
+ }
2465
+ some$3.some = some$2;
2466
+
2467
+ var lastAsync$3 = {};
2468
+
2469
+ lastAsync$3.lastAsync = void 0;
2470
+ async function lastAsync$2(iterable) {
2471
+ var _a;
2472
+ const iterator = iterable[Symbol.asyncIterator]();
2473
+ let done;
2474
+ try {
2475
+ let value;
2476
+ let result;
2477
+ while ({ value, done } = await iterator.next(), !done) {
2478
+ result = value;
2479
+ }
2480
+ return result;
2481
+ }
2482
+ finally {
2483
+ if (!done)
2484
+ await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
2485
+ }
2486
+ }
2487
+ lastAsync$3.lastAsync = lastAsync$2;
237
2488
 
238
- var customError = {};
2489
+ var last$3 = {};
239
2490
 
240
- customError.CustomError = void 0;
241
- class CustomError extends Error {
242
- get name() {
243
- return this.constructor.name;
2491
+ last$3.last = void 0;
2492
+ function last$2(iterable) {
2493
+ var _a;
2494
+ const iterator = iterable[Symbol.iterator]();
2495
+ let done;
2496
+ try {
2497
+ let value;
2498
+ let result;
2499
+ while ({ value, done } = iterator.next(), !done) {
2500
+ result = value;
2501
+ }
2502
+ return result;
2503
+ }
2504
+ finally {
2505
+ if (!done)
2506
+ (_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
244
2507
  }
245
2508
  }
246
- customError.CustomError = CustomError;
2509
+ last$3.last = last$2;
247
2510
 
248
- var expectedError = {};
2511
+ var toArrayAsync$4 = {};
249
2512
 
250
- expectedError.ExpectedError = void 0;
251
- const custom_error_1$1 = customError;
252
- class ExpectedError extends custom_error_1$1.CustomError {
2513
+ toArrayAsync$4.toArrayAsync = void 0;
2514
+ const consume_1$7 = consume$3;
2515
+ function toArrayAsync$3(iterable) {
2516
+ return (0, consume_1$7.consume)(iterable, async (iterable) => {
2517
+ const result = [];
2518
+ for await (const element of iterable) {
2519
+ result.push(element);
2520
+ }
2521
+ return result;
2522
+ });
253
2523
  }
254
- expectedError.ExpectedError = ExpectedError;
2524
+ toArrayAsync$4.toArrayAsync = toArrayAsync$3;
2525
+
2526
+ var toArray$3 = {};
2527
+
2528
+ toArray$3.toArray = void 0;
2529
+ const consume_1$6 = consume$3;
2530
+ function toArray$2(iterable) {
2531
+ return (0, consume_1$6.consume)(iterable, iterable => Array.from(iterable));
2532
+ }
2533
+ toArray$3.toArray = toArray$2;
2534
+
2535
+ var toSetAsync$3 = {};
2536
+
2537
+ toSetAsync$3.toSetAsync = void 0;
2538
+ const consume_1$5 = consume$3;
2539
+ function toSetAsync$2(iterable) {
2540
+ return (0, consume_1$5.consume)(iterable, async (iterable) => {
2541
+ const result = new Set();
2542
+ for await (const element of iterable) {
2543
+ result.add(element);
2544
+ }
2545
+ return result;
2546
+ });
2547
+ }
2548
+ toSetAsync$3.toSetAsync = toSetAsync$2;
2549
+
2550
+ var toSet$3 = {};
2551
+
2552
+ toSet$3.toSet = void 0;
2553
+ const consume_1$4 = consume$3;
2554
+ function toSet$2(iterable) {
2555
+ return (0, consume_1$4.consume)(iterable, iterable => new Set(iterable));
2556
+ }
2557
+ toSet$3.toSet = toSet$2;
2558
+
2559
+ (function (exports) {
2560
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2561
+ if (k2 === undefined) k2 = k;
2562
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2563
+ }) : (function(o, m, k, k2) {
2564
+ if (k2 === undefined) k2 = k;
2565
+ o[k2] = m[k];
2566
+ }));
2567
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2568
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2569
+ };__exportStar(consume$3, exports);
2570
+ __exportStar(eachAsync$3, exports);
2571
+ __exportStar(each$3, exports);
2572
+ __exportStar(everyAsync$3, exports);
2573
+ __exportStar(every$3, exports);
2574
+ __exportStar(findAsync$3, exports);
2575
+ __exportStar(find$3, exports);
2576
+ __exportStar(firstAsync$3, exports);
2577
+ __exportStar(first$3, exports);
2578
+ __exportStar(includesAsync$3, exports);
2579
+ __exportStar(includes$3, exports);
2580
+ __exportStar(matchAsync$3, exports);
2581
+ __exportStar(match$3, exports);
2582
+ __exportStar(reduceAsync$3, exports);
2583
+ __exportStar(reduce$3, exports);
2584
+ __exportStar(someAsync$3, exports);
2585
+ __exportStar(some$3, exports);
2586
+ __exportStar(lastAsync$3, exports);
2587
+ __exportStar(last$3, exports);
2588
+ __exportStar(toArrayAsync$4, exports);
2589
+ __exportStar(toArray$3, exports);
2590
+ __exportStar(toSetAsync$3, exports);
2591
+ __exportStar(toSet$3, exports);
2592
+
2593
+ }(output$1));
2594
+
2595
+ (function (exports) {
2596
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2597
+ if (k2 === undefined) k2 = k;
2598
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2599
+ }) : (function(o, m, k, k2) {
2600
+ if (k2 === undefined) k2 = k;
2601
+ o[k2] = m[k];
2602
+ }));
2603
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2604
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2605
+ };__exportStar(middleware$1, exports);
2606
+ __exportStar(output$1, exports);
2607
+
2608
+ }(es2018$a));
2609
+
2610
+ var getErrorNames$1 = {};
2611
+
2612
+ var traverseErrorPrototypeChain$1 = {};
2613
+
2614
+ traverseErrorPrototypeChain$1.traverseErrorPrototypeChain = void 0;
2615
+ function* traverseErrorPrototypeChain(err) {
2616
+ let current = err;
2617
+ while ((current = Object.getPrototypeOf(current))) {
2618
+ yield current;
2619
+ if (current === Error.prototype)
2620
+ break;
2621
+ }
2622
+ }
2623
+ traverseErrorPrototypeChain$1.traverseErrorPrototypeChain = traverseErrorPrototypeChain;
2624
+
2625
+ getErrorNames$1.getErrorNames = void 0;
2626
+ const types_1$k = es2018$7;
2627
+ const traverse_error_prototype_chain_1 = traverseErrorPrototypeChain$1;
2628
+ function* getErrorNames(err) {
2629
+ var _a;
2630
+ if ((0, types_1$k.isError)(err)) {
2631
+ for (const prototype of (0, traverse_error_prototype_chain_1.traverseErrorPrototypeChain)(err)) {
2632
+ if ((_a = prototype.constructor) === null || _a === void 0 ? void 0 : _a.name) {
2633
+ yield prototype.constructor.name;
2634
+ }
2635
+ }
2636
+ }
2637
+ else {
2638
+ yield err.name;
2639
+ yield* err.ancestors;
2640
+ }
2641
+ }
2642
+ getErrorNames$1.getErrorNames = getErrorNames;
2643
+
2644
+ var serializableError = {};
2645
+
2646
+ serializableError.isSerializableError = void 0;
2647
+ const types_1$j = es2018$7;
2648
+ function isSerializableError(val) {
2649
+ return (0, types_1$j.isObject)(val)
2650
+ && (0, types_1$j.isString)(val.name)
2651
+ && (0, types_1$j.isString)(val.message)
2652
+ && ((0, types_1$j.isString)(val.stack) || (0, types_1$j.isNull)(val.stack))
2653
+ && ((0, types_1$j.isArray)(val.ancestors) && val.ancestors.every(types_1$j.isString));
2654
+ }
2655
+ serializableError.isSerializableError = isSerializableError;
2656
+
2657
+ customError$1.CustomError = void 0;
2658
+ const iterable_operator_1$1 = es2018$a;
2659
+ const get_error_names_1$1 = getErrorNames$1;
2660
+ const types_1$i = es2018$7;
2661
+ const serializable_error_1 = serializableError;
2662
+ class CustomError extends Error {
2663
+ get name() {
2664
+ var _a, _b;
2665
+ return (_b = (_a = (0, iterable_operator_1$1.first)((0, get_error_names_1$1.getErrorNames)(this))) !== null && _a !== void 0 ? _a : CustomError.name) !== null && _b !== void 0 ? _b : 'CustomError';
2666
+ }
2667
+ static [Symbol.hasInstance](instance) {
2668
+ var _a;
2669
+ if ((0, types_1$i.isError)(instance) || (0, serializable_error_1.isSerializableError)(instance)) {
2670
+ const reversedClassNames = [
2671
+ (_a = this.prototype.constructor.name) !== null && _a !== void 0 ? _a : this.name,
2672
+ ...(0, get_error_names_1$1.getErrorNames)(this.prototype)
2673
+ ].reverse();
2674
+ const reversedInstanceNames = (0, iterable_operator_1$1.toArray)((0, get_error_names_1$1.getErrorNames)(instance)).reverse();
2675
+ return reversedClassNames.every((x, i) => x === reversedInstanceNames[i]);
2676
+ }
2677
+ else {
2678
+ return false;
2679
+ }
2680
+ }
2681
+ }
2682
+ customError$1.CustomError = CustomError;
255
2683
 
256
2684
  var assertionError = {};
257
2685
 
258
2686
  assertionError.AssertionError = void 0;
259
- const custom_error_1 = customError;
2687
+ const custom_error_1 = customError$1;
260
2688
  class AssertionError extends custom_error_1.CustomError {
261
2689
  }
262
2690
  assertionError.AssertionError = AssertionError;
@@ -264,25 +2692,69 @@ assertionError.AssertionError = AssertionError;
264
2692
  var normalize$1 = {};
265
2693
 
266
2694
  normalize$1.normalize = void 0;
2695
+ const get_error_names_1 = getErrorNames$1;
2696
+ const iterable_operator_1 = es2018$a;
267
2697
  function normalize(err) {
268
2698
  var _a;
2699
+ const [name, ...ancestors] = (0, iterable_operator_1.toArray)((0, get_error_names_1.getErrorNames)(err));
269
2700
  return {
270
- name: err.name,
2701
+ name,
2702
+ ancestors,
271
2703
  message: err.message,
272
2704
  stack: (_a = err.stack) !== null && _a !== void 0 ? _a : null
273
2705
  };
274
2706
  }
275
2707
  normalize$1.normalize = normalize;
276
2708
 
277
- var refute$1 = {};
2709
+ var hydrate$1 = {};
278
2710
 
279
- refute$1.refute = void 0;
280
- const expected_error_1 = expectedError;
281
- function refute(condition, message) {
282
- if (condition)
283
- throw new expected_error_1.ExpectedError(message);
2711
+ var es2018$6 = {};
2712
+
2713
+ var pass$1 = {};
2714
+
2715
+ pass$1.pass = void 0;
2716
+ function pass() { }
2717
+ pass$1.pass = pass;
2718
+
2719
+ (function (exports) {
2720
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2721
+ if (k2 === undefined) k2 = k;
2722
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2723
+ }) : (function(o, m, k, k2) {
2724
+ if (k2 === undefined) k2 = k;
2725
+ o[k2] = m[k];
2726
+ }));
2727
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2728
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2729
+ };__exportStar(pass$1, exports);
2730
+
2731
+ }(es2018$6));
2732
+
2733
+ hydrate$1.hydrate = void 0;
2734
+ const pass_1 = es2018$6;
2735
+ function hydrate(err) {
2736
+ var _a;
2737
+ const errorNames = [err.name, ...err.ancestors]
2738
+ .slice(0, -1)
2739
+ .reverse();
2740
+ let errorConstructor = Error;
2741
+ for (const name of errorNames) {
2742
+ errorConstructor = createChildErrorConstructor(errorConstructor, name);
2743
+ }
2744
+ const result = new errorConstructor();
2745
+ result.name = err.name;
2746
+ result.message = err.message;
2747
+ result.stack = (_a = err.stack) !== null && _a !== void 0 ? _a : undefined;
2748
+ return result;
2749
+ }
2750
+ hydrate$1.hydrate = hydrate;
2751
+ function createChildErrorConstructor(parentErrorConstructor, name) {
2752
+ const constructor = function () { (0, pass_1.pass)(); };
2753
+ constructor.prototype = Object.create(parentErrorConstructor.prototype);
2754
+ constructor.prototype.constructor = constructor;
2755
+ Object.defineProperty(constructor, 'name', { value: name });
2756
+ return constructor;
284
2757
  }
285
- refute$1.refute = refute;
286
2758
 
287
2759
  var assert$1 = {};
288
2760
 
@@ -304,14 +2776,16 @@ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Obj
304
2776
  }));
305
2777
  var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
306
2778
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
307
- };__exportStar(customError, exports);
308
- __exportStar(expectedError, exports);
2779
+ };__exportStar(customError$1, exports);
309
2780
  __exportStar(assertionError, exports);
2781
+ __exportStar(serializableError, exports);
310
2782
  __exportStar(normalize$1, exports);
311
- __exportStar(refute$1, exports);
2783
+ __exportStar(hydrate$1, exports);
312
2784
  __exportStar(assert$1, exports);
2785
+ __exportStar(getErrorNames$1, exports);
2786
+ __exportStar(traverseErrorPrototypeChain$1, exports);
313
2787
 
314
- }(es2018$6));
2788
+ }(es2018$b));
315
2789
 
316
2790
  var es2018$5 = {};
317
2791
 
@@ -345,7 +2819,7 @@ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m
345
2819
 
346
2820
  chunkAsync$1.chunkAsync = void 0;
347
2821
  const go_1$f = es2018$4;
348
- const errors_1$f = es2018$6;
2822
+ const errors_1$f = es2018$b;
349
2823
  function chunkAsync(iterable, size) {
350
2824
  (0, errors_1$f.assert)(Number.isInteger(size), 'The parameter size must be an integer');
351
2825
  (0, errors_1$f.assert)(size > 0, 'The parameter size must be greater than 0');
@@ -415,11 +2889,11 @@ function isntUndefined$1(val) {
415
2889
  _undefined$1.isntUndefined = isntUndefined$1;
416
2890
 
417
2891
  asyncIterable$1.isntAsyncIterable = asyncIterable$1.isAsyncIterable = void 0;
418
- const null_1$3 = _null$1;
419
- const undefined_1$5 = _undefined$1;
2892
+ const null_1$4 = _null$1;
2893
+ const undefined_1$4 = _undefined$1;
420
2894
  function isAsyncIterable$1(val) {
421
- return (0, null_1$3.isntNull)(val)
422
- && (0, undefined_1$5.isntUndefined)(val)
2895
+ return (0, null_1$4.isntNull)(val)
2896
+ && (0, undefined_1$4.isntUndefined)(val)
423
2897
  && typeof val[Symbol.asyncIterator] === 'function';
424
2898
  }
425
2899
  asyncIterable$1.isAsyncIterable = isAsyncIterable$1;
@@ -537,11 +3011,11 @@ _function$1.isntFunction = isntFunction$1;
537
3011
  var iterable$1 = {};
538
3012
 
539
3013
  iterable$1.isntIterable = iterable$1.isIterable = void 0;
540
- const null_1$2 = _null$1;
541
- const undefined_1$4 = _undefined$1;
3014
+ const null_1$3 = _null$1;
3015
+ const undefined_1$3 = _undefined$1;
542
3016
  function isIterable$1(val) {
543
- return (0, null_1$2.isntNull)(val)
544
- && (0, undefined_1$4.isntUndefined)(val)
3017
+ return (0, null_1$3.isntNull)(val)
3018
+ && (0, undefined_1$3.isntUndefined)(val)
545
3019
  && typeof val[Symbol.iterator] === 'function';
546
3020
  }
547
3021
  iterable$1.isIterable = isIterable$1;
@@ -550,23 +3024,31 @@ function isntIterable$1(val) {
550
3024
  }
551
3025
  iterable$1.isntIterable = isntIterable$1;
552
3026
 
553
- var jsonRpc$1 = {};
3027
+ var jsonRpc = {};
554
3028
 
555
3029
  var object$1 = {};
556
3030
 
557
- object$1.isntEmptyObject = object$1.isEmptyObject = object$1.isRecord = object$1.isntObject = object$1.isObject = void 0;
3031
+ var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
3032
+ return (mod && mod.__esModule) ? mod : { "default": mod };
3033
+ };object$1.isntEmptyObject = object$1.isEmptyObject = object$1.isntPlainObject = object$1.isPlainObject = object$1.isntObject = object$1.isObject = void 0;
3034
+ const lodash_isplainobject_1$1 = __importDefault$1(lodash_isplainobject);
558
3035
  function isObject$1(val) {
559
- return val !== null && typeof val === 'object';
3036
+ return val !== null
3037
+ && typeof val === 'object';
560
3038
  }
561
3039
  object$1.isObject = isObject$1;
562
3040
  function isntObject$1(val) {
563
3041
  return !isObject$1(val);
564
3042
  }
565
3043
  object$1.isntObject = isntObject$1;
566
- function isRecord(val) {
567
- return isObject$1(val);
3044
+ function isPlainObject$1(val) {
3045
+ return (0, lodash_isplainobject_1$1.default)(val);
568
3046
  }
569
- object$1.isRecord = isRecord;
3047
+ object$1.isPlainObject = isPlainObject$1;
3048
+ function isntPlainObject$1(val) {
3049
+ return !isPlainObject$1(val);
3050
+ }
3051
+ object$1.isntPlainObject = isntPlainObject$1;
570
3052
  function isEmptyObject$1(val) {
571
3053
  return Object.keys(val).length === 0;
572
3054
  }
@@ -588,69 +3070,69 @@ function isntNumber$1(val) {
588
3070
  }
589
3071
  number$1.isntNumber = isntNumber$1;
590
3072
 
591
- jsonRpc$1.isntJsonRpcError = jsonRpc$1.isJsonRpcError = jsonRpc$1.isntJsonRpcSuccess = jsonRpc$1.isJsonRpcSuccess = jsonRpc$1.isntJsonRpcRequest = jsonRpc$1.isJsonRpcRequest = jsonRpc$1.isntJsonRpcNotification = jsonRpc$1.isJsonRpcNotification = void 0;
3073
+ jsonRpc.isntJsonRpcError = jsonRpc.isJsonRpcError = jsonRpc.isntJsonRpcSuccess = jsonRpc.isJsonRpcSuccess = jsonRpc.isntJsonRpcRequest = jsonRpc.isJsonRpcRequest = jsonRpc.isntJsonRpcNotification = jsonRpc.isJsonRpcNotification = void 0;
592
3074
  const array_1$1 = array$1;
593
- const object_1$1 = object$1;
3075
+ const object_1$2 = object$1;
594
3076
  const string_1$2 = string$1;
595
3077
  const number_1$1 = number$1;
596
- const undefined_1$3 = _undefined$1;
597
- function isJsonRpcId$1(val) {
3078
+ const undefined_1$2 = _undefined$1;
3079
+ function isJsonRpcId(val) {
598
3080
  return (0, string_1$2.isString)(val) || (0, number_1$1.isNumber)(val);
599
3081
  }
600
- function isJsonRpcParams$1(val) {
601
- return (0, array_1$1.isArray)(val) || (0, object_1$1.isObject)(val);
3082
+ function isJsonRpcParams(val) {
3083
+ return (0, array_1$1.isArray)(val) || (0, object_1$2.isObject)(val);
602
3084
  }
603
- function isJsonRpcNotification$1(val) {
604
- return (0, object_1$1.isRecord)(val)
3085
+ function isJsonRpcNotification(val) {
3086
+ return (0, object_1$2.isPlainObject)(val)
605
3087
  && (0, string_1$2.isString)(val.jsonrpc)
606
3088
  && (0, string_1$2.isString)(val.method)
607
- && (0, undefined_1$3.isUndefined)(val.id)
608
- && isJsonRpcParams$1(val.params);
3089
+ && (0, undefined_1$2.isUndefined)(val.id)
3090
+ && isJsonRpcParams(val.params);
609
3091
  }
610
- jsonRpc$1.isJsonRpcNotification = isJsonRpcNotification$1;
611
- function isntJsonRpcNotification$1(val) {
612
- return !isJsonRpcNotification$1(val);
3092
+ jsonRpc.isJsonRpcNotification = isJsonRpcNotification;
3093
+ function isntJsonRpcNotification(val) {
3094
+ return !isJsonRpcNotification(val);
613
3095
  }
614
- jsonRpc$1.isntJsonRpcNotification = isntJsonRpcNotification$1;
615
- function isJsonRpcRequest$1(val) {
616
- return (0, object_1$1.isRecord)(val)
3096
+ jsonRpc.isntJsonRpcNotification = isntJsonRpcNotification;
3097
+ function isJsonRpcRequest(val) {
3098
+ return (0, object_1$2.isPlainObject)(val)
617
3099
  && (0, string_1$2.isString)(val.jsonrpc)
618
3100
  && (0, string_1$2.isString)(val.method)
619
- && isJsonRpcId$1(val.id)
620
- && isJsonRpcParams$1(val.params);
3101
+ && isJsonRpcId(val.id)
3102
+ && isJsonRpcParams(val.params);
621
3103
  }
622
- jsonRpc$1.isJsonRpcRequest = isJsonRpcRequest$1;
623
- function isntJsonRpcRequest$1(val) {
624
- return !isJsonRpcRequest$1(val);
3104
+ jsonRpc.isJsonRpcRequest = isJsonRpcRequest;
3105
+ function isntJsonRpcRequest(val) {
3106
+ return !isJsonRpcRequest(val);
625
3107
  }
626
- jsonRpc$1.isntJsonRpcRequest = isntJsonRpcRequest$1;
627
- function isJsonRpcSuccess$1(val) {
628
- return (0, object_1$1.isRecord)(val)
3108
+ jsonRpc.isntJsonRpcRequest = isntJsonRpcRequest;
3109
+ function isJsonRpcSuccess(val) {
3110
+ return (0, object_1$2.isPlainObject)(val)
629
3111
  && (0, string_1$2.isString)(val.jsonrpc)
630
3112
  && (0, string_1$2.isString)(val.id)
631
- && (0, undefined_1$3.isntUndefined)(val.result);
3113
+ && 'result' in val;
632
3114
  }
633
- jsonRpc$1.isJsonRpcSuccess = isJsonRpcSuccess$1;
634
- function isntJsonRpcSuccess$1(val) {
635
- return !isJsonRpcSuccess$1(val);
3115
+ jsonRpc.isJsonRpcSuccess = isJsonRpcSuccess;
3116
+ function isntJsonRpcSuccess(val) {
3117
+ return !isJsonRpcSuccess(val);
636
3118
  }
637
- jsonRpc$1.isntJsonRpcSuccess = isntJsonRpcSuccess$1;
638
- function isJsonRpcError$1(val) {
639
- return (0, object_1$1.isRecord)(val)
3119
+ jsonRpc.isntJsonRpcSuccess = isntJsonRpcSuccess;
3120
+ function isJsonRpcError(val) {
3121
+ return (0, object_1$2.isPlainObject)(val)
640
3122
  && (0, string_1$2.isString)(val.jsonrpc)
641
- && isJsonRpcId$1(val.id)
642
- && isJsonRpcErrorObject$1(val.error);
3123
+ && isJsonRpcId(val.id)
3124
+ && isJsonRpcErrorObject(val.error);
643
3125
  }
644
- jsonRpc$1.isJsonRpcError = isJsonRpcError$1;
645
- function isntJsonRpcError$1(val) {
646
- return !isJsonRpcError$1(val);
3126
+ jsonRpc.isJsonRpcError = isJsonRpcError;
3127
+ function isntJsonRpcError(val) {
3128
+ return !isJsonRpcError(val);
647
3129
  }
648
- jsonRpc$1.isntJsonRpcError = isntJsonRpcError$1;
649
- function isJsonRpcErrorObject$1(val) {
650
- return (0, object_1$1.isRecord)(val)
3130
+ jsonRpc.isntJsonRpcError = isntJsonRpcError;
3131
+ function isJsonRpcErrorObject(val) {
3132
+ return (0, object_1$2.isPlainObject)(val)
651
3133
  && (0, number_1$1.isNumber)(val.code)
652
3134
  && (0, string_1$2.isString)(val.message)
653
- && ((0, undefined_1$3.isUndefined)(val.data) || (0, object_1$1.isObject)(val.data));
3135
+ && ((0, undefined_1$2.isUndefined)(val.data) || (0, object_1$2.isObject)(val.data));
654
3136
  }
655
3137
 
656
3138
  var json$1 = {};
@@ -706,7 +3188,7 @@ __exportStar(error$1, exports);
706
3188
  __exportStar(falsy$1, exports);
707
3189
  __exportStar(_function$1, exports);
708
3190
  __exportStar(iterable$1, exports);
709
- __exportStar(jsonRpc$1, exports);
3191
+ __exportStar(jsonRpc, exports);
710
3192
  __exportStar(json$1, exports);
711
3193
  __exportStar(_null$1, exports);
712
3194
  __exportStar(number$1, exports);
@@ -780,7 +3262,7 @@ var chunk$1 = {};
780
3262
 
781
3263
  chunk$1.chunk = void 0;
782
3264
  const go_1$e = es2018$4;
783
- const errors_1$e = es2018$6;
3265
+ const errors_1$e = es2018$b;
784
3266
  function chunk(iterable, size) {
785
3267
  (0, errors_1$e.assert)(Number.isInteger(size), 'The parameter size must be an integer');
786
3268
  (0, errors_1$e.assert)(size > 0, 'The parameter size must be greater than 0');
@@ -856,7 +3338,7 @@ utils.copyIterable = copyIterable;
856
3338
  dropAsync$1.dropAsync = void 0;
857
3339
  const go_1$b = es2018$4;
858
3340
  const utils_1$3 = utils;
859
- const errors_1$d = es2018$6;
3341
+ const errors_1$d = es2018$b;
860
3342
  function dropAsync(iterable, count) {
861
3343
  (0, errors_1$d.assert)(Number.isInteger(count), 'The parameter count must be an integer');
862
3344
  (0, errors_1$d.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -891,7 +3373,7 @@ var dropRightAsync$1 = {};
891
3373
  dropRightAsync$1.dropRightAsync = void 0;
892
3374
  const go_1$a = es2018$4;
893
3375
  const utils_1$2 = utils;
894
- const errors_1$c = es2018$6;
3376
+ const errors_1$c = es2018$b;
895
3377
  function dropRightAsync(iterable, count) {
896
3378
  (0, errors_1$c.assert)(Number.isInteger(count), 'The parameter count must be an integer');
897
3379
  (0, errors_1$c.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -919,7 +3401,7 @@ var dropRight$1 = {};
919
3401
  dropRight$1.dropRight = void 0;
920
3402
  const go_1$9 = es2018$4;
921
3403
  const utils_1$1 = utils;
922
- const errors_1$b = es2018$6;
3404
+ const errors_1$b = es2018$b;
923
3405
  function dropRight(iterable, count) {
924
3406
  (0, errors_1$b.assert)(Number.isInteger(count), 'The parameter count must be an integer');
925
3407
  (0, errors_1$b.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1019,7 +3501,7 @@ var drop$1 = {};
1019
3501
  drop$1.drop = void 0;
1020
3502
  const go_1$8 = es2018$4;
1021
3503
  const utils_1 = utils;
1022
- const errors_1$a = es2018$6;
3504
+ const errors_1$a = es2018$b;
1023
3505
  function drop(iterable, count) {
1024
3506
  (0, errors_1$a.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1025
3507
  (0, errors_1$a.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1139,7 +3621,7 @@ function isFiniteIterable$1(val) {
1139
3621
 
1140
3622
  flattenDeepAsync$1.flattenDeepAsync = void 0;
1141
3623
  const flatten_by_async_1 = flattenByAsync$1;
1142
- const errors_1$9 = es2018$6;
3624
+ const errors_1$9 = es2018$b;
1143
3625
  function flattenDeepAsync(iterable, depth = Infinity) {
1144
3626
  (0, errors_1$9.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1145
3627
  (0, errors_1$9.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
@@ -1180,7 +3662,7 @@ var flattenDeep$1 = {};
1180
3662
 
1181
3663
  flattenDeep$1.flattenDeep = void 0;
1182
3664
  const flatten_by_1 = flattenBy$1;
1183
- const errors_1$8 = es2018$6;
3665
+ const errors_1$8 = es2018$b;
1184
3666
  function flattenDeep(iterable, depth = Infinity) {
1185
3667
  (0, errors_1$8.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1186
3668
  (0, errors_1$8.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
@@ -1241,7 +3723,7 @@ var repeatAsync$1 = {};
1241
3723
 
1242
3724
  repeatAsync$1.repeatAsync = void 0;
1243
3725
  const go_1$7 = es2018$4;
1244
- const errors_1$7 = es2018$6;
3726
+ const errors_1$7 = es2018$b;
1245
3727
  function repeatAsync(iterable, times) {
1246
3728
  (0, errors_1$7.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1247
3729
  (0, errors_1$7.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
@@ -1276,7 +3758,7 @@ var repeat$1 = {};
1276
3758
 
1277
3759
  repeat$1.repeat = void 0;
1278
3760
  const go_1$6 = es2018$4;
1279
- const errors_1$6 = es2018$6;
3761
+ const errors_1$6 = es2018$b;
1280
3762
  function repeat(iterable, times) {
1281
3763
  (0, errors_1$6.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1282
3764
  (0, errors_1$6.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
@@ -1311,7 +3793,7 @@ var sliceAsync$1 = {};
1311
3793
 
1312
3794
  sliceAsync$1.sliceAsync = void 0;
1313
3795
  const go_1$5 = es2018$4;
1314
- const errors_1$5 = es2018$6;
3796
+ const errors_1$5 = es2018$b;
1315
3797
  function sliceAsync(iterable, start, end = Infinity) {
1316
3798
  (0, errors_1$5.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1317
3799
  (0, errors_1$5.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
@@ -1334,7 +3816,7 @@ var slice$1 = {};
1334
3816
 
1335
3817
  slice$1.slice = void 0;
1336
3818
  const go_1$4 = es2018$4;
1337
- const errors_1$4 = es2018$6;
3819
+ const errors_1$4 = es2018$b;
1338
3820
  function slice(iterable, start, end = Infinity) {
1339
3821
  (0, errors_1$4.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1340
3822
  (0, errors_1$4.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
@@ -1457,7 +3939,7 @@ var takeAsync$1 = {};
1457
3939
 
1458
3940
  takeAsync$1.takeAsync = void 0;
1459
3941
  const go_1$3 = es2018$4;
1460
- const errors_1$3 = es2018$6;
3942
+ const errors_1$3 = es2018$b;
1461
3943
  function takeAsync(iterable, count) {
1462
3944
  (0, errors_1$3.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1463
3945
  (0, errors_1$3.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1478,7 +3960,7 @@ var takeRightAsync$1 = {};
1478
3960
 
1479
3961
  takeRightAsync$1.takeRightAsync = void 0;
1480
3962
  const go_1$2 = es2018$4;
1481
- const errors_1$2 = es2018$6;
3963
+ const errors_1$2 = es2018$b;
1482
3964
  function takeRightAsync(iterable, count) {
1483
3965
  (0, errors_1$2.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1484
3966
  (0, errors_1$2.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1508,7 +3990,7 @@ var takeRight$1 = {};
1508
3990
 
1509
3991
  takeRight$1.takeRight = void 0;
1510
3992
  const go_1$1 = es2018$4;
1511
- const errors_1$1 = es2018$6;
3993
+ const errors_1$1 = es2018$b;
1512
3994
  function takeRight(iterable, count) {
1513
3995
  (0, errors_1$1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1514
3996
  (0, errors_1$1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1584,7 +4066,7 @@ var take$1 = {};
1584
4066
 
1585
4067
  take$1.take = void 0;
1586
4068
  const go_1 = es2018$4;
1587
- const errors_1 = es2018$6;
4069
+ const errors_1 = es2018$b;
1588
4070
  function take(iterable, count) {
1589
4071
  (0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1590
4072
  (0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -2460,8 +4942,8 @@ class LRUMap {
2460
4942
  constructor(limit) {
2461
4943
  _LRUMap_limit.set(this, void 0);
2462
4944
  _LRUMap_map.set(this, new Map());
2463
- es2018$6.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2464
- es2018$6.assert(limit > 0, 'The parameter limit must be a positive value');
4945
+ es2018$b.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
4946
+ es2018$b.assert(limit > 0, 'The parameter limit must be a positive value');
2465
4947
  __classPrivateFieldSet(this, _LRUMap_limit, limit, "f");
2466
4948
  }
2467
4949
  get [(_LRUMap_limit = new WeakMap(), _LRUMap_map = new WeakMap(), Symbol.toStringTag)]() {
@@ -2795,8 +5277,8 @@ class TLRUMap {
2795
5277
  * 按过期时间升序排列所有项目的元数据
2796
5278
  */
2797
5279
  this.itemMetadataSortedByExpirationTime = [];
2798
- es2018$6.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2799
- es2018$6.assert(limit > 0, 'The parameter limit must be a positive value');
5280
+ es2018$b.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
5281
+ es2018$b.assert(limit > 0, 'The parameter limit must be a positive value');
2800
5282
  __classPrivateFieldSet(this, _TLRUMap_limit, limit, "f");
2801
5283
  }
2802
5284
  get [(_TLRUMap_limit = new WeakMap(), _TLRUMap_map = new WeakMap(), _TLRUMap_cancelClearTimeout = new WeakMap(), Symbol.toStringTag)]() {
@@ -3006,11 +5488,14 @@ class FiniteStateMachine {
3006
5488
  matches(state) {
3007
5489
  return __classPrivateFieldGet(this, _FiniteStateMachine_state, "f") === state;
3008
5490
  }
5491
+ can(event) {
5492
+ return event in this.schema[this.state];
5493
+ }
3009
5494
  /**
3010
5495
  * @throws {BadEventError}
3011
5496
  */
3012
5497
  send(event) {
3013
- if (event in this.schema[this.state]) {
5498
+ if (this.can(event)) {
3014
5499
  __classPrivateFieldSet(this, _FiniteStateMachine_state, this.schema[this.state][event], "f");
3015
5500
  }
3016
5501
  else {
@@ -3019,7 +5504,7 @@ class FiniteStateMachine {
3019
5504
  }
3020
5505
  }
3021
5506
  _FiniteStateMachine_state = new WeakMap();
3022
- class BadEventError extends es2018$6.CustomError {
5507
+ class BadEventError extends es2018$b.CustomError {
3023
5508
  constructor(state, event) {
3024
5509
  super(`State ${state} cannot react to event ${event}`);
3025
5510
  }
@@ -3063,7 +5548,7 @@ var Subscription = (function () {
3063
5548
  this.initialTeardown = initialTeardown;
3064
5549
  this.closed = false;
3065
5550
  this._parentage = null;
3066
- this._teardowns = null;
5551
+ this._finalizers = null;
3067
5552
  }
3068
5553
  Subscription.prototype.unsubscribe = function () {
3069
5554
  var e_1, _a, e_2, _b;
@@ -3092,23 +5577,23 @@ var Subscription = (function () {
3092
5577
  _parentage.remove(this);
3093
5578
  }
3094
5579
  }
3095
- var initialTeardown = this.initialTeardown;
3096
- if (isFunction$1(initialTeardown)) {
5580
+ var initialFinalizer = this.initialTeardown;
5581
+ if (isFunction$1(initialFinalizer)) {
3097
5582
  try {
3098
- initialTeardown();
5583
+ initialFinalizer();
3099
5584
  }
3100
5585
  catch (e) {
3101
5586
  errors = e instanceof UnsubscriptionError ? e.errors : [e];
3102
5587
  }
3103
5588
  }
3104
- var _teardowns = this._teardowns;
3105
- if (_teardowns) {
3106
- this._teardowns = null;
5589
+ var _finalizers = this._finalizers;
5590
+ if (_finalizers) {
5591
+ this._finalizers = null;
3107
5592
  try {
3108
- for (var _teardowns_1 = __values(_teardowns), _teardowns_1_1 = _teardowns_1.next(); !_teardowns_1_1.done; _teardowns_1_1 = _teardowns_1.next()) {
3109
- var teardown_1 = _teardowns_1_1.value;
5593
+ for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
5594
+ var finalizer = _finalizers_1_1.value;
3110
5595
  try {
3111
- execTeardown(teardown_1);
5596
+ execFinalizer(finalizer);
3112
5597
  }
3113
5598
  catch (err) {
3114
5599
  errors = errors !== null && errors !== void 0 ? errors : [];
@@ -3124,7 +5609,7 @@ var Subscription = (function () {
3124
5609
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
3125
5610
  finally {
3126
5611
  try {
3127
- if (_teardowns_1_1 && !_teardowns_1_1.done && (_b = _teardowns_1.return)) _b.call(_teardowns_1);
5612
+ if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
3128
5613
  }
3129
5614
  finally { if (e_2) throw e_2.error; }
3130
5615
  }
@@ -3138,7 +5623,7 @@ var Subscription = (function () {
3138
5623
  var _a;
3139
5624
  if (teardown && teardown !== this) {
3140
5625
  if (this.closed) {
3141
- execTeardown(teardown);
5626
+ execFinalizer(teardown);
3142
5627
  }
3143
5628
  else {
3144
5629
  if (teardown instanceof Subscription) {
@@ -3147,7 +5632,7 @@ var Subscription = (function () {
3147
5632
  }
3148
5633
  teardown._addParent(this);
3149
5634
  }
3150
- (this._teardowns = (_a = this._teardowns) !== null && _a !== void 0 ? _a : []).push(teardown);
5635
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
3151
5636
  }
3152
5637
  }
3153
5638
  };
@@ -3169,8 +5654,8 @@ var Subscription = (function () {
3169
5654
  }
3170
5655
  };
3171
5656
  Subscription.prototype.remove = function (teardown) {
3172
- var _teardowns = this._teardowns;
3173
- _teardowns && arrRemove(_teardowns, teardown);
5657
+ var _finalizers = this._finalizers;
5658
+ _finalizers && arrRemove(_finalizers, teardown);
3174
5659
  if (teardown instanceof Subscription) {
3175
5660
  teardown._removeParent(this);
3176
5661
  }
@@ -3187,12 +5672,12 @@ function isSubscription(value) {
3187
5672
  return (value instanceof Subscription ||
3188
5673
  (value && 'closed' in value && isFunction$1(value.remove) && isFunction$1(value.add) && isFunction$1(value.unsubscribe)));
3189
5674
  }
3190
- function execTeardown(teardown) {
3191
- if (isFunction$1(teardown)) {
3192
- teardown();
5675
+ function execFinalizer(finalizer) {
5676
+ if (isFunction$1(finalizer)) {
5677
+ finalizer();
3193
5678
  }
3194
5679
  else {
3195
- teardown.unsubscribe();
5680
+ finalizer.unsubscribe();
3196
5681
  }
3197
5682
  }
3198
5683
 
@@ -3205,13 +5690,16 @@ var config = {
3205
5690
  };
3206
5691
 
3207
5692
  var timeoutProvider = {
3208
- setTimeout: function () {
5693
+ setTimeout: function (handler, timeout) {
3209
5694
  var args = [];
3210
- for (var _i = 0; _i < arguments.length; _i++) {
3211
- args[_i] = arguments[_i];
5695
+ for (var _i = 2; _i < arguments.length; _i++) {
5696
+ args[_i - 2] = arguments[_i];
3212
5697
  }
3213
5698
  var delegate = timeoutProvider.delegate;
3214
- return ((delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) || setTimeout).apply(void 0, __spreadArray([], __read(args)));
5699
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
5700
+ return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
5701
+ }
5702
+ return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
3215
5703
  },
3216
5704
  clearTimeout: function (handle) {
3217
5705
  var delegate = timeoutProvider.delegate;
@@ -3318,52 +5806,88 @@ var Subscriber = (function (_super) {
3318
5806
  };
3319
5807
  return Subscriber;
3320
5808
  }(Subscription));
5809
+ var _bind = Function.prototype.bind;
5810
+ function bind(fn, thisArg) {
5811
+ return _bind.call(fn, thisArg);
5812
+ }
5813
+ var ConsumerObserver = (function () {
5814
+ function ConsumerObserver(partialObserver) {
5815
+ this.partialObserver = partialObserver;
5816
+ }
5817
+ ConsumerObserver.prototype.next = function (value) {
5818
+ var partialObserver = this.partialObserver;
5819
+ if (partialObserver.next) {
5820
+ try {
5821
+ partialObserver.next(value);
5822
+ }
5823
+ catch (error) {
5824
+ handleUnhandledError(error);
5825
+ }
5826
+ }
5827
+ };
5828
+ ConsumerObserver.prototype.error = function (err) {
5829
+ var partialObserver = this.partialObserver;
5830
+ if (partialObserver.error) {
5831
+ try {
5832
+ partialObserver.error(err);
5833
+ }
5834
+ catch (error) {
5835
+ handleUnhandledError(error);
5836
+ }
5837
+ }
5838
+ else {
5839
+ handleUnhandledError(err);
5840
+ }
5841
+ };
5842
+ ConsumerObserver.prototype.complete = function () {
5843
+ var partialObserver = this.partialObserver;
5844
+ if (partialObserver.complete) {
5845
+ try {
5846
+ partialObserver.complete();
5847
+ }
5848
+ catch (error) {
5849
+ handleUnhandledError(error);
5850
+ }
5851
+ }
5852
+ };
5853
+ return ConsumerObserver;
5854
+ }());
3321
5855
  var SafeSubscriber = (function (_super) {
3322
5856
  __extends(SafeSubscriber, _super);
3323
5857
  function SafeSubscriber(observerOrNext, error, complete) {
3324
5858
  var _this = _super.call(this) || this;
3325
- var next;
3326
- if (isFunction$1(observerOrNext)) {
3327
- next = observerOrNext;
5859
+ var partialObserver;
5860
+ if (isFunction$1(observerOrNext) || !observerOrNext) {
5861
+ partialObserver = {
5862
+ next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,
5863
+ error: error !== null && error !== void 0 ? error : undefined,
5864
+ complete: complete !== null && complete !== void 0 ? complete : undefined,
5865
+ };
3328
5866
  }
3329
- else if (observerOrNext) {
3330
- (next = observerOrNext.next, error = observerOrNext.error, complete = observerOrNext.complete);
5867
+ else {
3331
5868
  var context_1;
3332
5869
  if (_this && config.useDeprecatedNextContext) {
3333
5870
  context_1 = Object.create(observerOrNext);
3334
5871
  context_1.unsubscribe = function () { return _this.unsubscribe(); };
5872
+ partialObserver = {
5873
+ next: observerOrNext.next && bind(observerOrNext.next, context_1),
5874
+ error: observerOrNext.error && bind(observerOrNext.error, context_1),
5875
+ complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
5876
+ };
3335
5877
  }
3336
5878
  else {
3337
- context_1 = observerOrNext;
5879
+ partialObserver = observerOrNext;
3338
5880
  }
3339
- next = next === null || next === void 0 ? void 0 : next.bind(context_1);
3340
- error = error === null || error === void 0 ? void 0 : error.bind(context_1);
3341
- complete = complete === null || complete === void 0 ? void 0 : complete.bind(context_1);
3342
- }
3343
- _this.destination = {
3344
- next: next ? wrapForErrorHandling(next) : noop,
3345
- error: wrapForErrorHandling(error !== null && error !== void 0 ? error : defaultErrorHandler),
3346
- complete: complete ? wrapForErrorHandling(complete) : noop,
3347
- };
5881
+ }
5882
+ _this.destination = new ConsumerObserver(partialObserver);
3348
5883
  return _this;
3349
5884
  }
3350
5885
  return SafeSubscriber;
3351
5886
  }(Subscriber));
3352
- function wrapForErrorHandling(handler, instance) {
3353
- return function () {
3354
- var args = [];
3355
- for (var _i = 0; _i < arguments.length; _i++) {
3356
- args[_i] = arguments[_i];
3357
- }
3358
- try {
3359
- handler.apply(void 0, __spreadArray([], __read(args)));
3360
- }
3361
- catch (err) {
3362
- {
3363
- reportUnhandledError(err);
3364
- }
3365
- }
3366
- };
5887
+ function handleUnhandledError(error) {
5888
+ {
5889
+ reportUnhandledError(error);
5890
+ }
3367
5891
  }
3368
5892
  function defaultErrorHandler(err) {
3369
5893
  throw err;
@@ -3500,6 +6024,7 @@ var Subject = (function (_super) {
3500
6024
  function Subject() {
3501
6025
  var _this = _super.call(this) || this;
3502
6026
  _this.closed = false;
6027
+ _this.currentObservers = null;
3503
6028
  _this.observers = [];
3504
6029
  _this.isStopped = false;
3505
6030
  _this.hasError = false;
@@ -3522,17 +6047,19 @@ var Subject = (function (_super) {
3522
6047
  var e_1, _a;
3523
6048
  _this._throwIfClosed();
3524
6049
  if (!_this.isStopped) {
3525
- var copy = _this.observers.slice();
6050
+ if (!_this.currentObservers) {
6051
+ _this.currentObservers = Array.from(_this.observers);
6052
+ }
3526
6053
  try {
3527
- for (var copy_1 = __values(copy), copy_1_1 = copy_1.next(); !copy_1_1.done; copy_1_1 = copy_1.next()) {
3528
- var observer = copy_1_1.value;
6054
+ for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
6055
+ var observer = _c.value;
3529
6056
  observer.next(value);
3530
6057
  }
3531
6058
  }
3532
6059
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
3533
6060
  finally {
3534
6061
  try {
3535
- if (copy_1_1 && !copy_1_1.done && (_a = copy_1.return)) _a.call(copy_1);
6062
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3536
6063
  }
3537
6064
  finally { if (e_1) throw e_1.error; }
3538
6065
  }
@@ -3568,7 +6095,7 @@ var Subject = (function (_super) {
3568
6095
  };
3569
6096
  Subject.prototype.unsubscribe = function () {
3570
6097
  this.isStopped = this.closed = true;
3571
- this.observers = null;
6098
+ this.observers = this.currentObservers = null;
3572
6099
  };
3573
6100
  Object.defineProperty(Subject.prototype, "observed", {
3574
6101
  get: function () {
@@ -3588,10 +6115,17 @@ var Subject = (function (_super) {
3588
6115
  return this._innerSubscribe(subscriber);
3589
6116
  };
3590
6117
  Subject.prototype._innerSubscribe = function (subscriber) {
6118
+ var _this = this;
3591
6119
  var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
3592
- return hasError || isStopped
3593
- ? EMPTY_SUBSCRIPTION
3594
- : (observers.push(subscriber), new Subscription(function () { return arrRemove(observers, subscriber); }));
6120
+ if (hasError || isStopped) {
6121
+ return EMPTY_SUBSCRIPTION;
6122
+ }
6123
+ this.currentObservers = null;
6124
+ observers.push(subscriber);
6125
+ return new Subscription(function () {
6126
+ _this.currentObservers = null;
6127
+ arrRemove(observers, subscriber);
6128
+ });
3595
6129
  };
3596
6130
  Subject.prototype._checkFinalizedStatuses = function (subscriber) {
3597
6131
  var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
@@ -3681,19 +6215,32 @@ _undefined.isntUndefined = _undefined.isUndefined = void 0;
3681
6215
  function isUndefined(val) {
3682
6216
  return val === undefined;
3683
6217
  }
3684
- _undefined.isUndefined = isUndefined;
3685
- function isntUndefined(val) {
3686
- return !isUndefined(val);
6218
+ _undefined.isUndefined = isUndefined;
6219
+ function isntUndefined(val) {
6220
+ return !isUndefined(val);
6221
+ }
6222
+ _undefined.isntUndefined = isntUndefined;
6223
+
6224
+ var _function = {};
6225
+
6226
+ _function.isntFunction = _function.isFunction = void 0;
6227
+ function isFunction(val) {
6228
+ return typeof val === 'function';
6229
+ }
6230
+ _function.isFunction = isFunction;
6231
+ function isntFunction(val) {
6232
+ return !isFunction(val);
3687
6233
  }
3688
- _undefined.isntUndefined = isntUndefined;
6234
+ _function.isntFunction = isntFunction;
3689
6235
 
3690
6236
  asyncIterable.isntAsyncIterable = asyncIterable.isAsyncIterable = void 0;
3691
- const null_1$1 = _null;
3692
- const undefined_1$2 = _undefined;
6237
+ const null_1$2 = _null;
6238
+ const undefined_1$1 = _undefined;
6239
+ const function_1$2 = _function;
3693
6240
  function isAsyncIterable(val) {
3694
- return (0, null_1$1.isntNull)(val)
3695
- && (0, undefined_1$2.isntUndefined)(val)
3696
- && typeof val[Symbol.asyncIterator] === 'function';
6241
+ return (0, null_1$2.isntNull)(val)
6242
+ && (0, undefined_1$1.isntUndefined)(val)
6243
+ && (0, function_1$2.isFunction)(val[Symbol.asyncIterator]);
3697
6244
  }
3698
6245
  asyncIterable.isAsyncIterable = isAsyncIterable;
3699
6246
  function isntAsyncIterable(val) {
@@ -3795,27 +6342,16 @@ function isntFalsy(val) {
3795
6342
  }
3796
6343
  falsy.isntFalsy = isntFalsy;
3797
6344
 
3798
- var _function = {};
3799
-
3800
- _function.isntFunction = _function.isFunction = void 0;
3801
- function isFunction(val) {
3802
- return typeof val === 'function';
3803
- }
3804
- _function.isFunction = isFunction;
3805
- function isntFunction(val) {
3806
- return !isFunction(val);
3807
- }
3808
- _function.isntFunction = isntFunction;
3809
-
3810
6345
  var iterable = {};
3811
6346
 
3812
6347
  iterable.isntIterable = iterable.isIterable = void 0;
3813
- const null_1 = _null;
3814
- const undefined_1$1 = _undefined;
6348
+ const null_1$1 = _null;
6349
+ const undefined_1 = _undefined;
6350
+ const function_1$1 = _function;
3815
6351
  function isIterable(val) {
3816
- return (0, null_1.isntNull)(val)
3817
- && (0, undefined_1$1.isntUndefined)(val)
3818
- && typeof val[Symbol.iterator] === 'function';
6352
+ return (0, null_1$1.isntNull)(val)
6353
+ && (0, undefined_1.isntUndefined)(val)
6354
+ && (0, function_1$1.isFunction)(val[Symbol.iterator]);
3819
6355
  }
3820
6356
  iterable.isIterable = isIterable;
3821
6357
  function isntIterable(val) {
@@ -3823,149 +6359,21 @@ function isntIterable(val) {
3823
6359
  }
3824
6360
  iterable.isntIterable = isntIterable;
3825
6361
 
3826
- var jsonRpc = {};
3827
-
3828
- var object = {};
3829
-
3830
- /**
3831
- * lodash (Custom Build) <https://lodash.com/>
3832
- * Build: `lodash modularize exports="npm" -o ./`
3833
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
3834
- * Released under MIT license <https://lodash.com/license>
3835
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
3836
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
3837
- */
3838
-
3839
- /** `Object#toString` result references. */
3840
- var objectTag = '[object Object]';
3841
-
3842
- /**
3843
- * Checks if `value` is a host object in IE < 9.
3844
- *
3845
- * @private
3846
- * @param {*} value The value to check.
3847
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
3848
- */
3849
- function isHostObject(value) {
3850
- // Many host objects are `Object` objects that can coerce to strings
3851
- // despite having improperly defined `toString` methods.
3852
- var result = false;
3853
- if (value != null && typeof value.toString != 'function') {
3854
- try {
3855
- result = !!(value + '');
3856
- } catch (e) {}
3857
- }
3858
- return result;
3859
- }
3860
-
3861
- /**
3862
- * Creates a unary function that invokes `func` with its argument transformed.
3863
- *
3864
- * @private
3865
- * @param {Function} func The function to wrap.
3866
- * @param {Function} transform The argument transform.
3867
- * @returns {Function} Returns the new function.
3868
- */
3869
- function overArg(func, transform) {
3870
- return function(arg) {
3871
- return func(transform(arg));
3872
- };
3873
- }
3874
-
3875
- /** Used for built-in method references. */
3876
- var funcProto = Function.prototype,
3877
- objectProto = Object.prototype;
3878
-
3879
- /** Used to resolve the decompiled source of functions. */
3880
- var funcToString = funcProto.toString;
3881
-
3882
- /** Used to check objects for own properties. */
3883
- var hasOwnProperty = objectProto.hasOwnProperty;
3884
-
3885
- /** Used to infer the `Object` constructor. */
3886
- var objectCtorString = funcToString.call(Object);
3887
-
3888
- /**
3889
- * Used to resolve the
3890
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3891
- * of values.
3892
- */
3893
- var objectToString = objectProto.toString;
6362
+ var json = {};
3894
6363
 
3895
- /** Built-in value references. */
3896
- var getPrototype = overArg(Object.getPrototypeOf, Object);
6364
+ var number = {};
3897
6365
 
3898
- /**
3899
- * Checks if `value` is object-like. A value is object-like if it's not `null`
3900
- * and has a `typeof` result of "object".
3901
- *
3902
- * @static
3903
- * @memberOf _
3904
- * @since 4.0.0
3905
- * @category Lang
3906
- * @param {*} value The value to check.
3907
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
3908
- * @example
3909
- *
3910
- * _.isObjectLike({});
3911
- * // => true
3912
- *
3913
- * _.isObjectLike([1, 2, 3]);
3914
- * // => true
3915
- *
3916
- * _.isObjectLike(_.noop);
3917
- * // => false
3918
- *
3919
- * _.isObjectLike(null);
3920
- * // => false
3921
- */
3922
- function isObjectLike(value) {
3923
- return !!value && typeof value == 'object';
6366
+ number.isntNumber = number.isNumber = void 0;
6367
+ function isNumber(val) {
6368
+ return typeof val === 'number';
3924
6369
  }
3925
-
3926
- /**
3927
- * Checks if `value` is a plain object, that is, an object created by the
3928
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
3929
- *
3930
- * @static
3931
- * @memberOf _
3932
- * @since 0.8.0
3933
- * @category Lang
3934
- * @param {*} value The value to check.
3935
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
3936
- * @example
3937
- *
3938
- * function Foo() {
3939
- * this.a = 1;
3940
- * }
3941
- *
3942
- * _.isPlainObject(new Foo);
3943
- * // => false
3944
- *
3945
- * _.isPlainObject([1, 2, 3]);
3946
- * // => false
3947
- *
3948
- * _.isPlainObject({ 'x': 0, 'y': 0 });
3949
- * // => true
3950
- *
3951
- * _.isPlainObject(Object.create(null));
3952
- * // => true
3953
- */
3954
- function isPlainObject$1(value) {
3955
- if (!isObjectLike(value) ||
3956
- objectToString.call(value) != objectTag || isHostObject(value)) {
3957
- return false;
3958
- }
3959
- var proto = getPrototype(value);
3960
- if (proto === null) {
3961
- return true;
3962
- }
3963
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
3964
- return (typeof Ctor == 'function' &&
3965
- Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
6370
+ number.isNumber = isNumber;
6371
+ function isntNumber(val) {
6372
+ return !isNumber(val);
3966
6373
  }
6374
+ number.isntNumber = isntNumber;
3967
6375
 
3968
- var lodash_isplainobject = isPlainObject$1;
6376
+ var object = {};
3969
6377
 
3970
6378
  var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
3971
6379
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -3997,87 +6405,27 @@ function isntEmptyObject(val) {
3997
6405
  }
3998
6406
  object.isntEmptyObject = isntEmptyObject;
3999
6407
 
4000
- var number = {};
4001
-
4002
- number.isntNumber = number.isNumber = void 0;
4003
- function isNumber(val) {
4004
- return typeof val === 'number';
4005
- }
4006
- number.isNumber = isNumber;
4007
- function isntNumber(val) {
4008
- return !isNumber(val);
4009
- }
4010
- number.isntNumber = isntNumber;
4011
-
4012
- jsonRpc.isntJsonRpcError = jsonRpc.isJsonRpcError = jsonRpc.isntJsonRpcSuccess = jsonRpc.isJsonRpcSuccess = jsonRpc.isntJsonRpcRequest = jsonRpc.isJsonRpcRequest = jsonRpc.isntJsonRpcNotification = jsonRpc.isJsonRpcNotification = void 0;
4013
- const array_1 = array;
4014
- const object_1 = object;
6408
+ json.isntJsonable = json.isJsonable = json.isntJson = json.isJson = void 0;
6409
+ const null_1 = _null;
6410
+ const boolean_1 = boolean;
4015
6411
  const string_1 = string;
4016
6412
  const number_1 = number;
4017
- const undefined_1 = _undefined;
4018
- function isJsonRpcId(val) {
4019
- return (0, string_1.isString)(val) || (0, number_1.isNumber)(val);
4020
- }
4021
- function isJsonRpcParams(val) {
4022
- return (0, array_1.isArray)(val) || (0, object_1.isObject)(val);
4023
- }
4024
- function isJsonRpcNotification(val) {
4025
- return (0, object_1.isPlainObject)(val)
4026
- && (0, string_1.isString)(val.jsonrpc)
4027
- && (0, string_1.isString)(val.method)
4028
- && (0, undefined_1.isUndefined)(val.id)
4029
- && isJsonRpcParams(val.params);
4030
- }
4031
- jsonRpc.isJsonRpcNotification = isJsonRpcNotification;
4032
- function isntJsonRpcNotification(val) {
4033
- return !isJsonRpcNotification(val);
4034
- }
4035
- jsonRpc.isntJsonRpcNotification = isntJsonRpcNotification;
4036
- function isJsonRpcRequest(val) {
4037
- return (0, object_1.isPlainObject)(val)
4038
- && (0, string_1.isString)(val.jsonrpc)
4039
- && (0, string_1.isString)(val.method)
4040
- && isJsonRpcId(val.id)
4041
- && isJsonRpcParams(val.params);
4042
- }
4043
- jsonRpc.isJsonRpcRequest = isJsonRpcRequest;
4044
- function isntJsonRpcRequest(val) {
4045
- return !isJsonRpcRequest(val);
4046
- }
4047
- jsonRpc.isntJsonRpcRequest = isntJsonRpcRequest;
4048
- function isJsonRpcSuccess(val) {
4049
- return (0, object_1.isPlainObject)(val)
4050
- && (0, string_1.isString)(val.jsonrpc)
4051
- && (0, string_1.isString)(val.id)
4052
- && 'result' in val;
4053
- }
4054
- jsonRpc.isJsonRpcSuccess = isJsonRpcSuccess;
4055
- function isntJsonRpcSuccess(val) {
4056
- return !isJsonRpcSuccess(val);
4057
- }
4058
- jsonRpc.isntJsonRpcSuccess = isntJsonRpcSuccess;
4059
- function isJsonRpcError(val) {
4060
- return (0, object_1.isPlainObject)(val)
4061
- && (0, string_1.isString)(val.jsonrpc)
4062
- && isJsonRpcId(val.id)
4063
- && isJsonRpcErrorObject(val.error);
4064
- }
4065
- jsonRpc.isJsonRpcError = isJsonRpcError;
4066
- function isntJsonRpcError(val) {
4067
- return !isJsonRpcError(val);
6413
+ const array_1 = array;
6414
+ const object_1$1 = object;
6415
+ function isJson(val) {
6416
+ return (0, null_1.isNull)(val)
6417
+ || (0, boolean_1.isBoolean)(val)
6418
+ || (0, string_1.isString)(val)
6419
+ || (0, number_1.isNumber)(val)
6420
+ || ((0, array_1.isArray)(val) && val.every(isJson))
6421
+ || ((0, object_1$1.isPlainObject)(val) && Object.values(val).every(isJson));
4068
6422
  }
4069
- jsonRpc.isntJsonRpcError = isntJsonRpcError;
4070
- function isJsonRpcErrorObject(val) {
4071
- return (0, object_1.isPlainObject)(val)
4072
- && (0, number_1.isNumber)(val.code)
4073
- && (0, string_1.isString)(val.message)
4074
- && ((0, undefined_1.isUndefined)(val.data) || (0, object_1.isObject)(val.data));
6423
+ json.isJson = isJson;
6424
+ function isntJson(val) {
6425
+ return !isJson(val);
4075
6426
  }
4076
-
4077
- var json = {};
4078
-
4079
- json.isntJson = json.isJson = void 0;
4080
- function isJson(val) {
6427
+ json.isntJson = isntJson;
6428
+ function isJsonable(val) {
4081
6429
  try {
4082
6430
  JSON.stringify(val);
4083
6431
  return true;
@@ -4086,11 +6434,34 @@ function isJson(val) {
4086
6434
  return false;
4087
6435
  }
4088
6436
  }
4089
- json.isJson = isJson;
4090
- function isntJson(val) {
4091
- return !isntJson();
6437
+ json.isJsonable = isJsonable;
6438
+ function isntJsonable(val) {
6439
+ return !isntJsonable();
4092
6440
  }
4093
- json.isntJson = isntJson;
6441
+ json.isntJsonable = isntJsonable;
6442
+
6443
+ var promise = {};
6444
+
6445
+ promise.isPromiseLike = promise.isntPromiseLike = promise.isntPromise = promise.isPromise = void 0;
6446
+ const object_1 = object;
6447
+ const function_1 = _function;
6448
+ function isPromise(val) {
6449
+ return val instanceof Promise;
6450
+ }
6451
+ promise.isPromise = isPromise;
6452
+ function isntPromise(val) {
6453
+ return !isPromise(val);
6454
+ }
6455
+ promise.isntPromise = isntPromise;
6456
+ function isntPromiseLike(val) {
6457
+ return !isPromiseLike(val);
6458
+ }
6459
+ promise.isntPromiseLike = isntPromiseLike;
6460
+ function isPromiseLike(val) {
6461
+ return (0, object_1.isObject)(val)
6462
+ && (0, function_1.isFunction)(val.then);
6463
+ }
6464
+ promise.isPromiseLike = isPromiseLike;
4094
6465
 
4095
6466
  var url = {};
4096
6467
 
@@ -4127,11 +6498,11 @@ __exportStar(error, exports);
4127
6498
  __exportStar(falsy, exports);
4128
6499
  __exportStar(_function, exports);
4129
6500
  __exportStar(iterable, exports);
4130
- __exportStar(jsonRpc, exports);
4131
6501
  __exportStar(json, exports);
4132
6502
  __exportStar(_null, exports);
4133
6503
  __exportStar(number, exports);
4134
6504
  __exportStar(object, exports);
6505
+ __exportStar(promise, exports);
4135
6506
  __exportStar(string, exports);
4136
6507
  __exportStar(_undefined, exports);
4137
6508
  __exportStar(url, exports);