@blackglory/structures 0.2.6 → 0.2.7

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.
@@ -1,12 +1,3 @@
1
- function convertConsToArray([value, next]) {
2
- if (next === null)
3
- return [value];
4
- return [value, ...convertConsToArray(next)];
5
- }
6
- function convertArrayToCons([value, ...next]) {
7
- return [value, next.length ? convertArrayToCons(next) : null];
8
- }
9
-
10
1
  /*! *****************************************************************************
11
2
  Copyright (c) Microsoft Corporation.
12
3
 
@@ -35,6 +26,30 @@ function __classPrivateFieldSet(receiver, state, value, kind, f) {
35
26
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
36
27
  }
37
28
 
29
+ var _Box_value;
30
+ class Box {
31
+ constructor(value) {
32
+ _Box_value.set(this, void 0);
33
+ __classPrivateFieldSet(this, _Box_value, value, "f");
34
+ }
35
+ set(value) {
36
+ __classPrivateFieldSet(this, _Box_value, value, "f");
37
+ }
38
+ get() {
39
+ return __classPrivateFieldGet(this, _Box_value, "f");
40
+ }
41
+ }
42
+ _Box_value = new WeakMap();
43
+
44
+ function convertConsToArray([value, next]) {
45
+ if (next === null)
46
+ return [value];
47
+ return [value, ...convertConsToArray(next)];
48
+ }
49
+ function convertArrayToCons([value, ...next]) {
50
+ return [value, next.length ? convertArrayToCons(next) : null];
51
+ }
52
+
38
53
  var _Emitter_map;
39
54
  class Emitter {
40
55
  constructor() {
@@ -163,7 +178,7 @@ class Queue {
163
178
 
164
179
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
165
180
 
166
- var es2018$4 = {};
181
+ var es2018$5 = {};
167
182
 
168
183
  var customError = {};
169
184
 
@@ -241,15 +256,15 @@ __exportStar(normalize$1, exports);
241
256
  __exportStar(refute$1, exports);
242
257
  __exportStar(assert$1, exports);
243
258
 
244
- }(es2018$4));
259
+ }(es2018$5));
245
260
 
246
- var es2018$3 = {};
261
+ var es2018$4 = {};
247
262
 
248
263
  var middleware = {};
249
264
 
250
265
  var chunkAsync$1 = {};
251
266
 
252
- var es2018$2 = {};
267
+ var es2018$3 = {};
253
268
 
254
269
  var go$1 = {};
255
270
 
@@ -271,11 +286,11 @@ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m
271
286
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
272
287
  };__exportStar(go$1, exports);
273
288
 
274
- }(es2018$2));
289
+ }(es2018$3));
275
290
 
276
291
  chunkAsync$1.chunkAsync = void 0;
277
- const go_1$f = es2018$2;
278
- const errors_1$f = es2018$4;
292
+ const go_1$f = es2018$3;
293
+ const errors_1$f = es2018$5;
279
294
  function chunkAsync(iterable, size) {
280
295
  (0, errors_1$f.assert)(Number.isInteger(size), 'The parameter size must be an integer');
281
296
  (0, errors_1$f.assert)(size > 0, 'The parameter size must be greater than 0');
@@ -296,7 +311,7 @@ chunkAsync$1.chunkAsync = chunkAsync;
296
311
 
297
312
  var chunkByAsync$1 = {};
298
313
 
299
- var es2018$1 = {};
314
+ var es2018$2 = {};
300
315
 
301
316
  var array = {};
302
317
 
@@ -645,10 +660,10 @@ __exportStar(string, exports);
645
660
  __exportStar(_undefined, exports);
646
661
  __exportStar(url, exports);
647
662
 
648
- }(es2018$1));
663
+ }(es2018$2));
649
664
 
650
665
  chunkByAsync$1.chunkByAsync = void 0;
651
- const types_1$h = es2018$1;
666
+ const types_1$h = es2018$2;
652
667
  function chunkByAsync(iterable, predicate) {
653
668
  if ((0, types_1$h.isAsyncIterable)(iterable)) {
654
669
  return chunkByAsyncIterable(iterable);
@@ -709,8 +724,8 @@ chunkBy$1.chunkBy = chunkBy;
709
724
  var chunk$1 = {};
710
725
 
711
726
  chunk$1.chunk = void 0;
712
- const go_1$e = es2018$2;
713
- const errors_1$e = es2018$4;
727
+ const go_1$e = es2018$3;
728
+ const errors_1$e = es2018$5;
714
729
  function chunk(iterable, size) {
715
730
  (0, errors_1$e.assert)(Number.isInteger(size), 'The parameter size must be an integer');
716
731
  (0, errors_1$e.assert)(size > 0, 'The parameter size must be greater than 0');
@@ -732,8 +747,8 @@ chunk$1.chunk = chunk;
732
747
  var concatAsync$1 = {};
733
748
 
734
749
  concatAsync$1.concatAsync = void 0;
735
- const types_1$g = es2018$1;
736
- const go_1$d = es2018$2;
750
+ const types_1$g = es2018$2;
751
+ const go_1$d = es2018$3;
737
752
  function concatAsync(iterable, ...otherIterables) {
738
753
  return (0, go_1$d.go)(async function* () {
739
754
  for (const iter of [iterable, ...otherIterables]) {
@@ -755,7 +770,7 @@ concatAsync$1.concatAsync = concatAsync;
755
770
  var concat$1 = {};
756
771
 
757
772
  concat$1.concat = void 0;
758
- const go_1$c = es2018$2;
773
+ const go_1$c = es2018$3;
759
774
  function concat(iterable, ...otherIterables) {
760
775
  return (0, go_1$c.go)(function* () {
761
776
  for (const iter of [iterable, ...otherIterables]) {
@@ -784,9 +799,9 @@ function* copyIterable(iterable) {
784
799
  utils.copyIterable = copyIterable;
785
800
 
786
801
  dropAsync$1.dropAsync = void 0;
787
- const go_1$b = es2018$2;
802
+ const go_1$b = es2018$3;
788
803
  const utils_1$3 = utils;
789
- const errors_1$d = es2018$4;
804
+ const errors_1$d = es2018$5;
790
805
  function dropAsync(iterable, count) {
791
806
  (0, errors_1$d.assert)(Number.isInteger(count), 'The parameter count must be an integer');
792
807
  (0, errors_1$d.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -819,9 +834,9 @@ dropAsync$1.dropAsync = dropAsync;
819
834
  var dropRightAsync$1 = {};
820
835
 
821
836
  dropRightAsync$1.dropRightAsync = void 0;
822
- const go_1$a = es2018$2;
837
+ const go_1$a = es2018$3;
823
838
  const utils_1$2 = utils;
824
- const errors_1$c = es2018$4;
839
+ const errors_1$c = es2018$5;
825
840
  function dropRightAsync(iterable, count) {
826
841
  (0, errors_1$c.assert)(Number.isInteger(count), 'The parameter count must be an integer');
827
842
  (0, errors_1$c.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -847,9 +862,9 @@ async function toArrayAsync$2(iterable) {
847
862
  var dropRight$1 = {};
848
863
 
849
864
  dropRight$1.dropRight = void 0;
850
- const go_1$9 = es2018$2;
865
+ const go_1$9 = es2018$3;
851
866
  const utils_1$1 = utils;
852
- const errors_1$b = es2018$4;
867
+ const errors_1$b = es2018$5;
853
868
  function dropRight(iterable, count) {
854
869
  (0, errors_1$b.assert)(Number.isInteger(count), 'The parameter count must be an integer');
855
870
  (0, errors_1$b.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -865,7 +880,7 @@ dropRight$1.dropRight = dropRight;
865
880
  var dropUntilAsync$1 = {};
866
881
 
867
882
  dropUntilAsync$1.dropUntilAsync = void 0;
868
- const types_1$f = es2018$1;
883
+ const types_1$f = es2018$2;
869
884
  function dropUntilAsync(iterable, predicate) {
870
885
  if ((0, types_1$f.isAsyncIterable)(iterable)) {
871
886
  return dropUntilAsyncIterable(iterable);
@@ -947,9 +962,9 @@ dropUntil$1.dropUntil = dropUntil;
947
962
  var drop$1 = {};
948
963
 
949
964
  drop$1.drop = void 0;
950
- const go_1$8 = es2018$2;
965
+ const go_1$8 = es2018$3;
951
966
  const utils_1 = utils;
952
- const errors_1$a = es2018$4;
967
+ const errors_1$a = es2018$5;
953
968
  function drop(iterable, count) {
954
969
  (0, errors_1$a.assert)(Number.isInteger(count), 'The parameter count must be an integer');
955
970
  (0, errors_1$a.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -982,7 +997,7 @@ drop$1.drop = drop;
982
997
  var filterAsync$1 = {};
983
998
 
984
999
  filterAsync$1.filterAsync = void 0;
985
- const types_1$e = es2018$1;
1000
+ const types_1$e = es2018$2;
986
1001
  function filterAsync(iterable, predicate) {
987
1002
  if ((0, types_1$e.isAsyncIterable)(iterable)) {
988
1003
  return filterAsyncIterable(iterable);
@@ -1029,7 +1044,7 @@ var flattenDeepAsync$1 = {};
1029
1044
  var flattenByAsync$1 = {};
1030
1045
 
1031
1046
  flattenByAsync$1.flattenByAsync = void 0;
1032
- const types_1$d = es2018$1;
1047
+ const types_1$d = es2018$2;
1033
1048
  function flattenByAsync(iterable, predicate) {
1034
1049
  if ((0, types_1$d.isAsyncIterable)(iterable)) {
1035
1050
  return flattenByAsyncIterable(iterable);
@@ -1069,7 +1084,7 @@ function isFiniteIterable$1(val) {
1069
1084
 
1070
1085
  flattenDeepAsync$1.flattenDeepAsync = void 0;
1071
1086
  const flatten_by_async_1 = flattenByAsync$1;
1072
- const errors_1$9 = es2018$4;
1087
+ const errors_1$9 = es2018$5;
1073
1088
  function flattenDeepAsync(iterable, depth = Infinity) {
1074
1089
  (0, errors_1$9.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1075
1090
  (0, errors_1$9.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
@@ -1087,7 +1102,7 @@ flattenAsync$1.flattenAsync = flattenAsync;
1087
1102
  var flattenBy$1 = {};
1088
1103
 
1089
1104
  flattenBy$1.flattenBy = void 0;
1090
- const types_1$c = es2018$1;
1105
+ const types_1$c = es2018$2;
1091
1106
  function flattenBy(iterable, predicate) {
1092
1107
  return flatten(iterable, 1);
1093
1108
  function* flatten(iterable, level) {
@@ -1110,7 +1125,7 @@ var flattenDeep$1 = {};
1110
1125
 
1111
1126
  flattenDeep$1.flattenDeep = void 0;
1112
1127
  const flatten_by_1 = flattenBy$1;
1113
- const errors_1$8 = es2018$4;
1128
+ const errors_1$8 = es2018$5;
1114
1129
  function flattenDeep(iterable, depth = Infinity) {
1115
1130
  (0, errors_1$8.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1116
1131
  (0, errors_1$8.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
@@ -1130,7 +1145,7 @@ flatten$1.flatten = flatten;
1130
1145
  var mapAsync$1 = {};
1131
1146
 
1132
1147
  mapAsync$1.mapAsync = void 0;
1133
- const types_1$b = es2018$1;
1148
+ const types_1$b = es2018$2;
1134
1149
  function mapAsync(iterable, fn) {
1135
1150
  if ((0, types_1$b.isAsyncIterable)(iterable)) {
1136
1151
  return mapAsyncIterable(iterable);
@@ -1170,8 +1185,8 @@ map$1.map = map;
1170
1185
  var repeatAsync$1 = {};
1171
1186
 
1172
1187
  repeatAsync$1.repeatAsync = void 0;
1173
- const go_1$7 = es2018$2;
1174
- const errors_1$7 = es2018$4;
1188
+ const go_1$7 = es2018$3;
1189
+ const errors_1$7 = es2018$5;
1175
1190
  function repeatAsync(iterable, times) {
1176
1191
  (0, errors_1$7.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1177
1192
  (0, errors_1$7.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
@@ -1205,8 +1220,8 @@ function isProduction$1() {
1205
1220
  var repeat$1 = {};
1206
1221
 
1207
1222
  repeat$1.repeat = void 0;
1208
- const go_1$6 = es2018$2;
1209
- const errors_1$6 = es2018$4;
1223
+ const go_1$6 = es2018$3;
1224
+ const errors_1$6 = es2018$5;
1210
1225
  function repeat(iterable, times) {
1211
1226
  (0, errors_1$6.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1212
1227
  (0, errors_1$6.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
@@ -1240,8 +1255,8 @@ function isProduction() {
1240
1255
  var sliceAsync$1 = {};
1241
1256
 
1242
1257
  sliceAsync$1.sliceAsync = void 0;
1243
- const go_1$5 = es2018$2;
1244
- const errors_1$5 = es2018$4;
1258
+ const go_1$5 = es2018$3;
1259
+ const errors_1$5 = es2018$5;
1245
1260
  function sliceAsync(iterable, start, end = Infinity) {
1246
1261
  (0, errors_1$5.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1247
1262
  (0, errors_1$5.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
@@ -1263,8 +1278,8 @@ sliceAsync$1.sliceAsync = sliceAsync;
1263
1278
  var slice$1 = {};
1264
1279
 
1265
1280
  slice$1.slice = void 0;
1266
- const go_1$4 = es2018$2;
1267
- const errors_1$4 = es2018$4;
1281
+ const go_1$4 = es2018$3;
1282
+ const errors_1$4 = es2018$5;
1268
1283
  function slice(iterable, start, end = Infinity) {
1269
1284
  (0, errors_1$4.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1270
1285
  (0, errors_1$4.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
@@ -1304,7 +1319,7 @@ splitAsync$1.splitAsync = splitAsync;
1304
1319
  var splitByAsync$1 = {};
1305
1320
 
1306
1321
  splitByAsync$1.splitByAsync = void 0;
1307
- const types_1$a = es2018$1;
1322
+ const types_1$a = es2018$2;
1308
1323
  function splitByAsync(iterable, predicate) {
1309
1324
  if ((0, types_1$a.isAsyncIterable)(iterable)) {
1310
1325
  return splitByAsyncIterable(iterable);
@@ -1386,8 +1401,8 @@ split$1.split = split;
1386
1401
  var takeAsync$1 = {};
1387
1402
 
1388
1403
  takeAsync$1.takeAsync = void 0;
1389
- const go_1$3 = es2018$2;
1390
- const errors_1$3 = es2018$4;
1404
+ const go_1$3 = es2018$3;
1405
+ const errors_1$3 = es2018$5;
1391
1406
  function takeAsync(iterable, count) {
1392
1407
  (0, errors_1$3.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1393
1408
  (0, errors_1$3.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1407,8 +1422,8 @@ takeAsync$1.takeAsync = takeAsync;
1407
1422
  var takeRightAsync$1 = {};
1408
1423
 
1409
1424
  takeRightAsync$1.takeRightAsync = void 0;
1410
- const go_1$2 = es2018$2;
1411
- const errors_1$2 = es2018$4;
1425
+ const go_1$2 = es2018$3;
1426
+ const errors_1$2 = es2018$5;
1412
1427
  function takeRightAsync(iterable, count) {
1413
1428
  (0, errors_1$2.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1414
1429
  (0, errors_1$2.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1437,8 +1452,8 @@ takeRightAsync$1.takeRightAsync = takeRightAsync;
1437
1452
  var takeRight$1 = {};
1438
1453
 
1439
1454
  takeRight$1.takeRight = void 0;
1440
- const go_1$1 = es2018$2;
1441
- const errors_1$1 = es2018$4;
1455
+ const go_1$1 = es2018$3;
1456
+ const errors_1$1 = es2018$5;
1442
1457
  function takeRight(iterable, count) {
1443
1458
  (0, errors_1$1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1444
1459
  (0, errors_1$1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1467,7 +1482,7 @@ takeRight$1.takeRight = takeRight;
1467
1482
  var takeUntilAsync$1 = {};
1468
1483
 
1469
1484
  takeUntilAsync$1.takeUntilAsync = void 0;
1470
- const types_1$9 = es2018$1;
1485
+ const types_1$9 = es2018$2;
1471
1486
  function takeUntilAsync(iterable, predicate) {
1472
1487
  if ((0, types_1$9.isAsyncIterable)(iterable)) {
1473
1488
  return takeUntilAsyncIterable(iterable);
@@ -1513,8 +1528,8 @@ takeUntil$1.takeUntil = takeUntil;
1513
1528
  var take$1 = {};
1514
1529
 
1515
1530
  take$1.take = void 0;
1516
- const go_1 = es2018$2;
1517
- const errors_1 = es2018$4;
1531
+ const go_1 = es2018$3;
1532
+ const errors_1 = es2018$5;
1518
1533
  function take(iterable, count) {
1519
1534
  (0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1520
1535
  (0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1534,7 +1549,7 @@ take$1.take = take;
1534
1549
  var tapAsync$1 = {};
1535
1550
 
1536
1551
  tapAsync$1.tapAsync = void 0;
1537
- const types_1$8 = es2018$1;
1552
+ const types_1$8 = es2018$2;
1538
1553
  function tapAsync(iterable, fn) {
1539
1554
  if ((0, types_1$8.isAsyncIterable)(iterable)) {
1540
1555
  return tapAsyncIterable(iterable);
@@ -1617,7 +1632,7 @@ uniqAsync$1.uniqAsync = uniqAsync;
1617
1632
  var uniqByAsync$1 = {};
1618
1633
 
1619
1634
  uniqByAsync$1.uniqByAsync = void 0;
1620
- const types_1$7 = es2018$1;
1635
+ const types_1$7 = es2018$2;
1621
1636
  function uniqByAsync(iterable, fn) {
1622
1637
  if ((0, types_1$7.isAsyncIterable)(iterable)) {
1623
1638
  return uniqByAsyncIterable(iterable);
@@ -1686,7 +1701,7 @@ uniq$1.uniq = uniq;
1686
1701
  var zipAsync$1 = {};
1687
1702
 
1688
1703
  zipAsync$1.zipAsync = void 0;
1689
- const types_1$6 = es2018$1;
1704
+ const types_1$6 = es2018$2;
1690
1705
  var Kind;
1691
1706
  (function (Kind) {
1692
1707
  Kind[Kind["Sync"] = 0] = "Sync";
@@ -1846,7 +1861,7 @@ consume$1.consume = consume;
1846
1861
  var eachAsync$1 = {};
1847
1862
 
1848
1863
  eachAsync$1.eachAsync = void 0;
1849
- const types_1$5 = es2018$1;
1864
+ const types_1$5 = es2018$2;
1850
1865
  function eachAsync(iterable, fn) {
1851
1866
  if ((0, types_1$5.isAsyncIterable)(iterable)) {
1852
1867
  return eachAsyncIterable(iterable);
@@ -1886,7 +1901,7 @@ each$1.each = each;
1886
1901
  var everyAsync$1 = {};
1887
1902
 
1888
1903
  everyAsync$1.everyAsync = void 0;
1889
- const types_1$4 = es2018$1;
1904
+ const types_1$4 = es2018$2;
1890
1905
  function everyAsync(iterable, predicate) {
1891
1906
  if ((0, types_1$4.isAsyncIterable)(iterable)) {
1892
1907
  return everyAsyncIterable(iterable);
@@ -1932,7 +1947,7 @@ every$1.every = every;
1932
1947
  var findAsync$1 = {};
1933
1948
 
1934
1949
  findAsync$1.findAsync = void 0;
1935
- const types_1$3 = es2018$1;
1950
+ const types_1$3 = es2018$2;
1936
1951
  function findAsync(iterable, predicate) {
1937
1952
  if ((0, types_1$3.isAsyncIterable)(iterable)) {
1938
1953
  return findAsyncIterable(iterable);
@@ -2056,7 +2071,7 @@ match$1.match = match;
2056
2071
  var reduceAsync$1 = {};
2057
2072
 
2058
2073
  reduceAsync$1.reduceAsync = void 0;
2059
- const types_1$2 = es2018$1;
2074
+ const types_1$2 = es2018$2;
2060
2075
  function reduceAsync(iterable, fn, initialValue) {
2061
2076
  if ((0, types_1$2.isUndefined)(initialValue)) {
2062
2077
  return reduceAsyncWithoutInitialValue(iterable, fn);
@@ -2152,7 +2167,7 @@ function reduceAsyncWithoutInitialValue(iterable, fn) {
2152
2167
  var reduce$1 = {};
2153
2168
 
2154
2169
  reduce$1.reduce = void 0;
2155
- const types_1$1 = es2018$1;
2170
+ const types_1$1 = es2018$2;
2156
2171
  function reduce(iterable, fn, initialValue) {
2157
2172
  if ((0, types_1$1.isUndefined)(initialValue)) {
2158
2173
  return reduceWithoutInitialValue(iterable, fn);
@@ -2199,7 +2214,7 @@ function reduceWithoutInitialValue(iterable, fn) {
2199
2214
  var someAsync$1 = {};
2200
2215
 
2201
2216
  someAsync$1.someAsync = void 0;
2202
- const types_1 = es2018$1;
2217
+ const types_1 = es2018$2;
2203
2218
  function someAsync(iterable, predicate) {
2204
2219
  if ((0, types_1.isAsyncIterable)(iterable)) {
2205
2220
  return someAsyncIterable(iterable);
@@ -2383,15 +2398,15 @@ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m
2383
2398
  };__exportStar(middleware, exports);
2384
2399
  __exportStar(output, exports);
2385
2400
 
2386
- }(es2018$3));
2401
+ }(es2018$4));
2387
2402
 
2388
2403
  var _LRUMap_limit, _LRUMap_map;
2389
2404
  class LRUMap {
2390
2405
  constructor(limit) {
2391
2406
  _LRUMap_limit.set(this, void 0);
2392
2407
  _LRUMap_map.set(this, new Map());
2393
- es2018$4.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2394
- es2018$4.assert(limit > 0, 'The parameter limit must be a positive value');
2408
+ es2018$5.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2409
+ es2018$5.assert(limit > 0, 'The parameter limit must be a positive value');
2395
2410
  __classPrivateFieldSet(this, _LRUMap_limit, limit, "f");
2396
2411
  }
2397
2412
  get [(_LRUMap_limit = new WeakMap(), _LRUMap_map = new WeakMap(), Symbol.toStringTag)]() {
@@ -2439,12 +2454,73 @@ class LRUMap {
2439
2454
  * Return the earliest key inserted in the Map
2440
2455
  */
