@byloth/core 2.0.0-rc.5 → 2.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -135,7 +135,7 @@ class Ie extends (le = d, ue = Symbol.toStringTag, le) {
135
135
  }
136
136
  }
137
137
  var ce;
138
- class l {
138
+ class u {
139
139
  constructor(t) {
140
140
  a(this, "_iterator");
141
141
  a(this, "return");
@@ -167,7 +167,7 @@ class l {
167
167
  }
168
168
  filter(t) {
169
169
  const e = this._iterator;
170
- return new l(function* () {
170
+ return new u(function* () {
171
171
  let n = 0;
172
172
  for (; ; ) {
173
173
  const r = e.next();
@@ -179,7 +179,7 @@ class l {
179
179
  }
180
180
  map(t) {
181
181
  const e = this._iterator;
182
- return new l(function* () {
182
+ return new u(function* () {
183
183
  let n = 0;
184
184
  for (; ; ) {
185
185
  const r = e.next();
@@ -206,7 +206,7 @@ class l {
206
206
  }
207
207
  flatMap(t) {
208
208
  const e = this._iterator;
209
- return new l(function* () {
209
+ return new u(function* () {
210
210
  let n = 0;
211
211
  for (; ; ) {
212
212
  const r = e.next();
@@ -221,7 +221,7 @@ class l {
221
221
  }
222
222
  drop(t) {
223
223
  const e = this._iterator;
224
- return new l(function* () {
224
+ return new u(function* () {
225
225
  let n = 0;
226
226
  for (; n < t; ) {
227
227
  if (e.next().done)
@@ -238,7 +238,7 @@ class l {
238
238
  }
239
239
  take(t) {
240
240
  const e = this._iterator;
241
- return new l(function* () {
241
+ return new u(function* () {
242
242
  let n = 0;
243
243
  for (; n < t; ) {
244
244
  const r = e.next();
@@ -264,7 +264,7 @@ class l {
264
264
  }
265
265
  unique() {
266
266
  const t = this._iterator;
267
- return new l(function* () {
267
+ return new u(function* () {
268
268
  const e = /* @__PURE__ */ new Set();
269
269
  for (; ; ) {
270
270
  const n = t.next();
@@ -310,7 +310,7 @@ const _ = class _ {
310
310
  constructor(t) {
311
311
  a(this, "_elements");
312
312
  a(this, fe, "ReducedIterator");
313
- this._elements = new l(t);
313
+ this._elements = new u(t);
314
314
  }
315
315
  every(t) {
316
316
  for (const [e, [n, r]] of this._elements.enumerate())
@@ -398,7 +398,7 @@ const _ = class _ {
398
398
  }
399
399
  keys() {
400
400
  const t = this._elements;
401
- return new l(function* () {
401
+ return new u(function* () {
402
402
  for (const [e] of t)
403
403
  yield e;
404
404
  });
@@ -408,7 +408,7 @@ const _ = class _ {
408
408
  }
409
409
  values() {
410
410
  const t = this._elements;
411
- return new l(function* () {
411
+ return new u(function* () {
412
412
  for (const [e, n] of t)
413
413
  yield n;
414
414
  });
@@ -477,16 +477,16 @@ const m = class m {
477
477
  async reduce(t, e) {
478
478
  const n = /* @__PURE__ */ new Map();
479
479
  for await (const [r, s] of this._elements) {
480
- let o, u;
480
+ let o, l;
481
481
  if (n.has(r))
482
- [o, u] = n.get(r);
482
+ [o, l] = n.get(r);
483
483
  else if (e !== void 0)
484
- o = 0, u = await e(r);
484
+ o = 0, l = await e(r);
485
485
  else {
486
486
  n.set(r, [0, s]);
487
487
  continue;
488
488
  }
489
- n.set(r, [o + 1, await t(r, u, s, o)]);
489
+ n.set(r, [o + 1, await t(r, l, s, o)]);
490
490
  }
491
491
  return new f(function* () {
492
492
  for (const [r, [s, o]] of n)
@@ -498,8 +498,8 @@ const m = class m {
498
498
  return new m(async function* () {
499
499
  const n = /* @__PURE__ */ new Map();
500
500
  for await (const [r, s] of e) {
501
- const o = n.get(r) ?? 0, u = await t(r, s, o);
502
- for await (const x of u)
501
+ const o = n.get(r) ?? 0, l = await t(r, s, o);
502
+ for await (const x of l)
503
503
  yield [r, x];
504
504
  n.set(r, o + 1);
505
505
  }
@@ -525,12 +525,7 @@ const m = class m {
525
525
  const n = /* @__PURE__ */ new Map();
526
526
  for await (const [r, s] of e) {
527
527
  const o = n.get(r) ?? 0;
528
- if (o >= t) {
529
- if (n.values().every((u) => u >= t))
530
- break;
531
- continue;
532
- }
533
- yield [r, s], n.set(r, o + 1);
528
+ o >= t || (yield [r, s], n.set(r, o + 1));
534
529
  }
535
530
  });
536
531
  }
@@ -822,7 +817,7 @@ const w = class w {
822
817
  constructor(t) {
823
818
  a(this, "_elements");
824
819
  a(this, me, "AggregatedIterator");
825
- this._elements = new l(t);
820
+ this._elements = new u(t);
826
821
  }
827
822
  every(t) {
828
823
  const e = /* @__PURE__ */ new Map();
@@ -869,16 +864,16 @@ const w = class w {
869
864
  reduce(t, e) {
870
865
  const n = /* @__PURE__ */ new Map();
871
866
  for (const [r, s] of this._elements) {
872
- let o, u;
867
+ let o, l;
873
868
  if (n.has(r))
874
- [o, u] = n.get(r);
869
+ [o, l] = n.get(r);
875
870
  else if (e !== void 0)
876
- o = 0, u = e(r);
871
+ o = 0, l = e(r);
877
872
  else {
878
873
  n.set(r, [0, s]);
879
874
  continue;
880
875
  }
881
- n.set(r, [o + 1, t(r, u, s, o)]);
876
+ n.set(r, [o + 1, t(r, l, s, o)]);
882
877
  }
883
878
  return new f(function* () {
884
879
  for (const [r, [s, o]] of n)
@@ -890,8 +885,8 @@ const w = class w {
890
885
  return new w(function* () {
891
886
  const n = /* @__PURE__ */ new Map();
892
887
  for (const [r, s] of e) {
893
- const o = n.get(r) ?? 0, u = t(r, s, o);
894
- for (const x of u)
888
+ const o = n.get(r) ?? 0, l = t(r, s, o);
889
+ for (const x of l)
895
890
  yield [r, x];
896
891
  n.set(r, o + 1);
897
892
  }
@@ -917,12 +912,7 @@ const w = class w {
917
912
  const n = /* @__PURE__ */ new Map();
918
913
  for (const [r, s] of e) {
919
914
  const o = n.get(r) ?? 0;
920
- if (o >= t) {
921
- if (n.values().every((u) => u >= t))
922
- break;
923
- continue;
924
- }
925
- yield [r, s], n.set(r, o + 1);
915
+ o >= t || (yield [r, s], n.set(r, o + 1));
926
916
  }
927
917
  });
928
918
  }
@@ -970,7 +960,7 @@ const w = class w {
970
960
  }
971
961
  keys() {
972
962
  const t = this._elements;
973
- return new l(function* () {
963
+ return new u(function* () {
974
964
  const e = /* @__PURE__ */ new Set();
975
965
  for (const [n] of t)
976
966
  e.has(n) || (e.add(n), yield n);
@@ -981,7 +971,7 @@ const w = class w {
981
971
  }
982
972
  values() {
983
973
  const t = this._elements;
984
- return new l(function* () {
974
+ return new u(function* () {
985
975
  for (const [e, n] of t)
986
976
  yield n;
987
977
  });
@@ -1232,8 +1222,8 @@ var pe, xe;
1232
1222
  class Ne extends (xe = b, pe = Symbol.toStringTag, xe) {
1233
1223
  constructor(e, n) {
1234
1224
  let r, s;
1235
- super((o, u) => {
1236
- r = o, s = u;
1225
+ super((o, l) => {
1226
+ r = o, s = l;
1237
1227
  });
1238
1228
  a(this, "_resolve");
1239
1229
  a(this, "_reject");
@@ -1310,10 +1300,10 @@ class Ze extends (be = b, ve = Symbol.toStringTag, be) {
1310
1300
  super((r, s) => {
1311
1301
  const o = (k) => {
1312
1302
  clearTimeout(F), r(k);
1313
- }, u = (k) => {
1303
+ }, l = (k) => {
1314
1304
  clearTimeout(F), s(k);
1315
- }, F = setTimeout(() => u(new qe("The operation has timed out.")), n);
1316
- e(o, u);
1305
+ }, F = setTimeout(() => l(new qe("The operation has timed out.")), n);
1306
+ e(o, l);
1317
1307
  });
1318
1308
  a(this, ve, "TimedPromise");
1319
1309
  }
@@ -1343,7 +1333,7 @@ function Ue(i, t, e = 864e5) {
1343
1333
  return i = new Date(i), t = new Date(t), Math.floor((t.getTime() - i.getTime()) / e);
1344
1334
  }
1345
1335
  function et(i, t, e = 864e5) {
1346
- return i = new Date(i), t = new Date(t), new l(function* () {
1336
+ return i = new Date(i), t = new Date(t), new u(function* () {
1347
1337
  const n = t.getTime();
1348
1338
  let r = i.getTime();
1349
1339
  for (; r < n; )
@@ -1487,7 +1477,7 @@ function ot(i, t = "text/javascript") {
1487
1477
  });
1488
1478
  }
1489
1479
  function at(...i) {
1490
- return new l(function* () {
1480
+ return new u(function* () {
1491
1481
  for (const t of i)
1492
1482
  for (const e of t)
1493
1483
  yield e;
@@ -1502,14 +1492,14 @@ function ut(i) {
1502
1492
  return t;
1503
1493
  }
1504
1494
  function lt(i) {
1505
- return new l(function* () {
1495
+ return new u(function* () {
1506
1496
  let t = 0;
1507
1497
  for (const e of i)
1508
1498
  yield [t, e], t += 1;
1509
1499
  });
1510
1500
  }
1511
1501
  function ct(i, t, e = 1) {
1512
- return new l(function* () {
1502
+ return new u(function* () {
1513
1503
  t === void 0 && (t = i, i = 0), i > t && (e = e ?? -1);
1514
1504
  for (let n = i; n < t; n += e)
1515
1505
  yield n;
@@ -1524,14 +1514,14 @@ function ft(i) {
1524
1514
  return t;
1525
1515
  }
1526
1516
  function ht(i) {
1527
- return new l(function* () {
1517
+ return new u(function* () {
1528
1518
  const t = /* @__PURE__ */ new Set();
1529
1519
  for (const e of i)
1530
1520
  t.has(e) || (t.add(e), yield e);
1531
1521
  });
1532
1522
  }
1533
1523
  function $e(i, t) {
1534
- return new l(function* () {
1524
+ return new u(function* () {
1535
1525
  const e = i[Symbol.iterator](), n = t[Symbol.iterator]();
1536
1526
  for (; ; ) {
1537
1527
  const r = e.next(), s = n.next();
@@ -1544,8 +1534,8 @@ function $e(i, t) {
1544
1534
  function dt(i, t) {
1545
1535
  if (t === void 0) {
1546
1536
  let s = 0, o = 0;
1547
- for (const u of i)
1548
- s += u, o += 1;
1537
+ for (const l of i)
1538
+ s += l, o += 1;
1549
1539
  if (o === 0)
1550
1540
  throw new d("You must provide at least one value.");
1551
1541
  return s / o;
@@ -1579,7 +1569,7 @@ function wt(i) {
1579
1569
  function _t(i) {
1580
1570
  return `${i.charAt(0).toUpperCase()}${i.slice(1)}`;
1581
1571
  }
1582
- const yt = "2.0.0-rc.5";
1572
+ const yt = "2.0.0-rc.6";
1583
1573
  export {
1584
1574
  S as AggregatedAsyncIterator,
1585
1575
  v as AggregatedIterator,
@@ -1604,7 +1594,7 @@ export {
1604
1594
  Ce as ReferenceException,
1605
1595
  p as RuntimeException,
1606
1596
  h as SmartAsyncIterator,
1607
- l as SmartIterator,
1597
+ u as SmartIterator,
1608
1598
  b as SmartPromise,
1609
1599
  Xe as Thenable,
1610
1600
  E as TimeUnit,