@byloth/core 1.5.1 → 1.5.3
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 +149 -140
- 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 +6 -5
- package/src/index.ts +2 -1
- package/src/models/exceptions/index.ts +9 -0
- package/src/models/index.ts +1 -0
- package/src/utils/date.ts +11 -3
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
|
-
var b = (
|
|
3
|
-
var u = (
|
|
2
|
+
var b = (s, e, t) => e in s ? S(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var u = (s, e, t) => b(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
class c {
|
|
5
5
|
constructor(e) {
|
|
6
6
|
u(this, "_iterator");
|
|
@@ -57,16 +57,16 @@ class c {
|
|
|
57
57
|
reduce(e, t) {
|
|
58
58
|
let n = 0, r = t;
|
|
59
59
|
if (r === void 0) {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
60
|
+
const o = this._iterator.next();
|
|
61
|
+
if (o.done)
|
|
62
62
|
throw new TypeError("Reduce of empty iterator with no initial value");
|
|
63
|
-
r =
|
|
63
|
+
r = o.value, n += 1;
|
|
64
64
|
}
|
|
65
65
|
for (; ; ) {
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
66
|
+
const o = this._iterator.next();
|
|
67
|
+
if (o.done)
|
|
68
68
|
return r;
|
|
69
|
-
r = e(r,
|
|
69
|
+
r = e(r, o.value, n), n += 1;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
enumerate() {
|
|
@@ -203,16 +203,16 @@ class h {
|
|
|
203
203
|
async reduce(e, t) {
|
|
204
204
|
let n = 0, r = t;
|
|
205
205
|
if (r === void 0) {
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
206
|
+
const o = await this._iterator.next();
|
|
207
|
+
if (o.done)
|
|
208
208
|
throw new TypeError("Reduce of empty iterator with no initial value");
|
|
209
|
-
r =
|
|
209
|
+
r = o.value, n += 1;
|
|
210
210
|
}
|
|
211
211
|
for (; ; ) {
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
212
|
+
const o = await this._iterator.next();
|
|
213
|
+
if (o.done)
|
|
214
214
|
return r;
|
|
215
|
-
r = await e(r,
|
|
215
|
+
r = await e(r, o.value, n), n += 1;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
enumerate() {
|
|
@@ -312,6 +312,14 @@ class R extends f {
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
class q extends f {
|
|
315
|
+
constructor(e, t, n = "KeyException") {
|
|
316
|
+
super(e, t, n);
|
|
317
|
+
}
|
|
318
|
+
get [Symbol.toStringTag]() {
|
|
319
|
+
return "KeyException";
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
class A extends f {
|
|
315
323
|
constructor(e, t, n = "NetworkException") {
|
|
316
324
|
super(e, t, n);
|
|
317
325
|
}
|
|
@@ -319,7 +327,7 @@ class q extends f {
|
|
|
319
327
|
return "NetworkException";
|
|
320
328
|
}
|
|
321
329
|
}
|
|
322
|
-
class
|
|
330
|
+
class O extends f {
|
|
323
331
|
constructor(e, t, n = "PermissionException") {
|
|
324
332
|
super(e, t, n);
|
|
325
333
|
}
|
|
@@ -335,7 +343,7 @@ class k extends f {
|
|
|
335
343
|
return "ReferenceException";
|
|
336
344
|
}
|
|
337
345
|
}
|
|
338
|
-
class
|
|
346
|
+
class $ extends f {
|
|
339
347
|
constructor(e, t, n = "RuntimeException") {
|
|
340
348
|
super(e, t, n);
|
|
341
349
|
}
|
|
@@ -375,15 +383,15 @@ class a {
|
|
|
375
383
|
filter(e) {
|
|
376
384
|
const t = this._elements;
|
|
377
385
|
return new a(function* () {
|
|
378
|
-
for (const [n, [r,
|
|
379
|
-
e(r,
|
|
386
|
+
for (const [n, [r, o]] of t.enumerate())
|
|
387
|
+
e(r, o, n) && (yield [r, o]);
|
|
380
388
|
});
|
|
381
389
|
}
|
|
382
390
|
map(e) {
|
|
383
391
|
const t = this._elements;
|
|
384
392
|
return new a(function* () {
|
|
385
|
-
for (const [n, [r,
|
|
386
|
-
yield [r, e(r,
|
|
393
|
+
for (const [n, [r, o]] of t.enumerate())
|
|
394
|
+
yield [r, e(r, o, n)];
|
|
387
395
|
});
|
|
388
396
|
}
|
|
389
397
|
reduce(e, t) {
|
|
@@ -391,13 +399,13 @@ class a {
|
|
|
391
399
|
if (t !== void 0)
|
|
392
400
|
r = t;
|
|
393
401
|
else {
|
|
394
|
-
const
|
|
395
|
-
if (
|
|
402
|
+
const o = this._elements.next();
|
|
403
|
+
if (o.done)
|
|
396
404
|
throw new E("Reduce of empty iterator with no initial value");
|
|
397
|
-
n += 1, r =
|
|
405
|
+
n += 1, r = o.value[1];
|
|
398
406
|
}
|
|
399
|
-
for (const [
|
|
400
|
-
r = e(
|
|
407
|
+
for (const [o, i] of this._elements)
|
|
408
|
+
r = e(o, r, i, n), n += 1;
|
|
401
409
|
return r;
|
|
402
410
|
}
|
|
403
411
|
keys() {
|
|
@@ -438,32 +446,32 @@ class d {
|
|
|
438
446
|
every(e) {
|
|
439
447
|
const t = /* @__PURE__ */ new Map();
|
|
440
448
|
for (const [n, r] of this._elements) {
|
|
441
|
-
const [
|
|
442
|
-
i && t.set(n, [
|
|
449
|
+
const [o, i] = t.get(n) ?? [0, !0];
|
|
450
|
+
i && t.set(n, [o + 1, e(n, r, o)]);
|
|
443
451
|
}
|
|
444
452
|
return new a(function* () {
|
|
445
|
-
for (const [n, [r,
|
|
446
|
-
yield [n,
|
|
453
|
+
for (const [n, [r, o]] of t)
|
|
454
|
+
yield [n, o];
|
|
447
455
|
});
|
|
448
456
|
}
|
|
449
457
|
some(e) {
|
|
450
458
|
const t = /* @__PURE__ */ new Map();
|
|
451
459
|
for (const [n, r] of this._elements) {
|
|
452
|
-
const [
|
|
453
|
-
i || t.set(n, [
|
|
460
|
+
const [o, i] = t.get(n) ?? [0, !1];
|
|
461
|
+
i || t.set(n, [o + 1, e(n, r, o)]);
|
|
454
462
|
}
|
|
455
463
|
return new a(function* () {
|
|
456
|
-
for (const [n, [r,
|
|
457
|
-
yield [n,
|
|
464
|
+
for (const [n, [r, o]] of t)
|
|
465
|
+
yield [n, o];
|
|
458
466
|
});
|
|
459
467
|
}
|
|
460
468
|
filter(e) {
|
|
461
469
|
const t = this._elements;
|
|
462
470
|
return new d(function* () {
|
|
463
471
|
const n = /* @__PURE__ */ new Map();
|
|
464
|
-
for (const [r,
|
|
472
|
+
for (const [r, o] of t) {
|
|
465
473
|
const i = n.get(r) ?? 0;
|
|
466
|
-
n.set(r, i + 1), e(r,
|
|
474
|
+
n.set(r, i + 1), e(r, o, i) && (yield [r, o]);
|
|
467
475
|
}
|
|
468
476
|
});
|
|
469
477
|
}
|
|
@@ -471,28 +479,28 @@ class d {
|
|
|
471
479
|
const t = this._elements;
|
|
472
480
|
return new d(function* () {
|
|
473
481
|
const n = /* @__PURE__ */ new Map();
|
|
474
|
-
for (const [r,
|
|
482
|
+
for (const [r, o] of t) {
|
|
475
483
|
const i = n.get(r) ?? 0;
|
|
476
|
-
n.set(r, i + 1), yield [r, e(r,
|
|
484
|
+
n.set(r, i + 1), yield [r, e(r, o, i)];
|
|
477
485
|
}
|
|
478
486
|
});
|
|
479
487
|
}
|
|
480
488
|
reduce(e, t) {
|
|
481
489
|
const n = /* @__PURE__ */ new Map();
|
|
482
|
-
for (const [r,
|
|
490
|
+
for (const [r, o] of this._elements) {
|
|
483
491
|
let i, l;
|
|
484
492
|
if (n.has(r))
|
|
485
493
|
[i, l] = n.get(r), i += 1;
|
|
486
494
|
else if (t !== void 0)
|
|
487
495
|
i = 0, l = t(r);
|
|
488
496
|
else {
|
|
489
|
-
n.set(r, [0,
|
|
497
|
+
n.set(r, [0, o]);
|
|
490
498
|
continue;
|
|
491
499
|
}
|
|
492
|
-
l = e(r, l,
|
|
500
|
+
l = e(r, l, o, i), n.set(r, [i, l]);
|
|
493
501
|
}
|
|
494
502
|
return new a(function* () {
|
|
495
|
-
for (const [r, [
|
|
503
|
+
for (const [r, [o, i]] of n)
|
|
496
504
|
yield [r, i];
|
|
497
505
|
});
|
|
498
506
|
}
|
|
@@ -501,8 +509,8 @@ class d {
|
|
|
501
509
|
return new d(function* () {
|
|
502
510
|
const t = /* @__PURE__ */ new Map();
|
|
503
511
|
for (const [n, r] of e) {
|
|
504
|
-
const
|
|
505
|
-
|
|
512
|
+
const o = t.get(n) ?? /* @__PURE__ */ new Set();
|
|
513
|
+
o.has(r) || (o.add(r), t.set(n, o), yield [n, r]);
|
|
506
514
|
}
|
|
507
515
|
});
|
|
508
516
|
}
|
|
@@ -605,32 +613,32 @@ class y {
|
|
|
605
613
|
async every(e) {
|
|
606
614
|
const t = /* @__PURE__ */ new Map();
|
|
607
615
|
for await (const [n, r] of this._elements) {
|
|
608
|
-
const [
|
|
609
|
-
i && t.set(n, [
|
|
616
|
+
const [o, i] = t.get(n) ?? [0, !0];
|
|
617
|
+
i && t.set(n, [o + 1, await e(n, r, o)]);
|
|
610
618
|
}
|
|
611
619
|
return new a(function* () {
|
|
612
|
-
for (const [n, [r,
|
|
613
|
-
yield [n,
|
|
620
|
+
for (const [n, [r, o]] of t)
|
|
621
|
+
yield [n, o];
|
|
614
622
|
});
|
|
615
623
|
}
|
|
616
624
|
async some(e) {
|
|
617
625
|
const t = /* @__PURE__ */ new Map();
|
|
618
626
|
for await (const [n, r] of this._elements) {
|
|
619
|
-
const [
|
|
620
|
-
i || t.set(n, [
|
|
627
|
+
const [o, i] = t.get(n) ?? [0, !1];
|
|
628
|
+
i || t.set(n, [o + 1, await e(n, r, o)]);
|
|
621
629
|
}
|
|
622
630
|
return new a(function* () {
|
|
623
|
-
for (const [n, [r,
|
|
624
|
-
yield [n,
|
|
631
|
+
for (const [n, [r, o]] of t)
|
|
632
|
+
yield [n, o];
|
|
625
633
|
});
|
|
626
634
|
}
|
|
627
635
|
filter(e) {
|
|
628
636
|
const t = this._elements;
|
|
629
637
|
return new y(async function* () {
|
|
630
638
|
const n = /* @__PURE__ */ new Map();
|
|
631
|
-
for await (const [r,
|
|
639
|
+
for await (const [r, o] of t) {
|
|
632
640
|
const i = n.get(r) ?? 0;
|
|
633
|
-
n.set(r, i + 1), await e(r,
|
|
641
|
+
n.set(r, i + 1), await e(r, o, i) && (yield [r, o]);
|
|
634
642
|
}
|
|
635
643
|
});
|
|
636
644
|
}
|
|
@@ -638,28 +646,28 @@ class y {
|
|
|
638
646
|
const t = this._elements;
|
|
639
647
|
return new y(async function* () {
|
|
640
648
|
const n = /* @__PURE__ */ new Map();
|
|
641
|
-
for await (const [r,
|
|
649
|
+
for await (const [r, o] of t) {
|
|
642
650
|
const i = n.get(r) ?? 0;
|
|
643
|
-
n.set(r, i + 1), yield [r, await e(r,
|
|
651
|
+
n.set(r, i + 1), yield [r, await e(r, o, i)];
|
|
644
652
|
}
|
|
645
653
|
});
|
|
646
654
|
}
|
|
647
655
|
async reduce(e, t) {
|
|
648
656
|
const n = /* @__PURE__ */ new Map();
|
|
649
|
-
for await (const [r,
|
|
657
|
+
for await (const [r, o] of this._elements) {
|
|
650
658
|
let i, l;
|
|
651
659
|
if (n.has(r))
|
|
652
660
|
[i, l] = n.get(r), i += 1;
|
|
653
661
|
else if (t !== void 0)
|
|
654
662
|
i = 0, l = await t(r);
|
|
655
663
|
else {
|
|
656
|
-
n.set(r, [0,
|
|
664
|
+
n.set(r, [0, o]);
|
|
657
665
|
continue;
|
|
658
666
|
}
|
|
659
|
-
l = await e(r, l,
|
|
667
|
+
l = await e(r, l, o, i), n.set(r, [i, l]);
|
|
660
668
|
}
|
|
661
669
|
return new a(function* () {
|
|
662
|
-
for (const [r, [
|
|
670
|
+
for (const [r, [o, i]] of n)
|
|
663
671
|
yield [r, i];
|
|
664
672
|
});
|
|
665
673
|
}
|
|
@@ -668,8 +676,8 @@ class y {
|
|
|
668
676
|
return new y(async function* () {
|
|
669
677
|
const t = /* @__PURE__ */ new Map();
|
|
670
678
|
for await (const [n, r] of e) {
|
|
671
|
-
const
|
|
672
|
-
|
|
679
|
+
const o = t.get(n) ?? /* @__PURE__ */ new Set();
|
|
680
|
+
o.has(r) || (o.add(r), t.set(n, o), yield [n, r]);
|
|
673
681
|
}
|
|
674
682
|
});
|
|
675
683
|
}
|
|
@@ -765,7 +773,7 @@ class _ {
|
|
|
765
773
|
return "AsyncAggregator";
|
|
766
774
|
}
|
|
767
775
|
}
|
|
768
|
-
class
|
|
776
|
+
class C {
|
|
769
777
|
constructor(e = !0) {
|
|
770
778
|
u(this, "_preferPersistence");
|
|
771
779
|
u(this, "_volatile");
|
|
@@ -903,7 +911,7 @@ class $ {
|
|
|
903
911
|
return "JsonStorage";
|
|
904
912
|
}
|
|
905
913
|
}
|
|
906
|
-
class
|
|
914
|
+
class N {
|
|
907
915
|
constructor() {
|
|
908
916
|
u(this, "_subscribers");
|
|
909
917
|
this._subscribers = [];
|
|
@@ -958,15 +966,15 @@ class g {
|
|
|
958
966
|
return "SmartPromise";
|
|
959
967
|
}
|
|
960
968
|
}
|
|
961
|
-
class
|
|
969
|
+
class Y extends g {
|
|
962
970
|
constructor(t, n) {
|
|
963
|
-
let r,
|
|
971
|
+
let r, o;
|
|
964
972
|
super((i, l) => {
|
|
965
|
-
r = i,
|
|
973
|
+
r = i, o = l;
|
|
966
974
|
});
|
|
967
975
|
u(this, "_resolve");
|
|
968
976
|
u(this, "_reject");
|
|
969
|
-
this._promise.then(t, n), this._resolve = r, this._reject =
|
|
977
|
+
this._promise.then(t, n), this._resolve = r, this._reject = o;
|
|
970
978
|
}
|
|
971
979
|
get resolve() {
|
|
972
980
|
return this._resolve;
|
|
@@ -981,15 +989,15 @@ class N extends g {
|
|
|
981
989
|
return "DeferredPromise";
|
|
982
990
|
}
|
|
983
991
|
}
|
|
984
|
-
class
|
|
992
|
+
class z extends g {
|
|
985
993
|
constructor(e, t) {
|
|
986
994
|
super((n, r) => {
|
|
987
|
-
const
|
|
995
|
+
const o = (p) => {
|
|
988
996
|
clearTimeout(x), n(p);
|
|
989
997
|
}, i = (p) => {
|
|
990
998
|
clearTimeout(x), r(p);
|
|
991
999
|
}, x = setTimeout(() => i(new T("The operation has timed out.")), t);
|
|
992
|
-
e(
|
|
1000
|
+
e(o, i);
|
|
993
1001
|
});
|
|
994
1002
|
}
|
|
995
1003
|
get [Symbol.toStringTag]() {
|
|
@@ -1018,102 +1026,102 @@ class v {
|
|
|
1018
1026
|
constructor() {
|
|
1019
1027
|
}
|
|
1020
1028
|
}
|
|
1021
|
-
async function
|
|
1022
|
-
return new Promise((e, t) => setTimeout(e,
|
|
1029
|
+
async function J(s) {
|
|
1030
|
+
return new Promise((e, t) => setTimeout(e, s));
|
|
1023
1031
|
}
|
|
1024
|
-
async function
|
|
1025
|
-
return new Promise((
|
|
1032
|
+
async function V() {
|
|
1033
|
+
return new Promise((s, e) => requestAnimationFrame(() => s()));
|
|
1026
1034
|
}
|
|
1027
|
-
var M = /* @__PURE__ */ ((
|
|
1028
|
-
function
|
|
1029
|
-
return Math.floor((e.getTime() -
|
|
1035
|
+
var M = /* @__PURE__ */ ((s) => (s[s.Millisecond = 1] = "Millisecond", s[s.Second = 1e3] = "Second", s[s.Minute = 6e4] = "Minute", s[s.Hour = 36e5] = "Hour", s[s.Day = 864e5] = "Day", s[s.Week = 6048e5] = "Week", s[s.Month = 2592e6] = "Month", s[s.Year = 31536e6] = "Year", s))(M || {});
|
|
1036
|
+
function B(s, e, t = 864e5) {
|
|
1037
|
+
return s = new Date(s), e = new Date(e), Math.floor((e.getTime() - s.getTime()) / t);
|
|
1030
1038
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return new c(function* () {
|
|
1039
|
+
function K(s, e, t = 864e5) {
|
|
1040
|
+
return s = new Date(s), e = new Date(e), new c(function* () {
|
|
1033
1041
|
const n = e.getTime();
|
|
1034
|
-
let r =
|
|
1042
|
+
let r = s.getTime();
|
|
1035
1043
|
for (; r < n; )
|
|
1036
1044
|
yield new Date(r), r += t;
|
|
1037
1045
|
});
|
|
1038
1046
|
}
|
|
1039
|
-
function H(
|
|
1040
|
-
return new Date(Math.floor(
|
|
1047
|
+
function H(s, e = 864e5) {
|
|
1048
|
+
return s = new Date(s), new Date(Math.floor(s.getTime() / e) * e);
|
|
1041
1049
|
}
|
|
1042
|
-
function W(
|
|
1050
|
+
function W(s, e = "text/javascript") {
|
|
1043
1051
|
return new Promise((t, n) => {
|
|
1044
1052
|
const r = document.createElement("script");
|
|
1045
|
-
r.async = !0, r.defer = !0, r.src =
|
|
1053
|
+
r.async = !0, r.defer = !0, r.src = s, r.type = e, r.onload = () => t(), r.onerror = () => n(), document.body.appendChild(r);
|
|
1046
1054
|
});
|
|
1047
1055
|
}
|
|
1048
|
-
function G(...
|
|
1056
|
+
function G(...s) {
|
|
1049
1057
|
return new c(function* () {
|
|
1050
|
-
for (const e of
|
|
1058
|
+
for (const e of s)
|
|
1051
1059
|
for (const t of e)
|
|
1052
1060
|
yield t;
|
|
1053
1061
|
});
|
|
1054
1062
|
}
|
|
1055
|
-
function
|
|
1056
|
-
if (Array.isArray(
|
|
1057
|
-
return
|
|
1063
|
+
function L(s) {
|
|
1064
|
+
if (Array.isArray(s))
|
|
1065
|
+
return s.length;
|
|
1058
1066
|
let e = 0;
|
|
1059
|
-
for (const t of
|
|
1067
|
+
for (const t of s)
|
|
1060
1068
|
e += 1;
|
|
1061
1069
|
return e;
|
|
1062
1070
|
}
|
|
1063
|
-
function
|
|
1071
|
+
function Q(s) {
|
|
1064
1072
|
return new c(function* () {
|
|
1065
1073
|
let e = 0;
|
|
1066
|
-
for (const t of
|
|
1074
|
+
for (const t of s)
|
|
1067
1075
|
yield [e, t], e += 1;
|
|
1068
1076
|
});
|
|
1069
1077
|
}
|
|
1070
|
-
function
|
|
1078
|
+
function X(s, e, t = 1) {
|
|
1071
1079
|
return new c(function* () {
|
|
1072
|
-
e === void 0 && (e =
|
|
1073
|
-
for (let n =
|
|
1080
|
+
e === void 0 && (e = s, s = 0), s > e && (t = t ?? -1);
|
|
1081
|
+
for (let n = s; n < e; n += t)
|
|
1074
1082
|
yield n;
|
|
1075
1083
|
});
|
|
1076
1084
|
}
|
|
1077
|
-
function
|
|
1078
|
-
const e = Array.from(
|
|
1085
|
+
function Z(s) {
|
|
1086
|
+
const e = Array.from(s);
|
|
1079
1087
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
1080
1088
|
const n = Math.floor(Math.random() * (t + 1));
|
|
1081
1089
|
[e[t], e[n]] = [e[n], e[t]];
|
|
1082
1090
|
}
|
|
1083
1091
|
return e;
|
|
1084
1092
|
}
|
|
1085
|
-
function
|
|
1093
|
+
function D(s) {
|
|
1086
1094
|
return new c(function* () {
|
|
1087
1095
|
const e = /* @__PURE__ */ new Set();
|
|
1088
|
-
for (const t of
|
|
1096
|
+
for (const t of s)
|
|
1089
1097
|
e.has(t) || (e.add(t), yield t);
|
|
1090
1098
|
});
|
|
1091
1099
|
}
|
|
1092
|
-
function P(
|
|
1100
|
+
function P(s, e) {
|
|
1093
1101
|
return new c(function* () {
|
|
1094
|
-
const t =
|
|
1102
|
+
const t = s[Symbol.iterator](), n = e[Symbol.iterator]();
|
|
1095
1103
|
for (; ; ) {
|
|
1096
|
-
const r = t.next(),
|
|
1097
|
-
if (r.done ||
|
|
1104
|
+
const r = t.next(), o = n.next();
|
|
1105
|
+
if (r.done || o.done)
|
|
1098
1106
|
break;
|
|
1099
|
-
yield [r.value,
|
|
1107
|
+
yield [r.value, o.value];
|
|
1100
1108
|
}
|
|
1101
1109
|
});
|
|
1102
1110
|
}
|
|
1103
|
-
function
|
|
1111
|
+
function U(s, e) {
|
|
1104
1112
|
if (e === void 0) {
|
|
1105
|
-
let
|
|
1106
|
-
for (const l of
|
|
1107
|
-
|
|
1113
|
+
let o = 0, i = 0;
|
|
1114
|
+
for (const l of s)
|
|
1115
|
+
o += l, i += 1;
|
|
1108
1116
|
if (i === 0)
|
|
1109
1117
|
throw new m("You must provide at least one value.");
|
|
1110
|
-
return
|
|
1118
|
+
return o / i;
|
|
1111
1119
|
}
|
|
1112
1120
|
let t = 0, n = 0, r = 0;
|
|
1113
|
-
for (const [
|
|
1121
|
+
for (const [o, i] of P(s, e)) {
|
|
1114
1122
|
if (i <= 0)
|
|
1115
1123
|
throw new m(`The weight for the value #${r} must be greater than zero.`);
|
|
1116
|
-
t +=
|
|
1124
|
+
t += o * i, n += i, r += 1;
|
|
1117
1125
|
}
|
|
1118
1126
|
if (r === 0)
|
|
1119
1127
|
throw new m("You must provide at least one value and weight.");
|
|
@@ -1121,67 +1129,68 @@ function D(o, e) {
|
|
|
1121
1129
|
throw new m("The sum of weights must be greater than zero.");
|
|
1122
1130
|
return t / n;
|
|
1123
1131
|
}
|
|
1124
|
-
function
|
|
1132
|
+
function ee(s) {
|
|
1125
1133
|
let e = 0;
|
|
1126
|
-
for (let t = 0; t <
|
|
1127
|
-
const n =
|
|
1134
|
+
for (let t = 0; t < s.length; t += 1) {
|
|
1135
|
+
const n = s.charCodeAt(t);
|
|
1128
1136
|
e = (e << 5) - e + n, e |= 0;
|
|
1129
1137
|
}
|
|
1130
1138
|
return e;
|
|
1131
1139
|
}
|
|
1132
|
-
function
|
|
1140
|
+
function te(s) {
|
|
1133
1141
|
let e = 0;
|
|
1134
|
-
for (const t of
|
|
1142
|
+
for (const t of s)
|
|
1135
1143
|
e += t;
|
|
1136
1144
|
return e;
|
|
1137
1145
|
}
|
|
1138
|
-
function
|
|
1139
|
-
return `${
|
|
1146
|
+
function ne(s) {
|
|
1147
|
+
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
1140
1148
|
}
|
|
1141
|
-
const
|
|
1149
|
+
const re = "1.5.3";
|
|
1142
1150
|
export {
|
|
1143
1151
|
y as AggregatedAsyncIterator,
|
|
1144
1152
|
d as AggregatedIterator,
|
|
1145
1153
|
w as Aggregator,
|
|
1146
1154
|
_ as AsyncAggregator,
|
|
1147
1155
|
M as DateUnit,
|
|
1148
|
-
|
|
1156
|
+
Y as DeferredPromise,
|
|
1149
1157
|
f as Exception,
|
|
1150
1158
|
j as FatalErrorException,
|
|
1151
1159
|
R as FileNotFoundException,
|
|
1152
|
-
|
|
1153
|
-
q as
|
|
1160
|
+
C as JsonStorage,
|
|
1161
|
+
q as KeyException,
|
|
1162
|
+
A as NetworkException,
|
|
1154
1163
|
F as NotImplementedException,
|
|
1155
|
-
|
|
1164
|
+
O as PermissionException,
|
|
1156
1165
|
v as Random,
|
|
1157
1166
|
a as ReducedIterator,
|
|
1158
1167
|
k as ReferenceException,
|
|
1159
|
-
|
|
1168
|
+
$ as RuntimeException,
|
|
1160
1169
|
h as SmartAsyncIterator,
|
|
1161
1170
|
c as SmartIterator,
|
|
1162
1171
|
g as SmartPromise,
|
|
1163
|
-
|
|
1164
|
-
|
|
1172
|
+
N as Subscribers,
|
|
1173
|
+
z as TimedPromise,
|
|
1165
1174
|
T as TimeoutException,
|
|
1166
1175
|
E as TypeException,
|
|
1167
|
-
|
|
1176
|
+
re as VERSION,
|
|
1168
1177
|
m as ValueException,
|
|
1169
|
-
|
|
1170
|
-
|
|
1178
|
+
U as average,
|
|
1179
|
+
ne as capitalize,
|
|
1171
1180
|
G as chain,
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1181
|
+
L as count,
|
|
1182
|
+
B as dateDifference,
|
|
1183
|
+
K as dateRange,
|
|
1175
1184
|
H as dateRound,
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1185
|
+
J as delay,
|
|
1186
|
+
Q as enumerate,
|
|
1187
|
+
ee as hash,
|
|
1179
1188
|
W as loadScript,
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1189
|
+
V as nextAnimationFrame,
|
|
1190
|
+
X as range,
|
|
1191
|
+
Z as shuffle,
|
|
1192
|
+
te as sum,
|
|
1193
|
+
D as unique,
|
|
1185
1194
|
P as zip
|
|
1186
1195
|
};
|
|
1187
1196
|
//# sourceMappingURL=core.js.map
|