2441
2456
  getColdestKey() {
2442
- return es2018$3.first(__classPrivateFieldGet(this, _LRUMap_map, "f").keys());
2457
+ return es2018$4.first(__classPrivateFieldGet(this, _LRUMap_map, "f").keys());
2443
2458
  }
2444
2459
  }
2445
2460
 
2461
+ var es2018$1 = {};
2462
+
2463
+ var exponentialBackoff = {};
2464
+
2446
2465
  var es2018 = {};
2447
2466
 
2467
+ var random$1 = {};
2468
+
2469
+ random$1.random = void 0;
2470
+ function random(min, max) {
2471
+ return Math.random() * (max - min) + min;
2472
+ }
2473
+ random$1.random = random;
2474
+
2475
+ var randomInt$1 = {};
2476
+
2477
+ randomInt$1.randomInt = void 0;
2478
+ function randomInt(min, max) {
2479
+ min = Math.ceil(min);
2480
+ max = Math.floor(max);
2481
+ return Math.floor(Math.random() * (max - min)) + min;
2482
+ }
2483
+ randomInt$1.randomInt = randomInt;
2484
+
2485
+ var randomIntInclusive$1 = {};
2486
+
2487
+ randomIntInclusive$1.randomIntInclusive = void 0;
2488
+ function randomIntInclusive(min, max) {
2489
+ min = Math.ceil(min);
2490
+ max = Math.floor(max);
2491
+ return Math.floor(Math.random() * (max - min + 1)) + min;
2492
+ }
2493
+ randomIntInclusive$1.randomIntInclusive = randomIntInclusive;
2494
+
2495
+ (function (exports) {
2496
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2497
+ if (k2 === undefined) k2 = k;
2498
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2499
+ }) : (function(o, m, k, k2) {
2500
+ if (k2 === undefined) k2 = k;
2501
+ o[k2] = m[k];
2502
+ }));
2503
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2504
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2505
+ };__exportStar(random$1, exports);
2506
+ __exportStar(randomInt$1, exports);
2507
+ __exportStar(randomIntInclusive$1, exports);
2508
+
2509
+ }(es2018));
2510
+
2511
+ exponentialBackoff.calculateExponentialBackoffTimeout = void 0;
2512
+ const extra_rand_1 = es2018;
2513
+ function calculateExponentialBackoffTimeout({ baseTimeout, retries, maxTimeout = Infinity, factor = 2, jitter = true }) {
2514
+ const timeout = Math.min(factor ** retries * baseTimeout, maxTimeout);
2515
+ if (jitter) {
2516
+ return (0, extra_rand_1.randomIntInclusive)(0, timeout);
2517
+ }
2518
+ else {
2519
+ return timeout;
2520
+ }
2521
+ }
2522
+ exponentialBackoff.calculateExponentialBackoffTimeout = calculateExponentialBackoffTimeout;
2523
+
2448
2524
  var setTimeout$1 = {};
