@byloth/core 1.5.0-rc.7 → 1.5.0
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 +265 -188
- package/dist/core.js.map +1 -1
- package/dist/core.umd.cjs +2 -2
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +13 -14
- package/src/index.ts +24 -9
- package/src/models/aggregators/aggregated-async-iterator.ts +14 -10
- package/src/models/aggregators/aggregator.ts +3 -3
- package/src/models/aggregators/async-aggregator.ts +13 -3
- package/src/models/aggregators/reduced-iterator.ts +2 -1
- package/src/models/aggregators/types.ts +1 -1
- package/src/models/iterators/smart-async-iterator.ts +65 -7
- package/src/models/iterators/smart-iterator.ts +4 -4
- package/src/models/iterators/types.ts +6 -0
- package/src/models/types.ts +14 -2
- package/src/utils/index.ts +1 -1
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var u = (o, e, t) =>
|
|
4
|
-
class
|
|
2
|
+
var b = (o, e, t) => e in o ? S(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var u = (o, e, t) => b(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
class c {
|
|
5
5
|
constructor(e) {
|
|
6
6
|
u(this, "_iterator");
|
|
7
7
|
u(this, "return");
|
|
@@ -32,7 +32,7 @@ class a {
|
|
|
32
32
|
}
|
|
33
33
|
filter(e) {
|
|
34
34
|
const t = this._iterator;
|
|
35
|
-
return new
|
|
35
|
+
return new c(function* () {
|
|
36
36
|
let n = 0;
|
|
37
37
|
for (; ; ) {
|
|
38
38
|
const r = t.next();
|
|
@@ -44,7 +44,7 @@ class a {
|
|
|
44
44
|
}
|
|
45
45
|
map(e) {
|
|
46
46
|
const t = this._iterator;
|
|
47
|
-
return new
|
|
47
|
+
return new c(function* () {
|
|
48
48
|
let n = 0;
|
|
49
49
|
for (; ; ) {
|
|
50
50
|
const r = t.next();
|
|
@@ -74,7 +74,7 @@ class a {
|
|
|
74
74
|
}
|
|
75
75
|
unique() {
|
|
76
76
|
const e = this._iterator;
|
|
77
|
-
return new
|
|
77
|
+
return new c(function* () {
|
|
78
78
|
const t = /* @__PURE__ */ new Set();
|
|
79
79
|
for (; ; ) {
|
|
80
80
|
const n = e.next();
|
|
@@ -119,7 +119,40 @@ class h {
|
|
|
119
119
|
u(this, "_iterator");
|
|
120
120
|
u(this, "return");
|
|
121
121
|
u(this, "throw");
|
|
122
|
-
e instanceof Function
|
|
122
|
+
if (e instanceof Function) {
|
|
123
|
+
const t = e();
|
|
124
|
+
Symbol.asyncIterator in t ? this._iterator = t : this._iterator = async function* () {
|
|
125
|
+
let n = [];
|
|
126
|
+
for (; ; ) {
|
|
127
|
+
const r = t.next(...n);
|
|
128
|
+
if (r.done)
|
|
129
|
+
return r.value;
|
|
130
|
+
n = [yield r.value];
|
|
131
|
+
}
|
|
132
|
+
}();
|
|
133
|
+
} else if (Symbol.asyncIterator in e)
|
|
134
|
+
this._iterator = e[Symbol.asyncIterator]();
|
|
135
|
+
else if (Symbol.iterator in e) {
|
|
136
|
+
const t = e[Symbol.iterator]();
|
|
137
|
+
this._iterator = async function* () {
|
|
138
|
+
for (; ; ) {
|
|
139
|
+
const n = t.next();
|
|
140
|
+
if (n.done)
|
|
141
|
+
return n.value;
|
|
142
|
+
yield n.value;
|
|
143
|
+
}
|
|
144
|
+
}();
|
|
145
|
+
} else
|
|
146
|
+
this._iterator = async function* () {
|
|
147
|
+
let t = [];
|
|
148
|
+
for (; ; ) {
|
|
149
|
+
const n = await e.next(...t);
|
|
150
|
+
if (n.done)
|
|
151
|
+
return n.value;
|
|
152
|
+
t = [yield n.value];
|
|
153
|
+
}
|
|
154
|
+
}();
|
|
155
|
+
this._iterator.return && (this.return = (t) => this._iterator.return(t)), this._iterator.throw && (this.throw = (t) => this._iterator.throw(t));
|
|
123
156
|
}
|
|
124
157
|
async every(e) {
|
|
125
158
|
let t = 0;
|
|
@@ -233,21 +266,122 @@ class h {
|
|
|
233
266
|
return this;
|
|
234
267
|
}
|
|
235
268
|
}
|
|
236
|
-
class
|
|
269
|
+
class f extends Error {
|
|
270
|
+
static FromUnknown(e) {
|
|
271
|
+
if (e instanceof f)
|
|
272
|
+
return e;
|
|
273
|
+
if (e instanceof Error) {
|
|
274
|
+
const t = new f(e.message);
|
|
275
|
+
return t.stack = e.stack, t.name = e.name, t;
|
|
276
|
+
}
|
|
277
|
+
return new f(`${e}`);
|
|
278
|
+
}
|
|
279
|
+
constructor(e, t, n = "Exception") {
|
|
280
|
+
super(e), this.cause = t, this.name = n, t && (t instanceof Error ? this.stack += `
|
|
281
|
+
|
|
282
|
+
Caused by ${t.stack}` : this.stack += `
|
|
283
|
+
|
|
284
|
+
Caused by ${t}`);
|
|
285
|
+
}
|
|
286
|
+
get [Symbol.toStringTag]() {
|
|
287
|
+
return "Exception";
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
class j extends f {
|
|
291
|
+
constructor(e, t, n = "FatalErrorException") {
|
|
292
|
+
e === void 0 && (e = "The routine has encountered an unrecoverable error and cannot continue as expected. Please, refresh the page and try again. If the problem persists, contact the support team."), super(e, t, n);
|
|
293
|
+
}
|
|
294
|
+
get [Symbol.toStringTag]() {
|
|
295
|
+
return "FatalErrorException";
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
class F extends f {
|
|
299
|
+
constructor(e, t, n = "NotImplementedException") {
|
|
300
|
+
e === void 0 && (e = "This feature is not implemented yet. Please, try again later."), super(e, t, n);
|
|
301
|
+
}
|
|
302
|
+
get [Symbol.toStringTag]() {
|
|
303
|
+
return "NotImplementedException";
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
class R extends f {
|
|
307
|
+
constructor(e, t, n = "FileNotFoundException") {
|
|
308
|
+
super(e, t, n);
|
|
309
|
+
}
|
|
310
|
+
get [Symbol.toStringTag]() {
|
|
311
|
+
return "FileNotFoundException";
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
class q extends f {
|
|
315
|
+
constructor(e, t, n = "NetworkException") {
|
|
316
|
+
super(e, t, n);
|
|
317
|
+
}
|
|
318
|
+
get [Symbol.toStringTag]() {
|
|
319
|
+
return "NetworkException";
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
class A extends f {
|
|
323
|
+
constructor(e, t, n = "PermissionException") {
|
|
324
|
+
super(e, t, n);
|
|
325
|
+
}
|
|
326
|
+
get [Symbol.toStringTag]() {
|
|
327
|
+
return "PermissionException";
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
class k extends f {
|
|
331
|
+
constructor(e, t, n = "ReferenceException") {
|
|
332
|
+
super(e, t, n);
|
|
333
|
+
}
|
|
334
|
+
get [Symbol.toStringTag]() {
|
|
335
|
+
return "ReferenceException";
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
class O extends f {
|
|
339
|
+
constructor(e, t, n = "RuntimeException") {
|
|
340
|
+
super(e, t, n);
|
|
341
|
+
}
|
|
342
|
+
get [Symbol.toStringTag]() {
|
|
343
|
+
return "RuntimeException";
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
class T extends f {
|
|
347
|
+
constructor(e, t, n = "TimeoutException") {
|
|
348
|
+
super(e, t, n);
|
|
349
|
+
}
|
|
350
|
+
get [Symbol.toStringTag]() {
|
|
351
|
+
return "TimeoutException";
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
class E extends f {
|
|
355
|
+
constructor(e, t, n = "TypeException") {
|
|
356
|
+
super(e, t, n);
|
|
357
|
+
}
|
|
358
|
+
get [Symbol.toStringTag]() {
|
|
359
|
+
return "TypeException";
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
class m extends f {
|
|
363
|
+
constructor(e, t, n = "ValueException") {
|
|
364
|
+
super(e, t, n);
|
|
365
|
+
}
|
|
366
|
+
get [Symbol.toStringTag]() {
|
|
367
|
+
return "ValueException";
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
class a {
|
|
237
371
|
constructor(e) {
|
|
238
372
|
u(this, "_elements");
|
|
239
|
-
this._elements = new
|
|
373
|
+
this._elements = new c(e);
|
|
240
374
|
}
|
|
241
375
|
filter(e) {
|
|
242
376
|
const t = this._elements;
|
|
243
|
-
return new
|
|
377
|
+
return new a(function* () {
|
|
244
378
|
for (const [n, [r, s]] of t.enumerate())
|
|
245
379
|
e(r, s, n) && (yield [r, s]);
|
|
246
380
|
});
|
|
247
381
|
}
|
|
248
382
|
map(e) {
|
|
249
383
|
const t = this._elements;
|
|
250
|
-
return new
|
|
384
|
+
return new a(function* () {
|
|
251
385
|
for (const [n, [r, s]] of t.enumerate())
|
|
252
386
|
yield [r, e(r, s, n)];
|
|
253
387
|
});
|
|
@@ -259,7 +393,7 @@ class l {
|
|
|
259
393
|
else {
|
|
260
394
|
const s = this._elements.next();
|
|
261
395
|
if (s.done)
|
|
262
|
-
throw new
|
|
396
|
+
throw new E("Reduce of empty iterator with no initial value");
|
|
263
397
|
n += 1, r = s.value[1];
|
|
264
398
|
}
|
|
265
399
|
for (const [s, i] of this._elements)
|
|
@@ -268,7 +402,7 @@ class l {
|
|
|
268
402
|
}
|
|
269
403
|
keys() {
|
|
270
404
|
const e = this._elements;
|
|
271
|
-
return new
|
|
405
|
+
return new c(function* () {
|
|
272
406
|
for (const [t] of e)
|
|
273
407
|
yield t;
|
|
274
408
|
});
|
|
@@ -278,7 +412,7 @@ class l {
|
|
|
278
412
|
}
|
|
279
413
|
values() {
|
|
280
414
|
const e = this._elements;
|
|
281
|
-
return new
|
|
415
|
+
return new c(function* () {
|
|
282
416
|
for (const [t, n] of e)
|
|
283
417
|
yield n;
|
|
284
418
|
});
|
|
@@ -299,7 +433,7 @@ class l {
|
|
|
299
433
|
class d {
|
|
300
434
|
constructor(e) {
|
|
301
435
|
u(this, "_elements");
|
|
302
|
-
this._elements = new
|
|
436
|
+
this._elements = new c(e);
|
|
303
437
|
}
|
|
304
438
|
every(e) {
|
|
305
439
|
const t = /* @__PURE__ */ new Map();
|
|
@@ -307,7 +441,7 @@ class d {
|
|
|
307
441
|
const [s, i] = t.get(n) ?? [0, !0];
|
|
308
442
|
i && t.set(n, [s + 1, e(n, r, s)]);
|
|
309
443
|
}
|
|
310
|
-
return new
|
|
444
|
+
return new a(function* () {
|
|
311
445
|
for (const [n, [r, s]] of t)
|
|
312
446
|
yield [n, s];
|
|
313
447
|
});
|
|
@@ -318,7 +452,7 @@ class d {
|
|
|
318
452
|
const [s, i] = t.get(n) ?? [0, !1];
|
|
319
453
|
i || t.set(n, [s + 1, e(n, r, s)]);
|
|
320
454
|
}
|
|
321
|
-
return new
|
|
455
|
+
return new a(function* () {
|
|
322
456
|
for (const [n, [r, s]] of t)
|
|
323
457
|
yield [n, s];
|
|
324
458
|
});
|
|
@@ -346,18 +480,18 @@ class d {
|
|
|
346
480
|
reduce(e, t) {
|
|
347
481
|
const n = /* @__PURE__ */ new Map();
|
|
348
482
|
for (const [r, s] of this._elements) {
|
|
349
|
-
let i,
|
|
483
|
+
let i, l;
|
|
350
484
|
if (n.has(r))
|
|
351
|
-
[i,
|
|
485
|
+
[i, l] = n.get(r), i += 1;
|
|
352
486
|
else if (t !== void 0)
|
|
353
|
-
i = 0,
|
|
487
|
+
i = 0, l = t(r);
|
|
354
488
|
else {
|
|
355
489
|
n.set(r, [0, s]);
|
|
356
490
|
continue;
|
|
357
491
|
}
|
|
358
|
-
|
|
492
|
+
l = e(r, l, s, i), n.set(r, [i, l]);
|
|
359
493
|
}
|
|
360
|
-
return new
|
|
494
|
+
return new a(function* () {
|
|
361
495
|
for (const [r, [s, i]] of n)
|
|
362
496
|
yield [r, i];
|
|
363
497
|
});
|
|
@@ -378,7 +512,7 @@ class d {
|
|
|
378
512
|
const n = e.get(t) ?? 0;
|
|
379
513
|
e.set(t, n + 1);
|
|
380
514
|
}
|
|
381
|
-
return new
|
|
515
|
+
return new a(function* () {
|
|
382
516
|
for (const [t, n] of e)
|
|
383
517
|
yield [t, n];
|
|
384
518
|
});
|
|
@@ -387,7 +521,7 @@ class d {
|
|
|
387
521
|
const e = /* @__PURE__ */ new Map();
|
|
388
522
|
for (const [t, n] of this._elements)
|
|
389
523
|
e.has(t) || e.set(t, n);
|
|
390
|
-
return new
|
|
524
|
+
return new a(function* () {
|
|
391
525
|
for (const [t, n] of e)
|
|
392
526
|
yield [t, n];
|
|
393
527
|
});
|
|
@@ -396,14 +530,14 @@ class d {
|
|
|
396
530
|
const e = /* @__PURE__ */ new Map();
|
|
397
531
|
for (const [t, n] of this._elements)
|
|
398
532
|
e.set(t, n);
|
|
399
|
-
return new
|
|
533
|
+
return new a(function* () {
|
|
400
534
|
for (const [t, n] of e)
|
|
401
535
|
yield [t, n];
|
|
402
536
|
});
|
|
403
537
|
}
|
|
404
538
|
keys() {
|
|
405
539
|
const e = this._elements;
|
|
406
|
-
return new
|
|
540
|
+
return new c(function* () {
|
|
407
541
|
const t = /* @__PURE__ */ new Set();
|
|
408
542
|
for (const [n] of e)
|
|
409
543
|
t.has(n) || (t.add(n), yield n);
|
|
@@ -414,7 +548,7 @@ class d {
|
|
|
414
548
|
}
|
|
415
549
|
values() {
|
|
416
550
|
const e = this._elements;
|
|
417
|
-
return new
|
|
551
|
+
return new c(function* () {
|
|
418
552
|
for (const [t, n] of e)
|
|
419
553
|
yield n;
|
|
420
554
|
});
|
|
@@ -442,19 +576,19 @@ class d {
|
|
|
442
576
|
return "AggregatedIterator";
|
|
443
577
|
}
|
|
444
578
|
}
|
|
445
|
-
class
|
|
579
|
+
class w {
|
|
446
580
|
constructor(e) {
|
|
447
581
|
u(this, "_elements");
|
|
448
|
-
this._elements = new
|
|
582
|
+
this._elements = new c(e);
|
|
449
583
|
}
|
|
450
584
|
filter(e) {
|
|
451
|
-
return new
|
|
585
|
+
return new w(this._elements.filter(e));
|
|
452
586
|
}
|
|
453
587
|
map(e) {
|
|
454
|
-
return new
|
|
588
|
+
return new w(this._elements.map(e));
|
|
455
589
|
}
|
|
456
590
|
unique() {
|
|
457
|
-
return new
|
|
591
|
+
return new w(this._elements.unique());
|
|
458
592
|
}
|
|
459
593
|
groupBy(e) {
|
|
460
594
|
return new d(this._elements.map((t, n) => [e(t, n), t]));
|
|
@@ -463,7 +597,7 @@ class y {
|
|
|
463
597
|
return "Aggregator";
|
|
464
598
|
}
|
|
465
599
|
}
|
|
466
|
-
class
|
|
600
|
+
class y {
|
|
467
601
|
constructor(e) {
|
|
468
602
|
u(this, "_elements");
|
|
469
603
|
this._elements = new h(e);
|
|
@@ -474,7 +608,7 @@ class w {
|
|
|
474
608
|
const [s, i] = t.get(n) ?? [0, !0];
|
|
475
609
|
i && t.set(n, [s + 1, await e(n, r, s)]);
|
|
476
610
|
}
|
|
477
|
-
return new
|
|
611
|
+
return new a(function* () {
|
|
478
612
|
for (const [n, [r, s]] of t)
|
|
479
613
|
yield [n, s];
|
|
480
614
|
});
|
|
@@ -485,24 +619,24 @@ class w {
|
|
|
485
619
|
const [s, i] = t.get(n) ?? [0, !1];
|
|
486
620
|
i || t.set(n, [s + 1, await e(n, r, s)]);
|
|
487
621
|
}
|
|
488
|
-
return new
|
|
622
|
+
return new a(function* () {
|
|
489
623
|
for (const [n, [r, s]] of t)
|
|
490
624
|
yield [n, s];
|
|
491
625
|
});
|
|
492
626
|
}
|
|
493
627
|
filter(e) {
|
|
494
628
|
const t = this._elements;
|
|
495
|
-
return new
|
|
629
|
+
return new y(async function* () {
|
|
496
630
|
const n = /* @__PURE__ */ new Map();
|
|
497
631
|
for await (const [r, s] of t) {
|
|
498
632
|
const i = n.get(r) ?? 0;
|
|
499
|
-
n.set(r, i + 1), e(r, s, i) && (yield [r, s]);
|
|
633
|
+
n.set(r, i + 1), await e(r, s, i) && (yield [r, s]);
|
|
500
634
|
}
|
|
501
635
|
});
|
|
502
636
|
}
|
|
503
637
|
map(e) {
|
|
504
638
|
const t = this._elements;
|
|
505
|
-
return new
|
|
639
|
+
return new y(async function* () {
|
|
506
640
|
const n = /* @__PURE__ */ new Map();
|
|
507
641
|
for await (const [r, s] of t) {
|
|
508
642
|
const i = n.get(r) ?? 0;
|
|
@@ -513,25 +647,25 @@ class w {
|
|
|
513
647
|
async reduce(e, t) {
|
|
514
648
|
const n = /* @__PURE__ */ new Map();
|
|
515
649
|
for await (const [r, s] of this._elements) {
|
|
516
|
-
let i,
|
|
650
|
+
let i, l;
|
|
517
651
|
if (n.has(r))
|
|
518
|
-
[i,
|
|
652
|
+
[i, l] = n.get(r), i += 1;
|
|
519
653
|
else if (t !== void 0)
|
|
520
|
-
i = 0,
|
|
654
|
+
i = 0, l = await t(r);
|
|
521
655
|
else {
|
|
522
656
|
n.set(r, [0, s]);
|
|
523
657
|
continue;
|
|
524
658
|
}
|
|
525
|
-
|
|
659
|
+
l = await e(r, l, s, i), n.set(r, [i, l]);
|
|
526
660
|
}
|
|
527
|
-
return new
|
|
661
|
+
return new a(function* () {
|
|
528
662
|
for (const [r, [s, i]] of n)
|
|
529
663
|
yield [r, i];
|
|
530
664
|
});
|
|
531
665
|
}
|
|
532
666
|
unique() {
|
|
533
667
|
const e = this._elements;
|
|
534
|
-
return new
|
|
668
|
+
return new y(async function* () {
|
|
535
669
|
const t = /* @__PURE__ */ new Map();
|
|
536
670
|
for await (const [n, r] of e) {
|
|
537
671
|
const s = t.get(n) ?? /* @__PURE__ */ new Set();
|
|
@@ -545,7 +679,7 @@ class w {
|
|
|
545
679
|
const n = e.get(t) ?? 0;
|
|
546
680
|
e.set(t, n + 1);
|
|
547
681
|
}
|
|
548
|
-
return new
|
|
682
|
+
return new a(function* () {
|
|
549
683
|
for (const [t, n] of e)
|
|
550
684
|
yield [t, n];
|
|
551
685
|
});
|
|
@@ -554,7 +688,7 @@ class w {
|
|
|
554
688
|
const e = /* @__PURE__ */ new Map();
|
|
555
689
|
for await (const [t, n] of this._elements)
|
|
556
690
|
e.has(t) || e.set(t, n);
|
|
557
|
-
return new
|
|
691
|
+
return new a(function* () {
|
|
558
692
|
for (const [t, n] of e)
|
|
559
693
|
yield [t, n];
|
|
560
694
|
});
|
|
@@ -563,7 +697,7 @@ class w {
|
|
|
563
697
|
const e = /* @__PURE__ */ new Map();
|
|
564
698
|
for await (const [t, n] of this._elements)
|
|
565
699
|
e.set(t, n);
|
|
566
|
-
return new
|
|
700
|
+
return new a(function* () {
|
|
567
701
|
for (const [t, n] of e)
|
|
568
702
|
yield [t, n];
|
|
569
703
|
});
|
|
@@ -625,90 +759,13 @@ class _ {
|
|
|
625
759
|
return new _(this._elements.unique());
|
|
626
760
|
}
|
|
627
761
|
groupBy(e) {
|
|
628
|
-
return new
|
|
762
|
+
return new y(this._elements.map(async (t, n) => [await e(t, n), t]));
|
|
629
763
|
}
|
|
630
764
|
get [Symbol.toStringTag]() {
|
|
631
765
|
return "AsyncAggregator";
|
|
632
766
|
}
|
|
633
767
|
}
|
|
634
|
-
class
|
|
635
|
-
static FromUnknown(e) {
|
|
636
|
-
if (e instanceof f)
|
|
637
|
-
return e;
|
|
638
|
-
if (e instanceof Error) {
|
|
639
|
-
const t = new f(e.message);
|
|
640
|
-
return t.stack = e.stack, t.name = e.name, t;
|
|
641
|
-
}
|
|
642
|
-
return new f(`${e}`);
|
|
643
|
-
}
|
|
644
|
-
constructor(e, t, n = "Exception") {
|
|
645
|
-
super(e), this.cause = t, this.name = n, t && (t instanceof Error ? this.stack += `
|
|
646
|
-
|
|
647
|
-
Caused by ${t.stack}` : this.stack += `
|
|
648
|
-
|
|
649
|
-
Caused by ${t}`);
|
|
650
|
-
}
|
|
651
|
-
get [Symbol.toStringTag]() {
|
|
652
|
-
return "Exception";
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
class P extends f {
|
|
656
|
-
constructor(e, t, n = "FatalErrorException") {
|
|
657
|
-
e === void 0 && (e = "The routine has encountered an unrecoverable error and cannot continue as expected. Please, refresh the page and try again. If the problem persists, contact the support team."), super(e, t, n);
|
|
658
|
-
}
|
|
659
|
-
get [Symbol.toStringTag]() {
|
|
660
|
-
return "FatalErrorException";
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
class F extends f {
|
|
664
|
-
constructor(e, t, n = "FileNotFoundException") {
|
|
665
|
-
super(e, t, n);
|
|
666
|
-
}
|
|
667
|
-
get [Symbol.toStringTag]() {
|
|
668
|
-
return "FileNotFoundException";
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
class b extends f {
|
|
672
|
-
constructor(e, t, n = "ReferenceException") {
|
|
673
|
-
super(e, t, n);
|
|
674
|
-
}
|
|
675
|
-
get [Symbol.toStringTag]() {
|
|
676
|
-
return "ReferenceException";
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
class I extends f {
|
|
680
|
-
constructor(e, t, n = "RuntimeException") {
|
|
681
|
-
super(e, t, n);
|
|
682
|
-
}
|
|
683
|
-
get [Symbol.toStringTag]() {
|
|
684
|
-
return "RuntimeException";
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
class T extends f {
|
|
688
|
-
constructor(e, t, n = "TimeoutException") {
|
|
689
|
-
super(e, t, n);
|
|
690
|
-
}
|
|
691
|
-
get [Symbol.toStringTag]() {
|
|
692
|
-
return "TimeoutException";
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
class R extends f {
|
|
696
|
-
constructor(e, t, n = "TypeException") {
|
|
697
|
-
super(e, t, n);
|
|
698
|
-
}
|
|
699
|
-
get [Symbol.toStringTag]() {
|
|
700
|
-
return "TypeException";
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
class m extends f {
|
|
704
|
-
constructor(e, t, n = "ValueException") {
|
|
705
|
-
super(e, t, n);
|
|
706
|
-
}
|
|
707
|
-
get [Symbol.toStringTag]() {
|
|
708
|
-
return "ValueException";
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
class q {
|
|
768
|
+
class $ {
|
|
712
769
|
constructor(e = !0) {
|
|
713
770
|
u(this, "_preferPersistence");
|
|
714
771
|
u(this, "_volatile");
|
|
@@ -846,7 +903,7 @@ class q {
|
|
|
846
903
|
return "JsonStorage";
|
|
847
904
|
}
|
|
848
905
|
}
|
|
849
|
-
class
|
|
906
|
+
class C {
|
|
850
907
|
constructor() {
|
|
851
908
|
u(this, "_subscribers");
|
|
852
909
|
this._subscribers = [];
|
|
@@ -857,7 +914,7 @@ class A {
|
|
|
857
914
|
remove(e) {
|
|
858
915
|
const t = this._subscribers.indexOf(e);
|
|
859
916
|
if (t < 0)
|
|
860
|
-
throw new
|
|
917
|
+
throw new k("Unable to remove the requested subscriber. It was not found.");
|
|
861
918
|
this._subscribers.splice(t, 1);
|
|
862
919
|
}
|
|
863
920
|
call(...e) {
|
|
@@ -867,7 +924,7 @@ class A {
|
|
|
867
924
|
return "Subscribers";
|
|
868
925
|
}
|
|
869
926
|
}
|
|
870
|
-
class
|
|
927
|
+
class g {
|
|
871
928
|
constructor(e) {
|
|
872
929
|
u(this, "_isPending");
|
|
873
930
|
u(this, "_isFulfilled");
|
|
@@ -901,11 +958,11 @@ class x {
|
|
|
901
958
|
return "SmartPromise";
|
|
902
959
|
}
|
|
903
960
|
}
|
|
904
|
-
class
|
|
961
|
+
class N extends g {
|
|
905
962
|
constructor(t, n) {
|
|
906
963
|
let r, s;
|
|
907
|
-
super((i,
|
|
908
|
-
r = i, s =
|
|
964
|
+
super((i, l) => {
|
|
965
|
+
r = i, s = l;
|
|
909
966
|
});
|
|
910
967
|
u(this, "_resolve");
|
|
911
968
|
u(this, "_reject");
|
|
@@ -924,14 +981,14 @@ class O extends x {
|
|
|
924
981
|
return "DeferredPromise";
|
|
925
982
|
}
|
|
926
983
|
}
|
|
927
|
-
class
|
|
984
|
+
class Y extends g {
|
|
928
985
|
constructor(e, t) {
|
|
929
986
|
super((n, r) => {
|
|
930
987
|
const s = (p) => {
|
|
931
|
-
clearTimeout(
|
|
988
|
+
clearTimeout(x), n(p);
|
|
932
989
|
}, i = (p) => {
|
|
933
|
-
clearTimeout(
|
|
934
|
-
},
|
|
990
|
+
clearTimeout(x), r(p);
|
|
991
|
+
}, x = setTimeout(() => i(new T("The operation has timed out.")), t);
|
|
935
992
|
e(s, i);
|
|
936
993
|
});
|
|
937
994
|
}
|
|
@@ -961,34 +1018,41 @@ class v {
|
|
|
961
1018
|
constructor() {
|
|
962
1019
|
}
|
|
963
1020
|
}
|
|
964
|
-
async function
|
|
1021
|
+
async function z(o) {
|
|
965
1022
|
return new Promise((e, t) => setTimeout(e, o));
|
|
966
1023
|
}
|
|
967
|
-
async function
|
|
1024
|
+
async function J() {
|
|
968
1025
|
return new Promise((o, e) => requestAnimationFrame(() => o()));
|
|
969
1026
|
}
|
|
970
1027
|
var M = /* @__PURE__ */ ((o) => (o[o.Second = 1e3] = "Second", o[o.Minute = 6e4] = "Minute", o[o.Hour = 36e5] = "Hour", o[o.Day = 864e5] = "Day", o[o.Week = 6048e5] = "Week", o[o.Month = 2592e6] = "Month", o[o.Year = 31536e6] = "Year", o))(M || {});
|
|
971
|
-
function
|
|
1028
|
+
function V(o, e, t = 864e5) {
|
|
972
1029
|
return Math.floor((e.getTime() - o.getTime()) / t);
|
|
973
1030
|
}
|
|
974
|
-
function
|
|
975
|
-
return new
|
|
1031
|
+
function B(o, e, t = 864e5) {
|
|
1032
|
+
return new c(function* () {
|
|
976
1033
|
const n = e.getTime();
|
|
977
1034
|
let r = o.getTime();
|
|
978
1035
|
for (; r < n; )
|
|
979
1036
|
yield new Date(r), r += t;
|
|
980
1037
|
});
|
|
981
1038
|
}
|
|
982
|
-
function
|
|
1039
|
+
function H(o, e = 864e5) {
|
|
983
1040
|
return new Date(Math.floor(o.getTime() / e) * e);
|
|
984
1041
|
}
|
|
985
|
-
function
|
|
1042
|
+
function W(o, e = "text/javascript") {
|
|
986
1043
|
return new Promise((t, n) => {
|
|
987
1044
|
const r = document.createElement("script");
|
|
988
1045
|
r.async = !0, r.defer = !0, r.src = o, r.type = e, r.onload = () => t(), r.onerror = () => n(), document.body.appendChild(r);
|
|
989
1046
|
});
|
|
990
1047
|
}
|
|
991
|
-
function
|
|
1048
|
+
function G(...o) {
|
|
1049
|
+
return new c(function* () {
|
|
1050
|
+
for (const e of o)
|
|
1051
|
+
for (const t of e)
|
|
1052
|
+
yield t;
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
function K(o) {
|
|
992
1056
|
if (Array.isArray(o))
|
|
993
1057
|
return o.length;
|
|
994
1058
|
let e = 0;
|
|
@@ -996,14 +1060,21 @@ function H(o) {
|
|
|
996
1060
|
e += 1;
|
|
997
1061
|
return e;
|
|
998
1062
|
}
|
|
999
|
-
function
|
|
1000
|
-
return new
|
|
1063
|
+
function L(o) {
|
|
1064
|
+
return new c(function* () {
|
|
1065
|
+
let e = 0;
|
|
1066
|
+
for (const t of o)
|
|
1067
|
+
yield [e, t], e += 1;
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
function Q(o, e, t = 1) {
|
|
1071
|
+
return new c(function* () {
|
|
1001
1072
|
e === void 0 && (e = o, o = 0), o > e && (t = t ?? -1);
|
|
1002
1073
|
for (let n = o; n < e; n += t)
|
|
1003
1074
|
yield n;
|
|
1004
1075
|
});
|
|
1005
1076
|
}
|
|
1006
|
-
function
|
|
1077
|
+
function X(o) {
|
|
1007
1078
|
const e = Array.from(o);
|
|
1008
1079
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
1009
1080
|
const n = Math.floor(Math.random() * (t + 1));
|
|
@@ -1011,15 +1082,15 @@ function G(o) {
|
|
|
1011
1082
|
}
|
|
1012
1083
|
return e;
|
|
1013
1084
|
}
|
|
1014
|
-
function
|
|
1015
|
-
return new
|
|
1085
|
+
function Z(o) {
|
|
1086
|
+
return new c(function* () {
|
|
1016
1087
|
const e = /* @__PURE__ */ new Set();
|
|
1017
1088
|
for (const t of o)
|
|
1018
1089
|
e.has(t) || (e.add(t), yield t);
|
|
1019
1090
|
});
|
|
1020
1091
|
}
|
|
1021
|
-
function
|
|
1022
|
-
return new
|
|
1092
|
+
function P(o, e) {
|
|
1093
|
+
return new c(function* () {
|
|
1023
1094
|
const t = o[Symbol.iterator](), n = e[Symbol.iterator]();
|
|
1024
1095
|
for (; ; ) {
|
|
1025
1096
|
const r = t.next(), s = n.next();
|
|
@@ -1029,17 +1100,17 @@ function E(o, e) {
|
|
|
1029
1100
|
}
|
|
1030
1101
|
});
|
|
1031
1102
|
}
|
|
1032
|
-
function
|
|
1103
|
+
function D(o, e) {
|
|
1033
1104
|
if (e === void 0) {
|
|
1034
1105
|
let s = 0, i = 0;
|
|
1035
|
-
for (const
|
|
1036
|
-
s +=
|
|
1106
|
+
for (const l of o)
|
|
1107
|
+
s += l, i += 1;
|
|
1037
1108
|
if (i === 0)
|
|
1038
1109
|
throw new m("You must provide at least one value.");
|
|
1039
1110
|
return s / i;
|
|
1040
1111
|
}
|
|
1041
1112
|
let t = 0, n = 0, r = 0;
|
|
1042
|
-
for (const [s, i] of
|
|
1113
|
+
for (const [s, i] of P(o, e)) {
|
|
1043
1114
|
if (i <= 0)
|
|
1044
1115
|
throw new m(`The weight for the value #${r} must be greater than zero.`);
|
|
1045
1116
|
t += s * i, n += i, r += 1;
|
|
@@ -1050,7 +1121,7 @@ function L(o, e) {
|
|
|
1050
1121
|
throw new m("The sum of weights must be greater than zero.");
|
|
1051
1122
|
return t / n;
|
|
1052
1123
|
}
|
|
1053
|
-
function
|
|
1124
|
+
function U(o) {
|
|
1054
1125
|
let e = 0;
|
|
1055
1126
|
for (let t = 0; t < o.length; t += 1) {
|
|
1056
1127
|
const n = o.charCodeAt(t);
|
|
@@ -1058,53 +1129,59 @@ function N(o) {
|
|
|
1058
1129
|
}
|
|
1059
1130
|
return e;
|
|
1060
1131
|
}
|
|
1061
|
-
function
|
|
1132
|
+
function ee(o) {
|
|
1062
1133
|
let e = 0;
|
|
1063
1134
|
for (const t of o)
|
|
1064
1135
|
e += t;
|
|
1065
1136
|
return e;
|
|
1066
1137
|
}
|
|
1067
|
-
function
|
|
1138
|
+
function te(o) {
|
|
1068
1139
|
return `${o.charAt(0).toUpperCase()}${o.slice(1)}`;
|
|
1069
1140
|
}
|
|
1070
|
-
const
|
|
1141
|
+
const ne = "1.5.0";
|
|
1071
1142
|
export {
|
|
1072
|
-
|
|
1143
|
+
y as AggregatedAsyncIterator,
|
|
1073
1144
|
d as AggregatedIterator,
|
|
1074
|
-
|
|
1145
|
+
w as Aggregator,
|
|
1075
1146
|
_ as AsyncAggregator,
|
|
1076
1147
|
M as DateUnit,
|
|
1077
|
-
|
|
1148
|
+
N as DeferredPromise,
|
|
1078
1149
|
f as Exception,
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1150
|
+
j as FatalErrorException,
|
|
1151
|
+
R as FileNotFoundException,
|
|
1152
|
+
$ as JsonStorage,
|
|
1153
|
+
q as NetworkException,
|
|
1154
|
+
F as NotImplementedException,
|
|
1155
|
+
A as PermissionException,
|
|
1082
1156
|
v as Random,
|
|
1083
|
-
|
|
1084
|
-
|
|
1157
|
+
a as ReducedIterator,
|
|
1158
|
+
k as ReferenceException,
|
|
1159
|
+
O as RuntimeException,
|
|
1085
1160
|
h as SmartAsyncIterator,
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1161
|
+
c as SmartIterator,
|
|
1162
|
+
g as SmartPromise,
|
|
1163
|
+
C as Subscribers,
|
|
1164
|
+
Y as TimedPromise,
|
|
1090
1165
|
T as TimeoutException,
|
|
1091
|
-
|
|
1092
|
-
|
|
1166
|
+
E as TypeException,
|
|
1167
|
+
ne as VERSION,
|
|
1093
1168
|
m as ValueException,
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
W as
|
|
1105
|
-
|
|
1106
|
-
Q as
|
|
1107
|
-
|
|
1108
|
-
|
|
1169
|
+
D as average,
|
|
1170
|
+
te as capitalize,
|
|
1171
|
+
G as chain,
|
|
1172
|
+
K as count,
|
|
1173
|
+
V as dateDifference,
|
|
1174
|
+
B as dateRange,
|
|
1175
|
+
H as dateRound,
|
|
1176
|
+
z as delay,
|
|
1177
|
+
L as enumerate,
|
|
1178
|
+
U as hash,
|
|
1179
|
+
W as loadScript,
|
|
1180
|
+
J as nextAnimationFrame,
|
|
1181
|
+
Q as range,
|
|
1182
|
+
X as shuffle,
|
|
1183
|
+
ee as sum,
|
|
1184
|
+
Z as unique,
|
|
1185
|
+
P as zip
|
|
1109
1186
|
};
|
|
1110
1187
|
//# sourceMappingURL=core.js.map
|