@byloth/core 1.3.0 → 1.3.2
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 +222 -154
- 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 +5 -5
- package/src/index.ts +2 -1
- package/src/models/aggregators/aggregated-iterator.ts +36 -0
- package/src/models/index.ts +1 -2
- package/src/models/promises/deferred-promise.ts +117 -0
- package/src/models/promises/index.ts +4 -0
- package/src/models/promises/smart-promise.ts +56 -0
- package/src/types.ts +1 -1
- package/src/models/deferred-promise.ts +0 -61
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var y = (s, e, t) => e in s ? w(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var l = (s, e, t) => (y(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
4
|
class h extends Error {
|
|
5
5
|
static FromUnknown(e) {
|
|
6
6
|
if (e instanceof h)
|
|
@@ -19,11 +19,11 @@ Caused by ${t.stack}` : this.stack += `
|
|
|
19
19
|
Caused by ${t}`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
22
|
+
class u {
|
|
23
23
|
constructor(e) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
l(this, "_iterator");
|
|
25
|
+
l(this, "return");
|
|
26
|
+
l(this, "throw");
|
|
27
27
|
e instanceof Function ? this._iterator = e() : Symbol.iterator in e ? this._iterator = e[Symbol.iterator]() : this._iterator = e, this._iterator.return && (this.return = (t) => this._iterator.return(t)), this._iterator.throw && (this.throw = (t) => this._iterator.throw(t));
|
|
28
28
|
}
|
|
29
29
|
every(e) {
|
|
@@ -50,7 +50,7 @@ class c {
|
|
|
50
50
|
}
|
|
51
51
|
filter(e) {
|
|
52
52
|
const t = this._iterator;
|
|
53
|
-
return new
|
|
53
|
+
return new u(function* () {
|
|
54
54
|
let n = 0;
|
|
55
55
|
for (; ; ) {
|
|
56
56
|
const r = t.next();
|
|
@@ -62,7 +62,7 @@ class c {
|
|
|
62
62
|
}
|
|
63
63
|
map(e) {
|
|
64
64
|
const t = this._iterator;
|
|
65
|
-
return new
|
|
65
|
+
return new u(function* () {
|
|
66
66
|
let n = 0;
|
|
67
67
|
for (; ; ) {
|
|
68
68
|
const r = t.next();
|
|
@@ -75,16 +75,16 @@ class c {
|
|
|
75
75
|
reduce(e, t) {
|
|
76
76
|
let n = 0, r = t;
|
|
77
77
|
if (r === void 0) {
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
78
|
+
const i = this._iterator.next();
|
|
79
|
+
if (i.done)
|
|
80
80
|
throw new TypeError("Reduce of empty iterator with no initial value");
|
|
81
|
-
r =
|
|
81
|
+
r = i.value, n += 1;
|
|
82
82
|
}
|
|
83
83
|
for (; ; ) {
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
84
|
+
const i = this._iterator.next();
|
|
85
|
+
if (i.done)
|
|
86
86
|
return r;
|
|
87
|
-
r = e(r,
|
|
87
|
+
r = e(r, i.value, n), n += 1;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
enumerate() {
|
|
@@ -92,7 +92,7 @@ class c {
|
|
|
92
92
|
}
|
|
93
93
|
unique() {
|
|
94
94
|
const e = this._iterator;
|
|
95
|
-
return new
|
|
95
|
+
return new u(function* () {
|
|
96
96
|
const t = /* @__PURE__ */ new Set();
|
|
97
97
|
for (; ; ) {
|
|
98
98
|
const n = e.next();
|
|
@@ -129,23 +129,23 @@ class c {
|
|
|
129
129
|
return this;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
class
|
|
132
|
+
class f {
|
|
133
133
|
constructor(e) {
|
|
134
|
-
|
|
135
|
-
this._elements = new
|
|
134
|
+
l(this, "_elements");
|
|
135
|
+
this._elements = new u(e);
|
|
136
136
|
}
|
|
137
137
|
filter(e) {
|
|
138
138
|
const t = this._elements;
|
|
139
|
-
return new
|
|
140
|
-
for (const [n, [r,
|
|
141
|
-
e(r,
|
|
139
|
+
return new f(function* () {
|
|
140
|
+
for (const [n, [r, i]] of t.enumerate())
|
|
141
|
+
e(r, i, n) && (yield [r, i]);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
map(e) {
|
|
145
145
|
const t = this._elements;
|
|
146
|
-
return new
|
|
147
|
-
for (const [n, [r,
|
|
148
|
-
yield [r, e(r,
|
|
146
|
+
return new f(function* () {
|
|
147
|
+
for (const [n, [r, i]] of t.enumerate())
|
|
148
|
+
yield [r, e(r, i, n)];
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
toArray() {
|
|
@@ -158,79 +158,79 @@ class l {
|
|
|
158
158
|
return Object.fromEntries(this._elements.toArray());
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
class
|
|
161
|
+
class d {
|
|
162
162
|
constructor(e) {
|
|
163
|
-
|
|
164
|
-
this._elements = new
|
|
163
|
+
l(this, "_elements");
|
|
164
|
+
this._elements = new u(e);
|
|
165
165
|
}
|
|
166
166
|
every(e) {
|
|
167
167
|
const t = /* @__PURE__ */ new Map();
|
|
168
168
|
for (const [n, r] of this._elements) {
|
|
169
|
-
const [
|
|
170
|
-
|
|
169
|
+
const [i, o] = t.get(n) ?? [0, !0];
|
|
170
|
+
o && t.set(n, [i + 1, e(n, r, i)]);
|
|
171
171
|
}
|
|
172
|
-
return new
|
|
173
|
-
for (const [n, [r,
|
|
174
|
-
yield [n,
|
|
172
|
+
return new f(function* () {
|
|
173
|
+
for (const [n, [r, i]] of t)
|
|
174
|
+
yield [n, i];
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
some(e) {
|
|
178
178
|
const t = /* @__PURE__ */ new Map();
|
|
179
179
|
for (const [n, r] of this._elements) {
|
|
180
|
-
const [
|
|
181
|
-
|
|
180
|
+
const [i, o] = t.get(n) ?? [0, !1];
|
|
181
|
+
o || t.set(n, [i + 1, e(n, r, i)]);
|
|
182
182
|
}
|
|
183
|
-
return new
|
|
184
|
-
for (const [n, [r,
|
|
185
|
-
yield [n,
|
|
183
|
+
return new f(function* () {
|
|
184
|
+
for (const [n, [r, i]] of t)
|
|
185
|
+
yield [n, i];
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
filter(e) {
|
|
189
189
|
const t = this._elements;
|
|
190
|
-
return new
|
|
190
|
+
return new d(function* () {
|
|
191
191
|
const n = /* @__PURE__ */ new Map();
|
|
192
|
-
for (const [r,
|
|
193
|
-
const
|
|
194
|
-
n.set(r,
|
|
192
|
+
for (const [r, i] of t) {
|
|
193
|
+
const o = n.get(r) ?? 0;
|
|
194
|
+
n.set(r, o + 1), e(r, i, o) && (yield [r, i]);
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
map(e) {
|
|
199
199
|
const t = this._elements;
|
|
200
|
-
return new
|
|
200
|
+
return new d(function* () {
|
|
201
201
|
const n = /* @__PURE__ */ new Map();
|
|
202
|
-
for (const [r,
|
|
203
|
-
const
|
|
204
|
-
n.set(r,
|
|
202
|
+
for (const [r, i] of t) {
|
|
203
|
+
const o = n.get(r) ?? 0;
|
|
204
|
+
n.set(r, o + 1), yield [r, e(r, i, o)];
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
reduce(e, t) {
|
|
209
209
|
const n = /* @__PURE__ */ new Map();
|
|
210
|
-
for (const [r,
|
|
211
|
-
let
|
|
210
|
+
for (const [r, i] of this._elements) {
|
|
211
|
+
let o, c;
|
|
212
212
|
if (n.has(r))
|
|
213
|
-
[
|
|
213
|
+
[o, c] = n.get(r), o += 1;
|
|
214
214
|
else if (t !== void 0)
|
|
215
|
-
|
|
215
|
+
o = 0, c = t;
|
|
216
216
|
else {
|
|
217
|
-
n.set(r, [0,
|
|
217
|
+
n.set(r, [0, i]);
|
|
218
218
|
continue;
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
c = e(r, c, i, o), n.set(r, [o, c]);
|
|
221
221
|
}
|
|
222
|
-
return new
|
|
223
|
-
for (const [r, [
|
|
224
|
-
yield [r,
|
|
222
|
+
return new f(function* () {
|
|
223
|
+
for (const [r, [i, o]] of n)
|
|
224
|
+
yield [r, o];
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
unique() {
|
|
228
228
|
const e = this._elements;
|
|
229
|
-
return new
|
|
229
|
+
return new d(function* () {
|
|
230
230
|
const t = /* @__PURE__ */ new Map();
|
|
231
231
|
for (const [n, r] of e) {
|
|
232
|
-
const
|
|
233
|
-
|
|
232
|
+
const i = t.get(n) ?? /* @__PURE__ */ new Set();
|
|
233
|
+
i.has(r) || (i.add(r), t.set(n, i), yield [n, r]);
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
}
|
|
@@ -240,7 +240,25 @@ class f {
|
|
|
240
240
|
const n = e.get(t) ?? 0;
|
|
241
241
|
e.set(t, n + 1);
|
|
242
242
|
}
|
|
243
|
-
return new
|
|
243
|
+
return new f(function* () {
|
|
244
|
+
for (const [t, n] of e)
|
|
245
|
+
yield [t, n];
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
first() {
|
|
249
|
+
const e = /* @__PURE__ */ new Map();
|
|
250
|
+
for (const [t, n] of this._elements)
|
|
251
|
+
e.has(t) || e.set(t, n);
|
|
252
|
+
return new f(function* () {
|
|
253
|
+
for (const [t, n] of e)
|
|
254
|
+
yield [t, n];
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
last() {
|
|
258
|
+
const e = /* @__PURE__ */ new Map();
|
|
259
|
+
for (const [t, n] of this._elements)
|
|
260
|
+
e.set(t, n);
|
|
261
|
+
return new f(function* () {
|
|
244
262
|
for (const [t, n] of e)
|
|
245
263
|
yield [t, n];
|
|
246
264
|
});
|
|
@@ -265,61 +283,29 @@ class f {
|
|
|
265
283
|
return e;
|
|
266
284
|
}
|
|
267
285
|
}
|
|
268
|
-
class
|
|
286
|
+
class _ {
|
|
269
287
|
constructor(e) {
|
|
270
|
-
|
|
271
|
-
this._elements = new
|
|
288
|
+
l(this, "_elements");
|
|
289
|
+
this._elements = new u(e);
|
|
272
290
|
}
|
|
273
291
|
filter(e) {
|
|
274
|
-
return new
|
|
292
|
+
return new _(this._elements.filter(e));
|
|
275
293
|
}
|
|
276
294
|
map(e) {
|
|
277
|
-
return new
|
|
295
|
+
return new _(this._elements.map(e));
|
|
278
296
|
}
|
|
279
297
|
unique() {
|
|
280
|
-
return new
|
|
298
|
+
return new _(this._elements.unique());
|
|
281
299
|
}
|
|
282
300
|
byKey(e) {
|
|
283
|
-
return new
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
class p {
|
|
287
|
-
constructor(e, t) {
|
|
288
|
-
u(this, "_resolve");
|
|
289
|
-
u(this, "_reject");
|
|
290
|
-
u(this, "_promise");
|
|
291
|
-
let n, r;
|
|
292
|
-
this._promise = new Promise((o, i) => {
|
|
293
|
-
n = o, r = i;
|
|
294
|
-
}).then(e, t), this._resolve = n, this._reject = r;
|
|
295
|
-
}
|
|
296
|
-
get resolve() {
|
|
297
|
-
return this._resolve;
|
|
298
|
-
}
|
|
299
|
-
get reject() {
|
|
300
|
-
return this._reject;
|
|
301
|
-
}
|
|
302
|
-
then(e, t) {
|
|
303
|
-
return this._promise.then(e, t);
|
|
304
|
-
}
|
|
305
|
-
catch(e) {
|
|
306
|
-
return this._promise.catch(e);
|
|
307
|
-
}
|
|
308
|
-
finally(e) {
|
|
309
|
-
return this._promise.finally(e);
|
|
310
|
-
}
|
|
311
|
-
watch(e) {
|
|
312
|
-
return e.then(this.resolve, this.reject), this;
|
|
313
|
-
}
|
|
314
|
-
get [Symbol.toStringTag]() {
|
|
315
|
-
return "DeferredPromise";
|
|
301
|
+
return new d(this._elements.map((t, n) => [e(t, n), t]));
|
|
316
302
|
}
|
|
317
303
|
}
|
|
318
304
|
class x {
|
|
319
305
|
constructor(e = !0) {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
306
|
+
l(this, "_preferPersistence");
|
|
307
|
+
l(this, "_volatile");
|
|
308
|
+
l(this, "_persistent");
|
|
323
309
|
this._preferPersistence = e, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
|
|
324
310
|
}
|
|
325
311
|
_get(e, t, n) {
|
|
@@ -452,7 +438,7 @@ class x {
|
|
|
452
438
|
}
|
|
453
439
|
class b {
|
|
454
440
|
constructor() {
|
|
455
|
-
|
|
441
|
+
l(this, "_subscribers");
|
|
456
442
|
this._subscribers = [];
|
|
457
443
|
}
|
|
458
444
|
add(e) {
|
|
@@ -468,7 +454,88 @@ class b {
|
|
|
468
454
|
return this._subscribers.slice().map((t) => t(...e));
|
|
469
455
|
}
|
|
470
456
|
}
|
|
471
|
-
class
|
|
457
|
+
class k {
|
|
458
|
+
constructor(e, t) {
|
|
459
|
+
l(this, "_isPending");
|
|
460
|
+
l(this, "_isFulfilled");
|
|
461
|
+
l(this, "_isRejected");
|
|
462
|
+
l(this, "_resolve");
|
|
463
|
+
l(this, "_reject");
|
|
464
|
+
l(this, "_promise");
|
|
465
|
+
this._isPending = !0, this._isFulfilled = !1, this._isRejected = !1;
|
|
466
|
+
let n, r;
|
|
467
|
+
const i = (a, m) => {
|
|
468
|
+
n = a, r = m;
|
|
469
|
+
};
|
|
470
|
+
let o;
|
|
471
|
+
e ? o = (a) => (this._isPending = !1, this._isFulfilled = !0, e(a)) : o = (a) => (this._isPending = !1, this._isFulfilled = !0, a);
|
|
472
|
+
let c;
|
|
473
|
+
t ? c = (a) => (this._isPending = !1, this._isRejected = !0, t(a)) : c = (a) => (this._isPending = !1, this._isRejected = !0, a), this._promise = new Promise(i).then(o, c), this._resolve = n, this._reject = r;
|
|
474
|
+
}
|
|
475
|
+
get isPending() {
|
|
476
|
+
return this._isPending;
|
|
477
|
+
}
|
|
478
|
+
get isFulfilled() {
|
|
479
|
+
return this._isFulfilled;
|
|
480
|
+
}
|
|
481
|
+
get isRejected() {
|
|
482
|
+
return this._isRejected;
|
|
483
|
+
}
|
|
484
|
+
get resolve() {
|
|
485
|
+
return this._resolve;
|
|
486
|
+
}
|
|
487
|
+
get reject() {
|
|
488
|
+
return this._reject;
|
|
489
|
+
}
|
|
490
|
+
then(e, t) {
|
|
491
|
+
return this._promise.then(e, t);
|
|
492
|
+
}
|
|
493
|
+
catch(e) {
|
|
494
|
+
return this._promise.catch(e);
|
|
495
|
+
}
|
|
496
|
+
finally(e) {
|
|
497
|
+
return this._promise.finally(e);
|
|
498
|
+
}
|
|
499
|
+
watch(e) {
|
|
500
|
+
return e.then(this.resolve, this.reject), this;
|
|
501
|
+
}
|
|
502
|
+
get [Symbol.toStringTag]() {
|
|
503
|
+
return "DeferredPromise";
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
class M {
|
|
507
|
+
constructor(e) {
|
|
508
|
+
l(this, "_isPending");
|
|
509
|
+
l(this, "_isFulfilled");
|
|
510
|
+
l(this, "_isRejected");
|
|
511
|
+
l(this, "_promise");
|
|
512
|
+
this._isPending = !0, this._isFulfilled = !1, this._isRejected = !1;
|
|
513
|
+
const t = (r) => (this._isPending = !1, this._isFulfilled = !0, r), n = (r) => (this._isPending = !1, this._isRejected = !0, r);
|
|
514
|
+
this._promise = new Promise(e).then(t, n);
|
|
515
|
+
}
|
|
516
|
+
get isPending() {
|
|
517
|
+
return this._isPending;
|
|
518
|
+
}
|
|
519
|
+
get isFulfilled() {
|
|
520
|
+
return this._isFulfilled;
|
|
521
|
+
}
|
|
522
|
+
get isRejected() {
|
|
523
|
+
return this._isRejected;
|
|
524
|
+
}
|
|
525
|
+
then(e, t) {
|
|
526
|
+
return this._promise.then(e, t);
|
|
527
|
+
}
|
|
528
|
+
catch(e) {
|
|
529
|
+
return this._promise.catch(e);
|
|
530
|
+
}
|
|
531
|
+
finally(e) {
|
|
532
|
+
return this._promise.finally(e);
|
|
533
|
+
}
|
|
534
|
+
get [Symbol.toStringTag]() {
|
|
535
|
+
return "SmartPromise";
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
class P {
|
|
472
539
|
static Boolean(e = 0.5) {
|
|
473
540
|
return Math.random() < e;
|
|
474
541
|
}
|
|
@@ -485,18 +552,18 @@ class g {
|
|
|
485
552
|
constructor() {
|
|
486
553
|
}
|
|
487
554
|
}
|
|
488
|
-
async function
|
|
555
|
+
async function j(s) {
|
|
489
556
|
return new Promise((e, t) => setTimeout(e, s));
|
|
490
557
|
}
|
|
491
|
-
async function
|
|
558
|
+
async function S() {
|
|
492
559
|
return new Promise((s, e) => requestAnimationFrame(() => s()));
|
|
493
560
|
}
|
|
494
|
-
var
|
|
495
|
-
function
|
|
561
|
+
var v = /* @__PURE__ */ ((s) => (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))(v || {});
|
|
562
|
+
function R(s, e, t = 864e5) {
|
|
496
563
|
return Math.floor((e.getTime() - s.getTime()) / t);
|
|
497
564
|
}
|
|
498
|
-
function
|
|
499
|
-
return new
|
|
565
|
+
function F(s, e, t = 864e5) {
|
|
566
|
+
return new u(function* () {
|
|
500
567
|
const n = e.getTime();
|
|
501
568
|
let r = s.getTime();
|
|
502
569
|
for (; r < n; )
|
|
@@ -506,13 +573,13 @@ function j(s, e, t = 864e5) {
|
|
|
506
573
|
function I(s, e = 864e5) {
|
|
507
574
|
return new Date(Math.floor(s.getTime() / e) * e);
|
|
508
575
|
}
|
|
509
|
-
async function
|
|
576
|
+
async function T(s, e = "text/javascript") {
|
|
510
577
|
return new Promise((t, n) => {
|
|
511
578
|
const r = document.createElement("script");
|
|
512
579
|
r.async = !0, r.defer = !0, r.src = s, r.type = e, r.onload = () => t(), r.onerror = () => n(), document.body.appendChild(r);
|
|
513
580
|
});
|
|
514
581
|
}
|
|
515
|
-
function
|
|
582
|
+
function A(s) {
|
|
516
583
|
if (Array.isArray(s))
|
|
517
584
|
return s.length;
|
|
518
585
|
let e = 0;
|
|
@@ -520,14 +587,14 @@ function T(s) {
|
|
|
520
587
|
e += 1;
|
|
521
588
|
return e;
|
|
522
589
|
}
|
|
523
|
-
function
|
|
524
|
-
return new
|
|
590
|
+
function q(s, e, t = 1) {
|
|
591
|
+
return new u(function* () {
|
|
525
592
|
e === void 0 && (e = s, s = 0), s > e && (t = t ?? -1);
|
|
526
593
|
for (let n = s; n < e; n += t)
|
|
527
594
|
yield n;
|
|
528
595
|
});
|
|
529
596
|
}
|
|
530
|
-
function
|
|
597
|
+
function C(s) {
|
|
531
598
|
const e = Array.from(s);
|
|
532
599
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
533
600
|
const n = Math.floor(Math.random() * (t + 1));
|
|
@@ -535,37 +602,37 @@ function q(s) {
|
|
|
535
602
|
}
|
|
536
603
|
return e;
|
|
537
604
|
}
|
|
538
|
-
function
|
|
539
|
-
return new
|
|
605
|
+
function E(s) {
|
|
606
|
+
return new u(function* () {
|
|
540
607
|
const e = /* @__PURE__ */ new Set();
|
|
541
608
|
for (const t of s)
|
|
542
609
|
e.has(t) || (e.add(t), yield t);
|
|
543
610
|
});
|
|
544
611
|
}
|
|
545
|
-
function
|
|
546
|
-
return new
|
|
612
|
+
function p(s, e) {
|
|
613
|
+
return new u(function* () {
|
|
547
614
|
const t = s[Symbol.iterator](), n = e[Symbol.iterator]();
|
|
548
615
|
for (; ; ) {
|
|
549
|
-
const r = t.next(),
|
|
550
|
-
if (r.done ||
|
|
616
|
+
const r = t.next(), i = n.next();
|
|
617
|
+
if (r.done || i.done)
|
|
551
618
|
break;
|
|
552
|
-
yield [r.value,
|
|
619
|
+
yield [r.value, i.value];
|
|
553
620
|
}
|
|
554
621
|
});
|
|
555
622
|
}
|
|
556
|
-
function
|
|
623
|
+
function O(s, e) {
|
|
557
624
|
if (e === void 0) {
|
|
558
|
-
let r = 0,
|
|
559
|
-
for (const
|
|
560
|
-
r +=
|
|
561
|
-
return r /
|
|
625
|
+
let r = 0, i = 0;
|
|
626
|
+
for (const o of s)
|
|
627
|
+
r += o, i += 1;
|
|
628
|
+
return r / i;
|
|
562
629
|
}
|
|
563
630
|
let t = 0, n = 0;
|
|
564
|
-
for (const [r,
|
|
565
|
-
t += r *
|
|
631
|
+
for (const [r, i] of p(s, e))
|
|
632
|
+
t += r * i, n += i;
|
|
566
633
|
return t / n;
|
|
567
634
|
}
|
|
568
|
-
function
|
|
635
|
+
function $(s) {
|
|
569
636
|
let e = 0;
|
|
570
637
|
for (let t = 0; t < s.length; t += 1) {
|
|
571
638
|
const n = s.charCodeAt(t);
|
|
@@ -573,42 +640,43 @@ function O(s) {
|
|
|
573
640
|
}
|
|
574
641
|
return e;
|
|
575
642
|
}
|
|
576
|
-
function
|
|
643
|
+
function J(s) {
|
|
577
644
|
let e = 0;
|
|
578
645
|
for (const t of s)
|
|
579
646
|
e += t;
|
|
580
647
|
return e;
|
|
581
648
|
}
|
|
582
|
-
function
|
|
649
|
+
function V(s) {
|
|
583
650
|
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
584
651
|
}
|
|
585
|
-
const
|
|
652
|
+
const z = "1.3.2";
|
|
586
653
|
export {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
654
|
+
d as AggregatedIterator,
|
|
655
|
+
_ as Aggregator,
|
|
656
|
+
v as DateUnit,
|
|
657
|
+
k as DeferredPromise,
|
|
591
658
|
h as Exception,
|
|
592
659
|
x as JsonStorage,
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
660
|
+
P as Random,
|
|
661
|
+
f as ReducedIterator,
|
|
662
|
+
u as SmartIterator,
|
|
663
|
+
M as SmartPromise,
|
|
596
664
|
b as Subscribers,
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
665
|
+
z as VERSION,
|
|
666
|
+
O as average,
|
|
667
|
+
V as capitalize,
|
|
668
|
+
A as count,
|
|
669
|
+
R as dateDifference,
|
|
670
|
+
F as dateRange,
|
|
603
671
|
I as dateRound,
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
672
|
+
j as delay,
|
|
673
|
+
$ as hash,
|
|
674
|
+
T as loadScript,
|
|
675
|
+
S as nextAnimationFrame,
|
|
676
|
+
q as range,
|
|
677
|
+
C as shuffle,
|
|
678
|
+
J as sum,
|
|
679
|
+
E as unique,
|
|
680
|
+
p as zip
|
|
613
681
|
};
|
|
614
682
|
//# sourceMappingURL=core.js.map
|