2449
2525
 
2450
2526
  setTimeout$1.setTimeout = void 0;
@@ -2501,8 +2577,9 @@ function setTimeoutLoop(timeout, cb) {
2501
2577
  };
2502
2578
  async function loop() {
2503
2579
  await cb();
2504
- if (!isCancelled)
2580
+ if (!isCancelled) {
2505
2581
  cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
2582
+ }
2506
2583
  }
2507
2584
  }
2508
2585
  setTimeoutLoop$1.setTimeoutLoop = setTimeoutLoop;
@@ -2522,8 +2599,9 @@ function setDynamicTimeoutLoop(timeout, cb) {
2522
2599
  const start = Date.now();
2523
2600
  await cb();
2524
2601
  const elapsed = Date.now() - start;
2525
- if (!isCancelled)
2602
+ if (!isCancelled) {
2526
2603
  cancel = (0, set_timeout_1.setTimeout)(Math.max(timeout - elapsed, 0), loop);
2604
+ }
2527
2605
  }
2528
2606
  }
2529
2607
  setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = setDynamicTimeoutLoop;
@@ -2538,14 +2616,15 @@ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Obj
2538
2616
  }));
2539
2617
  var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2540
2618
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2541
- };__exportStar(setTimeout$1, exports);
2619
+ };__exportStar(exponentialBackoff, exports);
2620
+ __exportStar(setTimeout$1, exports);
2542
2621
  __exportStar(setSchedule$1, exports);
2543
2622
  __exportStar(setInterval$1, exports);
2544
2623
  __exportStar(setImmediate$1, exports);
2545
2624
  __exportStar(setTimeoutLoop$1, exports);
2546
2625
  __exportStar(setDynamicTimeoutLoop$1, exports);
2547
2626
 
2548
- }(es2018));
2627
+ }(es2018$1));
2549
2628
 
2550
2629
  var _ExpirableMap_map, _ExpirableMap_cancelClearTimeout;
2551
2630
  class ExpirableMap {
@@ -2635,7 +2714,7 @@ class ExpirableMap {
2635
2714
  if (this.itemMetadataSortedByExpirationTime.length > 0) {
2636
2715
  const item = this.itemMetadataSortedByExpirationTime[0];
2637
2716
  if (Number.isFinite(item.expirationTime)) {
2638
- const cancel = es2018.setSchedule(item.expirationTime, () => {
2717
+ const cancel = es2018$1.setSchedule(item.expirationTime, () => {
2639
2718
  this.clearExpiredItems(Date.now());
2640
2719
  this.rescheduleClearTimeout();
2641
2720
  });
@@ -2661,8 +2740,8 @@ class TLRUMap {
2661
2740
  * 按过期时间升序排列所有项目的元数据
2662
2741
  */
2663
2742
  this.itemMetadataSortedByExpirationTime = [];
2664
- es2018$4.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2665
- es2018$4.assert(limit > 0, 'The parameter limit must be a positive value');
2743
+ es2018$5.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2744
+ es2018$5.assert(limit > 0, 'The parameter limit must be a positive value');
2666
2745
  __classPrivateFieldSet(this, _TLRUMap_limit, limit, "f");
2667
2746
  }
2668
2747
  get [(_TLRUMap_limit = new WeakMap(), _TLRUMap_map = new WeakMap(), _TLRUMap_cancelClearTimeout = new WeakMap(), Symbol.toStringTag)]() {
@@ -2766,7 +2845,7 @@ class TLRUMap {
2766
2845
  if (this.itemMetadataSortedByExpirationTime.length > 0) {
2767
2846
  const item = this.itemMetadataSortedByExpirationTime[0];
2768
2847
  if (Number.isFinite(item.expirationTime)) {
2769
- const cancel = es2018.setSchedule(item.expirationTime, () => {
2848
+ const cancel = es2018$1.setSchedule(item.expirationTime, () => {
2770
2849
  this.clearExpiredItems(Date.now());
2771
2850
  this.rescheduleClearTimeout();
2772
2851
  });
@@ -2781,7 +2860,7 @@ class TLRUMap {
2781
2860
  * Return the earliest key inserted in the Map
2782
2861
  */
2783
2862
  getColdestKey() {
2784
- return es2018$3.first(__classPrivateFieldGet(this, _TLRUMap_map, "f").keys());
2863
+ return es2018$4.first(__classPrivateFieldGet(this, _TLRUMap_map, "f").keys());
2785
2864
  }
2786
2865
  }
2787
2866
 
@@ -2849,7 +2928,7 @@ class TrieMap {
2849
2928
  delete node.value;
2850
2929
  // 如果节点没有后缀, 则代表这是末端节点, 往前删除其前缀
2851
2930
  if (node.children.size === 0) {
2852
- for (const [part, parentNode] of es2018$3.toArray(es2018$3.zip(key, parentNodes)).reverse()) {
2931
+ for (const [part, parentNode] of es2018$4.toArray(es2018$4.zip(key, parentNodes)).reverse()) {
2853
2932
  parentNode.children.delete(part);
2854
2933
  if (parentNode.children.size !== 0)
2855
2934
  break;
@@ -2859,5 +2938,5 @@ class TrieMap {
2859
2938
  }
2860
2939
  }
2861
2940
 
2862
- export { Emitter, ExpirableMap, HashMap, HashSet, LRUMap, Queue, TLRUMap, TrieMap, convertArrayToCons, convertConsToArray };
2941
+ export { Box, Emitter, ExpirableMap, HashMap, HashSet, LRUMap, Queue, TLRUMap, TrieMap, convertArrayToCons, convertConsToArray };
2863
2942
  //# sourceMappingURL=index.mjs.map