iterable-linq-utility 0.7.0 → 0.8.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/index.d.cts +132 -0
- package/dist/index.d.ts +132 -0
- package/dist/iterable-linq-utility.js +404 -255
- package/dist/iterable-linq-utility.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -62,72 +62,24 @@ function l(e, t) {
|
|
|
62
62
|
function u(e, t, r) {
|
|
63
63
|
if (!n(e)) throw c(r, `The "${t}" function must be provided`);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function d(e, t, n) {
|
|
66
66
|
if (!Number.isInteger(e)) throw c(n, `The "${t}" parameter must be an integer`);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function f(e, t, n) {
|
|
69
69
|
if (!Number.isInteger(e) || e < 0) throw c(n, `The "${t}" parameter must be a non-negative integer`);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ee(e, t, n) {
|
|
72
72
|
if (!Number.isFinite(e) || e === 0) throw c(n, `The "${t}" parameter must be a finite number other than 0`);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function te(e, t, n) {
|
|
75
75
|
if (typeof e != "object" || !e) throw c(n, `The "${t}" parameter must be an object`);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function ne(e, t, n) {
|
|
78
78
|
if (typeof e != "string" || e.length === 0) throw c(n, `The "${t}" parameter must be a non-empty string`);
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
//#region src/functions/at.ts
|
|
82
|
-
function f(e, t) {
|
|
83
|
-
return l(e, "at"), ee(t, "index", "at"), t >= 0 ? ie(e, t) : ae(e, -t);
|
|
84
|
-
}
|
|
85
|
-
function ie(e, t) {
|
|
86
|
-
let n = 0;
|
|
87
|
-
for (let r of e) if (n++ === t) return r;
|
|
88
|
-
}
|
|
89
|
-
function ae(e, t) {
|
|
90
|
-
let n = [], r = 0, i = !1;
|
|
91
|
-
for (let a of e) n[r] = a, ++r === t && (r = 0, i = !0);
|
|
92
|
-
return i ? n[r] : void 0;
|
|
93
|
-
}
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/functions/average.ts
|
|
96
|
-
function p(e, t) {
|
|
97
|
-
l(e, "average");
|
|
98
|
-
let n = 0, r = 0;
|
|
99
|
-
if (t === void 0) for (let t of e) n += t, r++;
|
|
100
|
-
else {
|
|
101
|
-
u(t, "selector", "average");
|
|
102
|
-
for (let i of e) n += t(i, r++);
|
|
103
|
-
}
|
|
104
|
-
return r === 0 ? void 0 : n / r;
|
|
105
|
-
}
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/functions/collectToArray.ts
|
|
108
|
-
function m(e) {
|
|
109
|
-
if (l(e, "collectToArray"), Array.isArray(e) || e instanceof Set) return Array.from(e);
|
|
110
|
-
let t = [];
|
|
111
|
-
for (let n of e) t.push(n);
|
|
112
|
-
return t;
|
|
113
|
-
}
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/functions/count.ts
|
|
116
|
-
function oe(e, t) {
|
|
117
|
-
l(e, "count");
|
|
118
|
-
let n = 0;
|
|
119
|
-
if (t === void 0) {
|
|
120
|
-
for (let t of e) n++;
|
|
121
|
-
return n;
|
|
122
|
-
}
|
|
123
|
-
u(t, "predicate", "count");
|
|
124
|
-
let r = 0;
|
|
125
|
-
for (let i of e) t(i, r++) && n++;
|
|
126
|
-
return n;
|
|
127
|
-
}
|
|
128
|
-
//#endregion
|
|
129
81
|
//#region src/iterators/baseIterator.ts
|
|
130
|
-
var
|
|
82
|
+
var p = class {
|
|
131
83
|
done = !1;
|
|
132
84
|
next() {
|
|
133
85
|
if (this.done) return s();
|
|
@@ -149,7 +101,7 @@ var h = class {
|
|
|
149
101
|
} catch {}
|
|
150
102
|
}
|
|
151
103
|
}
|
|
152
|
-
},
|
|
104
|
+
}, m = class {
|
|
153
105
|
createIterator;
|
|
154
106
|
constructor(e) {
|
|
155
107
|
this.createIterator = e;
|
|
@@ -157,7 +109,7 @@ var h = class {
|
|
|
157
109
|
[Symbol.iterator]() {
|
|
158
110
|
return this.createIterator();
|
|
159
111
|
}
|
|
160
|
-
},
|
|
112
|
+
}, h = class extends p {
|
|
161
113
|
source;
|
|
162
114
|
index = 0;
|
|
163
115
|
constructor(e) {
|
|
@@ -169,10 +121,10 @@ var h = class {
|
|
|
169
121
|
};
|
|
170
122
|
//#endregion
|
|
171
123
|
//#region src/iterators/unfold.ts
|
|
172
|
-
function
|
|
173
|
-
return new
|
|
124
|
+
function g(e, t) {
|
|
125
|
+
return new m(() => new re(e, t));
|
|
174
126
|
}
|
|
175
|
-
var
|
|
127
|
+
var re = class extends p {
|
|
176
128
|
state;
|
|
177
129
|
step;
|
|
178
130
|
constructor(e, t) {
|
|
@@ -184,11 +136,102 @@ var ce = class extends h {
|
|
|
184
136
|
}
|
|
185
137
|
};
|
|
186
138
|
//#endregion
|
|
187
|
-
//#region src/functions/
|
|
139
|
+
//#region src/functions/append.ts
|
|
140
|
+
function ie(e, t) {
|
|
141
|
+
return l(e, "append"), new m(() => new ae(e, t));
|
|
142
|
+
}
|
|
143
|
+
var ae = class extends h {
|
|
144
|
+
value;
|
|
145
|
+
sourceDone = !1;
|
|
146
|
+
constructor(e, t) {
|
|
147
|
+
super(e), this.value = t;
|
|
148
|
+
}
|
|
149
|
+
advance() {
|
|
150
|
+
if (this.sourceDone) return s();
|
|
151
|
+
let e = this.source.next();
|
|
152
|
+
return e.done === !0 ? (this.sourceDone = !0, o(this.value)) : e;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/functions/at.ts
|
|
157
|
+
function oe(e, t) {
|
|
158
|
+
return l(e, "at"), d(t, "index", "at"), t >= 0 ? se(e, t) : ce(e, -t);
|
|
159
|
+
}
|
|
160
|
+
function se(e, t) {
|
|
161
|
+
let n = 0;
|
|
162
|
+
for (let r of e) if (n++ === t) return r;
|
|
163
|
+
}
|
|
164
|
+
function ce(e, t) {
|
|
165
|
+
let n = [], r = 0, i = !1;
|
|
166
|
+
for (let a of e) n[r] = a, ++r === t && (r = 0, i = !0);
|
|
167
|
+
return i ? n[r] : void 0;
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/functions/average.ts
|
|
171
|
+
function le(e, t) {
|
|
172
|
+
l(e, "average");
|
|
173
|
+
let n = 0, r = 0;
|
|
174
|
+
if (t === void 0) for (let t of e) n += t, r++;
|
|
175
|
+
else {
|
|
176
|
+
u(t, "selector", "average");
|
|
177
|
+
for (let i of e) n += t(i, r++);
|
|
178
|
+
}
|
|
179
|
+
return r === 0 ? void 0 : n / r;
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/functions/collectToArray.ts
|
|
183
|
+
function ue(e) {
|
|
184
|
+
if (l(e, "collectToArray"), Array.isArray(e) || e instanceof Set) return Array.from(e);
|
|
185
|
+
let t = [];
|
|
186
|
+
for (let n of e) t.push(n);
|
|
187
|
+
return t;
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/functions/concat.ts
|
|
191
|
+
function _(e, ...t) {
|
|
192
|
+
l(e, "concat");
|
|
193
|
+
for (let e of t) l(e, "concat");
|
|
194
|
+
let n = [e, ...t];
|
|
195
|
+
return new m(() => new de(n));
|
|
196
|
+
}
|
|
197
|
+
var de = class extends p {
|
|
198
|
+
sources;
|
|
199
|
+
position = 0;
|
|
200
|
+
current;
|
|
201
|
+
constructor(e) {
|
|
202
|
+
super(), this.sources = e, this.current = e[0][Symbol.iterator]();
|
|
203
|
+
}
|
|
204
|
+
advance() {
|
|
205
|
+
for (;;) {
|
|
206
|
+
let e = this.current.next();
|
|
207
|
+
if (e.done !== !0 || ++this.position === this.sources.length) return e;
|
|
208
|
+
this.current = void 0, this.current = this.sources[this.position][Symbol.iterator]();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
onReturn(e) {
|
|
212
|
+
this.current?.return?.(e);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/functions/count.ts
|
|
188
217
|
function v(e, t) {
|
|
189
|
-
|
|
218
|
+
l(e, "count");
|
|
219
|
+
let n = 0;
|
|
220
|
+
if (t === void 0) {
|
|
221
|
+
for (let t of e) n++;
|
|
222
|
+
return n;
|
|
223
|
+
}
|
|
224
|
+
u(t, "predicate", "count");
|
|
225
|
+
let r = 0;
|
|
226
|
+
for (let i of e) t(i, r++) && n++;
|
|
227
|
+
return n;
|
|
190
228
|
}
|
|
191
|
-
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/functions/distinct.ts
|
|
231
|
+
function y(e, t) {
|
|
232
|
+
return l(e, "distinct"), t !== void 0 && u(t, "keySelector", "distinct"), new m(() => new fe(e, t));
|
|
233
|
+
}
|
|
234
|
+
var fe = class extends h {
|
|
192
235
|
keySelector;
|
|
193
236
|
seen = /* @__PURE__ */ new Set();
|
|
194
237
|
constructor(e, t) {
|
|
@@ -209,12 +252,12 @@ var le = class extends _ {
|
|
|
209
252
|
};
|
|
210
253
|
//#endregion
|
|
211
254
|
//#region src/functions/empty.ts
|
|
212
|
-
function
|
|
213
|
-
return
|
|
255
|
+
function b() {
|
|
256
|
+
return g(void 0, () => void 0);
|
|
214
257
|
}
|
|
215
258
|
//#endregion
|
|
216
259
|
//#region src/functions/every.ts
|
|
217
|
-
function
|
|
260
|
+
function x(e, t) {
|
|
218
261
|
l(e, "every"), u(t, "predicate", "every");
|
|
219
262
|
let n = 0;
|
|
220
263
|
for (let r of e) if (!t(r, n++)) return !1;
|
|
@@ -222,10 +265,10 @@ function ue(e, t) {
|
|
|
222
265
|
}
|
|
223
266
|
//#endregion
|
|
224
267
|
//#region src/functions/filter.ts
|
|
225
|
-
function
|
|
226
|
-
return l(e, "filter"), u(t, "predicate", "filter"), new
|
|
268
|
+
function S(e, t) {
|
|
269
|
+
return l(e, "filter"), u(t, "predicate", "filter"), new m(() => new pe(e, t));
|
|
227
270
|
}
|
|
228
|
-
var
|
|
271
|
+
var pe = class extends h {
|
|
229
272
|
predicate;
|
|
230
273
|
constructor(e, t) {
|
|
231
274
|
super(e), this.predicate = t;
|
|
@@ -245,14 +288,14 @@ var de = class extends _ {
|
|
|
245
288
|
};
|
|
246
289
|
//#endregion
|
|
247
290
|
//#region src/functions/find.ts
|
|
248
|
-
function
|
|
291
|
+
function C(e, t) {
|
|
249
292
|
l(e, "find"), u(t, "predicate", "find");
|
|
250
293
|
let n = 0;
|
|
251
294
|
for (let r of e) if (t(r, n++)) return r;
|
|
252
295
|
}
|
|
253
296
|
//#endregion
|
|
254
297
|
//#region src/functions/findIndex.ts
|
|
255
|
-
function
|
|
298
|
+
function w(e, t) {
|
|
256
299
|
l(e, "findIndex"), u(t, "predicate", "findIndex");
|
|
257
300
|
let n = 0;
|
|
258
301
|
for (let r of e) {
|
|
@@ -263,7 +306,7 @@ function S(e, t) {
|
|
|
263
306
|
}
|
|
264
307
|
//#endregion
|
|
265
308
|
//#region src/functions/findLast.ts
|
|
266
|
-
function
|
|
309
|
+
function T(e, t) {
|
|
267
310
|
l(e, "findLast"), u(t, "predicate", "findLast");
|
|
268
311
|
let n, r = 0;
|
|
269
312
|
for (let i of e) t(i, r++) && (n = i);
|
|
@@ -271,7 +314,7 @@ function C(e, t) {
|
|
|
271
314
|
}
|
|
272
315
|
//#endregion
|
|
273
316
|
//#region src/functions/findLastIndex.ts
|
|
274
|
-
function
|
|
317
|
+
function E(e, t) {
|
|
275
318
|
l(e, "findLastIndex"), u(t, "predicate", "findLastIndex");
|
|
276
319
|
let n = -1, r = 0;
|
|
277
320
|
for (let i of e) t(i, r) && (n = r), r++;
|
|
@@ -279,10 +322,10 @@ function w(e, t) {
|
|
|
279
322
|
}
|
|
280
323
|
//#endregion
|
|
281
324
|
//#region src/functions/flatMap.ts
|
|
282
|
-
function
|
|
283
|
-
return l(e, "flatMap"), u(t, "mapper", "flatMap"), new
|
|
325
|
+
function D(e, t) {
|
|
326
|
+
return l(e, "flatMap"), u(t, "mapper", "flatMap"), new m(() => new me(e, t));
|
|
284
327
|
}
|
|
285
|
-
var
|
|
328
|
+
var me = class e extends h {
|
|
286
329
|
mapper;
|
|
287
330
|
static steps = {
|
|
288
331
|
outer: (t) => {
|
|
@@ -343,7 +386,7 @@ var fe = class e extends _ {
|
|
|
343
386
|
throw e.inner = void 0, e.closeAfterCallbackError(), t;
|
|
344
387
|
}
|
|
345
388
|
}
|
|
346
|
-
},
|
|
389
|
+
}, O = class e {
|
|
347
390
|
static instance = e.createFrozen();
|
|
348
391
|
constructor() {}
|
|
349
392
|
static createFrozen() {
|
|
@@ -351,26 +394,26 @@ var fe = class e extends _ {
|
|
|
351
394
|
return Object.freeze(t), t;
|
|
352
395
|
}
|
|
353
396
|
};
|
|
354
|
-
function
|
|
355
|
-
return
|
|
397
|
+
function k() {
|
|
398
|
+
return O.instance;
|
|
356
399
|
}
|
|
357
400
|
//#endregion
|
|
358
401
|
//#region src/functions/forEach.ts
|
|
359
|
-
function
|
|
402
|
+
function A(e, t) {
|
|
360
403
|
l(e, "forEach"), u(t, "action", "forEach");
|
|
361
404
|
let n = 0;
|
|
362
405
|
for (let r of e) t(r, n++);
|
|
363
|
-
return
|
|
406
|
+
return k();
|
|
364
407
|
}
|
|
365
|
-
async function
|
|
408
|
+
async function j(e, t) {
|
|
366
409
|
l(e, "forEachAsync"), u(t, "action", "forEachAsync");
|
|
367
410
|
let n = 0;
|
|
368
411
|
for (let r of e) await t(r, n++);
|
|
369
|
-
return
|
|
412
|
+
return k();
|
|
370
413
|
}
|
|
371
414
|
//#endregion
|
|
372
415
|
//#region src/functions/includes.ts
|
|
373
|
-
function
|
|
416
|
+
function M(e, t) {
|
|
374
417
|
l(e, "includes");
|
|
375
418
|
let n = t !== t;
|
|
376
419
|
for (let r of e) if (r === t || n && r !== r) return !0;
|
|
@@ -378,7 +421,7 @@ function A(e, t) {
|
|
|
378
421
|
}
|
|
379
422
|
//#endregion
|
|
380
423
|
//#region src/functions/indexOf.ts
|
|
381
|
-
function
|
|
424
|
+
function N(e, t) {
|
|
382
425
|
l(e, "indexOf");
|
|
383
426
|
let n = 0;
|
|
384
427
|
for (let r of e) {
|
|
@@ -389,12 +432,12 @@ function j(e, t) {
|
|
|
389
432
|
}
|
|
390
433
|
//#endregion
|
|
391
434
|
//#region src/functions/join.ts
|
|
392
|
-
function
|
|
435
|
+
function P(e, t) {
|
|
393
436
|
return l(e, "join"), Array.from(e).join(t);
|
|
394
437
|
}
|
|
395
438
|
//#endregion
|
|
396
439
|
//#region src/functions/lastIndexOf.ts
|
|
397
|
-
function
|
|
440
|
+
function F(e, t) {
|
|
398
441
|
l(e, "lastIndexOf");
|
|
399
442
|
let n = -1, r = 0;
|
|
400
443
|
for (let i of e) i === t && (n = r), r++;
|
|
@@ -402,10 +445,10 @@ function N(e, t) {
|
|
|
402
445
|
}
|
|
403
446
|
//#endregion
|
|
404
447
|
//#region src/functions/map.ts
|
|
405
|
-
function
|
|
406
|
-
return l(e, "map"), u(t, "mapper", "map"), new
|
|
448
|
+
function I(e, t) {
|
|
449
|
+
return l(e, "map"), u(t, "mapper", "map"), new m(() => new he(e, t));
|
|
407
450
|
}
|
|
408
|
-
var
|
|
451
|
+
var he = class extends h {
|
|
409
452
|
mapper;
|
|
410
453
|
constructor(e, t) {
|
|
411
454
|
super(e), this.mapper = t;
|
|
@@ -424,18 +467,18 @@ var pe = class extends _ {
|
|
|
424
467
|
};
|
|
425
468
|
//#endregion
|
|
426
469
|
//#region src/collections/linkedList.ts
|
|
427
|
-
function
|
|
470
|
+
function ge(e) {
|
|
428
471
|
l(e, "LinkedList.from");
|
|
429
|
-
let t = new
|
|
472
|
+
let t = new _e();
|
|
430
473
|
for (let n of e) t.addLast(n);
|
|
431
474
|
return t;
|
|
432
475
|
}
|
|
433
|
-
var
|
|
476
|
+
var _e = class {
|
|
434
477
|
internalSize = 0;
|
|
435
478
|
head = null;
|
|
436
479
|
tail = null;
|
|
437
480
|
[Symbol.iterator]() {
|
|
438
|
-
return new
|
|
481
|
+
return new ve(this.head);
|
|
439
482
|
}
|
|
440
483
|
addFirst(e) {
|
|
441
484
|
let t = {
|
|
@@ -454,7 +497,7 @@ var he = class {
|
|
|
454
497
|
size() {
|
|
455
498
|
return this.internalSize;
|
|
456
499
|
}
|
|
457
|
-
},
|
|
500
|
+
}, ve = class extends p {
|
|
458
501
|
current;
|
|
459
502
|
constructor(e) {
|
|
460
503
|
super(), this.current = e;
|
|
@@ -466,13 +509,13 @@ var he = class {
|
|
|
466
509
|
};
|
|
467
510
|
//#endregion
|
|
468
511
|
//#region src/functions/materialize.ts
|
|
469
|
-
function
|
|
470
|
-
return l(e, "materialize"), e instanceof
|
|
512
|
+
function L(e) {
|
|
513
|
+
return l(e, "materialize"), e instanceof R ? e : new R(e);
|
|
471
514
|
}
|
|
472
|
-
var
|
|
515
|
+
var R = class {
|
|
473
516
|
source;
|
|
474
517
|
constructor(e) {
|
|
475
|
-
this.source =
|
|
518
|
+
this.source = ge(e);
|
|
476
519
|
}
|
|
477
520
|
[Symbol.iterator]() {
|
|
478
521
|
return this.source[Symbol.iterator]();
|
|
@@ -480,29 +523,29 @@ var I = class {
|
|
|
480
523
|
};
|
|
481
524
|
//#endregion
|
|
482
525
|
//#region src/functions/max.ts
|
|
483
|
-
function
|
|
526
|
+
function z(e, t) {
|
|
484
527
|
return l(e, "max"), a(e, i(t), 1);
|
|
485
528
|
}
|
|
486
529
|
//#endregion
|
|
487
530
|
//#region src/functions/memoize.ts
|
|
488
|
-
function
|
|
531
|
+
function B() {
|
|
489
532
|
return { allowPartialMemoization: !0 };
|
|
490
533
|
}
|
|
491
|
-
function
|
|
534
|
+
function V(e, t) {
|
|
492
535
|
l(e, "memoize");
|
|
493
536
|
let n = {
|
|
494
|
-
...
|
|
537
|
+
...B(),
|
|
495
538
|
...t
|
|
496
539
|
}.allowPartialMemoization;
|
|
497
|
-
return e instanceof
|
|
540
|
+
return e instanceof W ? n ? e.changePartialMemoizationBehaviour() : e : e instanceof G ? n ? e : e.changePartialMemoizationBehaviour() : n ? new G(e) : new W(e);
|
|
498
541
|
}
|
|
499
|
-
function
|
|
542
|
+
function H() {
|
|
500
543
|
return {
|
|
501
544
|
values: [],
|
|
502
545
|
finished: !1
|
|
503
546
|
};
|
|
504
547
|
}
|
|
505
|
-
function
|
|
548
|
+
function U(e, t) {
|
|
506
549
|
if (t.error) throw t.error.value;
|
|
507
550
|
if (t.finished) return !1;
|
|
508
551
|
t.source ??= e[Symbol.iterator]();
|
|
@@ -514,31 +557,31 @@ function V(e, t) {
|
|
|
514
557
|
}
|
|
515
558
|
return n.done === !0 ? (t.finished = !0, t.source = void 0, !1) : (t.values.push(n.value), !0);
|
|
516
559
|
}
|
|
517
|
-
var
|
|
560
|
+
var W = class {
|
|
518
561
|
source;
|
|
519
|
-
cache =
|
|
562
|
+
cache = H();
|
|
520
563
|
constructor(e) {
|
|
521
564
|
this.source = e;
|
|
522
565
|
}
|
|
523
566
|
[Symbol.iterator]() {
|
|
524
|
-
return new
|
|
567
|
+
return new K(this.source, this.cache, !0);
|
|
525
568
|
}
|
|
526
569
|
changePartialMemoizationBehaviour() {
|
|
527
|
-
return new
|
|
570
|
+
return new G(this.source);
|
|
528
571
|
}
|
|
529
|
-
},
|
|
572
|
+
}, G = class {
|
|
530
573
|
source;
|
|
531
|
-
cache =
|
|
574
|
+
cache = H();
|
|
532
575
|
constructor(e) {
|
|
533
576
|
this.source = e;
|
|
534
577
|
}
|
|
535
578
|
[Symbol.iterator]() {
|
|
536
|
-
return new
|
|
579
|
+
return new K(this.source, this.cache, !1);
|
|
537
580
|
}
|
|
538
581
|
changePartialMemoizationBehaviour() {
|
|
539
|
-
return new
|
|
582
|
+
return new W(this.source);
|
|
540
583
|
}
|
|
541
|
-
},
|
|
584
|
+
}, K = class extends p {
|
|
542
585
|
source;
|
|
543
586
|
cache;
|
|
544
587
|
drainFirst;
|
|
@@ -547,28 +590,43 @@ var H = class {
|
|
|
547
590
|
super(), this.source = e, this.cache = t, this.drainFirst = n;
|
|
548
591
|
}
|
|
549
592
|
advance() {
|
|
550
|
-
if (this.drainFirst) for (;
|
|
551
|
-
return this.index < this.cache.values.length ||
|
|
593
|
+
if (this.drainFirst) for (; U(this.source, this.cache););
|
|
594
|
+
return this.index < this.cache.values.length || U(this.source, this.cache) ? o(this.cache.values[this.index++]) : s();
|
|
552
595
|
}
|
|
553
596
|
};
|
|
554
597
|
//#endregion
|
|
555
598
|
//#region src/functions/min.ts
|
|
556
|
-
function
|
|
599
|
+
function q(e, t) {
|
|
557
600
|
return l(e, "min"), a(e, i(t), -1);
|
|
558
601
|
}
|
|
559
602
|
//#endregion
|
|
603
|
+
//#region src/functions/prepend.ts
|
|
604
|
+
function ye(e, t) {
|
|
605
|
+
return l(e, "prepend"), new m(() => new be(e, t));
|
|
606
|
+
}
|
|
607
|
+
var be = class extends h {
|
|
608
|
+
value;
|
|
609
|
+
valueYielded = !1;
|
|
610
|
+
constructor(e, t) {
|
|
611
|
+
super(e), this.value = t;
|
|
612
|
+
}
|
|
613
|
+
advance() {
|
|
614
|
+
return this.valueYielded ? this.source.next() : (this.valueYielded = !0, o(this.value));
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
//#endregion
|
|
560
618
|
//#region src/functions/range.ts
|
|
561
|
-
function
|
|
619
|
+
function J(e, t, n) {
|
|
562
620
|
let r = typeof t == "number", i = r ? e : 0, a = r ? t : e;
|
|
563
621
|
if (!r && n !== void 0) throw c("range", "The \"options\" parameter must be the second argument when \"start\" is omitted");
|
|
564
622
|
let o = r ? n : t;
|
|
565
|
-
o !== void 0 &&
|
|
623
|
+
o !== void 0 && te(o, "options", "range");
|
|
566
624
|
let { step: s = 1, reverse: l = !1 } = o ?? {};
|
|
567
|
-
|
|
568
|
-
let u =
|
|
569
|
-
return u.length > 0 ? new
|
|
625
|
+
ee(s, "step", "range");
|
|
626
|
+
let u = xe(i, a, Math.abs(s), l);
|
|
627
|
+
return u.length > 0 ? new m(() => new Se(u.first, u.step, u.length)) : b();
|
|
570
628
|
}
|
|
571
|
-
function
|
|
629
|
+
function xe(e, t, n, r) {
|
|
572
630
|
let i = t < e ? -n : n, a = Math.ceil(Math.abs(t - e) / n);
|
|
573
631
|
return r ? {
|
|
574
632
|
first: e + (a - 1) * i,
|
|
@@ -580,7 +638,7 @@ function _e(e, t, n, r) {
|
|
|
580
638
|
length: a
|
|
581
639
|
};
|
|
582
640
|
}
|
|
583
|
-
var
|
|
641
|
+
var Se = class extends p {
|
|
584
642
|
first;
|
|
585
643
|
step;
|
|
586
644
|
length;
|
|
@@ -594,15 +652,15 @@ var ve = class extends h {
|
|
|
594
652
|
};
|
|
595
653
|
//#endregion
|
|
596
654
|
//#region src/functions/reduce.ts
|
|
597
|
-
function
|
|
598
|
-
if (l(e, "reduce"), t.length === 1) return
|
|
655
|
+
function Y(e, ...t) {
|
|
656
|
+
if (l(e, "reduce"), t.length === 1) return Ce(e, t[0]);
|
|
599
657
|
let [n, r] = t;
|
|
600
658
|
u(r, "reducer", "reduce");
|
|
601
659
|
let i = n, a = 0;
|
|
602
660
|
for (let t of e) i = r(i, t, a++);
|
|
603
661
|
return i;
|
|
604
662
|
}
|
|
605
|
-
function
|
|
663
|
+
function Ce(e, t) {
|
|
606
664
|
u(t, "reducer", "reduce");
|
|
607
665
|
let n, r = 0;
|
|
608
666
|
for (let i of e) n = r === 0 ? i : t(n, i, r), r++;
|
|
@@ -611,17 +669,17 @@ function ye(e, t) {
|
|
|
611
669
|
}
|
|
612
670
|
//#endregion
|
|
613
671
|
//#region src/functions/repeat.ts
|
|
614
|
-
function
|
|
615
|
-
return
|
|
672
|
+
function we(e, t) {
|
|
673
|
+
return f(t, "count", "repeat"), g(t, (t) => t > 0 ? [e, t - 1] : void 0);
|
|
616
674
|
}
|
|
617
675
|
//#endregion
|
|
618
676
|
//#region src/functions/sequenceEqual.ts
|
|
619
|
-
function
|
|
677
|
+
function Te(e, t) {
|
|
620
678
|
return e === t;
|
|
621
679
|
}
|
|
622
|
-
function
|
|
680
|
+
function Ee(e, t, n) {
|
|
623
681
|
l(e, "sequenceEqual"), l(t, "sequenceEqual"), n !== void 0 && u(n, "equals", "sequenceEqual");
|
|
624
|
-
let r = n ??
|
|
682
|
+
let r = n ?? Te, i = t[Symbol.iterator](), a = !0;
|
|
625
683
|
try {
|
|
626
684
|
for (let t of e) {
|
|
627
685
|
a = !1;
|
|
@@ -635,7 +693,7 @@ function xe(e, t, n) {
|
|
|
635
693
|
}
|
|
636
694
|
//#endregion
|
|
637
695
|
//#region src/functions/single.ts
|
|
638
|
-
function
|
|
696
|
+
function De(e, t) {
|
|
639
697
|
l(e, "single");
|
|
640
698
|
let n = !1, r;
|
|
641
699
|
if (t === void 0) {
|
|
@@ -655,10 +713,10 @@ function Se(e, t) {
|
|
|
655
713
|
}
|
|
656
714
|
//#endregion
|
|
657
715
|
//#region src/functions/skip.ts
|
|
658
|
-
function
|
|
659
|
-
return l(e, "skip"),
|
|
716
|
+
function Oe(e, t) {
|
|
717
|
+
return l(e, "skip"), f(t, "count", "skip"), new m(() => new ke(e, t));
|
|
660
718
|
}
|
|
661
|
-
var
|
|
719
|
+
var ke = class extends h {
|
|
662
720
|
count;
|
|
663
721
|
constructor(e, t) {
|
|
664
722
|
super(e), this.count = t;
|
|
@@ -674,10 +732,10 @@ var we = class extends _ {
|
|
|
674
732
|
};
|
|
675
733
|
//#endregion
|
|
676
734
|
//#region src/functions/skipWhile.ts
|
|
677
|
-
function
|
|
678
|
-
return l(e, "skipWhile"), u(t, "predicate", "skipWhile"), new
|
|
735
|
+
function Ae(e, t) {
|
|
736
|
+
return l(e, "skipWhile"), u(t, "predicate", "skipWhile"), new m(() => new je(e, t));
|
|
679
737
|
}
|
|
680
|
-
var
|
|
738
|
+
var je = class extends h {
|
|
681
739
|
predicate;
|
|
682
740
|
skipping = !0;
|
|
683
741
|
constructor(e, t) {
|
|
@@ -698,8 +756,83 @@ var Ee = class extends _ {
|
|
|
698
756
|
}
|
|
699
757
|
};
|
|
700
758
|
//#endregion
|
|
759
|
+
//#region src/functions/slice.ts
|
|
760
|
+
function Me(e, t, n) {
|
|
761
|
+
l(e, "slice"), t !== void 0 && d(t, "start", "slice"), n !== void 0 && d(n, "end", "slice");
|
|
762
|
+
let r = t ?? 0;
|
|
763
|
+
if (r < 0) return new m(() => new Fe(e, -r, n));
|
|
764
|
+
if (n !== void 0 && n < 0) return new m(() => new Pe(e, r, -n));
|
|
765
|
+
let i = n === void 0 ? Infinity : n > r ? n : 0;
|
|
766
|
+
return new m(() => new Ne(e, r, i));
|
|
767
|
+
}
|
|
768
|
+
var Ne = class extends h {
|
|
769
|
+
start;
|
|
770
|
+
end;
|
|
771
|
+
constructor(e, t, n) {
|
|
772
|
+
super(e), this.start = t, this.end = n;
|
|
773
|
+
}
|
|
774
|
+
advance() {
|
|
775
|
+
if (this.index >= this.end) return this.source.return?.(), s();
|
|
776
|
+
for (; this.index < this.start;) {
|
|
777
|
+
let e = this.source.next();
|
|
778
|
+
if (e.done === !0) return e;
|
|
779
|
+
this.index++;
|
|
780
|
+
}
|
|
781
|
+
let e = this.source.next();
|
|
782
|
+
return e.done !== !0 && this.index++, e;
|
|
783
|
+
}
|
|
784
|
+
}, Pe = class extends h {
|
|
785
|
+
start;
|
|
786
|
+
size;
|
|
787
|
+
buffer = [];
|
|
788
|
+
position = 0;
|
|
789
|
+
full = !1;
|
|
790
|
+
constructor(e, t, n) {
|
|
791
|
+
super(e), this.start = t, this.size = n;
|
|
792
|
+
}
|
|
793
|
+
advance() {
|
|
794
|
+
for (; this.index < this.start;) {
|
|
795
|
+
let e = this.source.next();
|
|
796
|
+
if (e.done === !0) return e;
|
|
797
|
+
this.index++;
|
|
798
|
+
}
|
|
799
|
+
for (let e = this.source.next(); e.done !== !0; e = this.source.next()) {
|
|
800
|
+
if (this.full) {
|
|
801
|
+
let t = this.buffer[this.position];
|
|
802
|
+
return this.store(e.value), o(t);
|
|
803
|
+
}
|
|
804
|
+
this.store(e.value);
|
|
805
|
+
}
|
|
806
|
+
return s();
|
|
807
|
+
}
|
|
808
|
+
store(e) {
|
|
809
|
+
this.buffer[this.position] = e, ++this.position === this.size && (this.position = 0, this.full = !0);
|
|
810
|
+
}
|
|
811
|
+
}, Fe = class extends h {
|
|
812
|
+
size;
|
|
813
|
+
end;
|
|
814
|
+
buffer;
|
|
815
|
+
position = 0;
|
|
816
|
+
remaining = 0;
|
|
817
|
+
constructor(e, t, n) {
|
|
818
|
+
super(e), this.size = t, this.end = n;
|
|
819
|
+
}
|
|
820
|
+
advance() {
|
|
821
|
+
if (this.buffer ??= this.fill(), this.remaining === 0) return this.buffer = [], s();
|
|
822
|
+
this.remaining--;
|
|
823
|
+
let e = this.buffer[this.position];
|
|
824
|
+
return ++this.position === this.buffer.length && (this.position = 0), o(e);
|
|
825
|
+
}
|
|
826
|
+
fill() {
|
|
827
|
+
let e = [], t = 0, n = 0;
|
|
828
|
+
for (let r = this.source.next(); r.done !== !0; r = this.source.next()) e[n] = r.value, t++, ++n === this.size && (n = 0);
|
|
829
|
+
let r = this.end === void 0 ? t : this.end < 0 ? Math.max(t + this.end, 0) : Math.min(this.end, t);
|
|
830
|
+
return this.position = t > this.size ? n : 0, this.remaining = Math.max(r - (t - e.length), 0), e;
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
//#endregion
|
|
701
834
|
//#region src/functions/some.ts
|
|
702
|
-
function
|
|
835
|
+
function Ie(e, t) {
|
|
703
836
|
if (l(e, "some"), t === void 0) {
|
|
704
837
|
for (let t of e) return !0;
|
|
705
838
|
return !1;
|
|
@@ -711,7 +844,7 @@ function De(e, t) {
|
|
|
711
844
|
}
|
|
712
845
|
//#endregion
|
|
713
846
|
//#region src/functions/sum.ts
|
|
714
|
-
function
|
|
847
|
+
function Le(e, t) {
|
|
715
848
|
l(e, "sum");
|
|
716
849
|
let n = 0;
|
|
717
850
|
if (t === void 0) {
|
|
@@ -725,10 +858,10 @@ function Oe(e, t) {
|
|
|
725
858
|
}
|
|
726
859
|
//#endregion
|
|
727
860
|
//#region src/functions/take.ts
|
|
728
|
-
function
|
|
729
|
-
return l(e, "take"),
|
|
861
|
+
function Re(e, t) {
|
|
862
|
+
return l(e, "take"), f(t, "count", "take"), new m(() => new ze(e, t));
|
|
730
863
|
}
|
|
731
|
-
var
|
|
864
|
+
var ze = class extends h {
|
|
732
865
|
count;
|
|
733
866
|
constructor(e, t) {
|
|
734
867
|
super(e), this.count = t;
|
|
@@ -741,10 +874,10 @@ var Ae = class extends _ {
|
|
|
741
874
|
};
|
|
742
875
|
//#endregion
|
|
743
876
|
//#region src/functions/takeWhile.ts
|
|
744
|
-
function
|
|
745
|
-
return l(e, "takeWhile"), u(t, "predicate", "takeWhile"), new
|
|
877
|
+
function Be(e, t) {
|
|
878
|
+
return l(e, "takeWhile"), u(t, "predicate", "takeWhile"), new m(() => new Ve(e, t));
|
|
746
879
|
}
|
|
747
|
-
var
|
|
880
|
+
var Ve = class extends h {
|
|
748
881
|
predicate;
|
|
749
882
|
constructor(e, t) {
|
|
750
883
|
super(e), this.predicate = t;
|
|
@@ -763,10 +896,10 @@ var Me = class extends _ {
|
|
|
763
896
|
};
|
|
764
897
|
//#endregion
|
|
765
898
|
//#region src/functions/tap.ts
|
|
766
|
-
function
|
|
767
|
-
return l(e, "tap"), u(t, "tapper", "tap"), new
|
|
899
|
+
function He(e, t) {
|
|
900
|
+
return l(e, "tap"), u(t, "tapper", "tap"), new m(() => new Ue(e, t));
|
|
768
901
|
}
|
|
769
|
-
var
|
|
902
|
+
var Ue = class extends h {
|
|
770
903
|
tapper;
|
|
771
904
|
constructor(e, t) {
|
|
772
905
|
super(e), this.tapper = t;
|
|
@@ -784,57 +917,61 @@ var Pe = class extends _ {
|
|
|
784
917
|
};
|
|
785
918
|
//#endregion
|
|
786
919
|
//#region src/functions/tapChain.ts
|
|
787
|
-
function
|
|
788
|
-
return l(e, "tapChain"), u(t, "tapper", "tapChain"), new
|
|
920
|
+
function We(e, t) {
|
|
921
|
+
return l(e, "tapChain"), u(t, "tapper", "tapChain"), new m(() => (t(e, 0), e[Symbol.iterator]()));
|
|
789
922
|
}
|
|
790
923
|
//#endregion
|
|
791
924
|
//#region src/functions/index.ts
|
|
792
|
-
var
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
925
|
+
var Ge = /* @__PURE__ */ t({
|
|
926
|
+
append: () => ie,
|
|
927
|
+
at: () => oe,
|
|
928
|
+
average: () => le,
|
|
929
|
+
collectToArray: () => ue,
|
|
930
|
+
concat: () => _,
|
|
931
|
+
count: () => v,
|
|
932
|
+
distinct: () => y,
|
|
933
|
+
empty: () => b,
|
|
934
|
+
every: () => x,
|
|
935
|
+
filter: () => S,
|
|
936
|
+
find: () => C,
|
|
937
|
+
findIndex: () => w,
|
|
938
|
+
findLast: () => T,
|
|
939
|
+
findLastIndex: () => E,
|
|
940
|
+
flatMap: () => D,
|
|
941
|
+
forEach: () => A,
|
|
942
|
+
forEachAsync: () => j,
|
|
943
|
+
getMemoizeDefaultOptions: () => B,
|
|
944
|
+
includes: () => M,
|
|
945
|
+
indexOf: () => N,
|
|
946
|
+
join: () => P,
|
|
947
|
+
lastIndexOf: () => F,
|
|
948
|
+
map: () => I,
|
|
949
|
+
materialize: () => L,
|
|
950
|
+
max: () => z,
|
|
951
|
+
memoize: () => V,
|
|
952
|
+
min: () => q,
|
|
953
|
+
prepend: () => ye,
|
|
954
|
+
range: () => J,
|
|
955
|
+
reduce: () => Y,
|
|
956
|
+
repeat: () => we,
|
|
957
|
+
sequenceEqual: () => Ee,
|
|
958
|
+
single: () => De,
|
|
959
|
+
skip: () => Oe,
|
|
960
|
+
skipWhile: () => Ae,
|
|
961
|
+
slice: () => Me,
|
|
962
|
+
some: () => Ie,
|
|
963
|
+
sum: () => Le,
|
|
964
|
+
take: () => Re,
|
|
965
|
+
takeWhile: () => Be,
|
|
966
|
+
tap: () => He,
|
|
967
|
+
tapChain: () => We
|
|
968
|
+
}), Ke = Symbol.for("iterable-linq-utility.IIterableLinq");
|
|
832
969
|
//#endregion
|
|
833
970
|
//#region src/linqIterable.ts
|
|
834
|
-
function
|
|
835
|
-
return new
|
|
971
|
+
function X(e) {
|
|
972
|
+
return new Z(e);
|
|
836
973
|
}
|
|
837
|
-
var
|
|
974
|
+
var Z = class {
|
|
838
975
|
iterable;
|
|
839
976
|
constructor(e) {
|
|
840
977
|
this.iterable = e;
|
|
@@ -842,107 +979,119 @@ var X = class {
|
|
|
842
979
|
[Symbol.iterator]() {
|
|
843
980
|
return this.iterable[Symbol.iterator]();
|
|
844
981
|
}
|
|
982
|
+
append(e) {
|
|
983
|
+
return X(ie(this.iterable, e));
|
|
984
|
+
}
|
|
845
985
|
at(e) {
|
|
846
|
-
return
|
|
986
|
+
return oe(this.iterable, e);
|
|
847
987
|
}
|
|
848
988
|
average(e) {
|
|
849
|
-
return
|
|
989
|
+
return le(this.iterable, e);
|
|
850
990
|
}
|
|
851
991
|
collectToArray() {
|
|
852
|
-
return
|
|
992
|
+
return ue(this.iterable);
|
|
993
|
+
}
|
|
994
|
+
concat(...e) {
|
|
995
|
+
return X(_(this.iterable, ...e));
|
|
853
996
|
}
|
|
854
997
|
count(e) {
|
|
855
|
-
return
|
|
998
|
+
return v(this.iterable, e);
|
|
856
999
|
}
|
|
857
1000
|
distinct(e) {
|
|
858
|
-
return
|
|
1001
|
+
return X(y(this.iterable, e));
|
|
859
1002
|
}
|
|
860
1003
|
every(e) {
|
|
861
|
-
return
|
|
1004
|
+
return x(this.iterable, e);
|
|
862
1005
|
}
|
|
863
1006
|
filter(e) {
|
|
864
|
-
return
|
|
1007
|
+
return X(S(this.iterable, e));
|
|
865
1008
|
}
|
|
866
1009
|
find(e) {
|
|
867
|
-
return
|
|
1010
|
+
return C(this.iterable, e);
|
|
868
1011
|
}
|
|
869
1012
|
findIndex(e) {
|
|
870
|
-
return
|
|
1013
|
+
return w(this.iterable, e);
|
|
871
1014
|
}
|
|
872
1015
|
findLast(e) {
|
|
873
|
-
return
|
|
1016
|
+
return T(this.iterable, e);
|
|
874
1017
|
}
|
|
875
1018
|
findLastIndex(e) {
|
|
876
|
-
return
|
|
1019
|
+
return E(this.iterable, e);
|
|
877
1020
|
}
|
|
878
1021
|
flatMap(e) {
|
|
879
|
-
return
|
|
1022
|
+
return X(D(this.iterable, e));
|
|
880
1023
|
}
|
|
881
1024
|
forEach(e) {
|
|
882
|
-
return
|
|
1025
|
+
return A(this.iterable, e);
|
|
883
1026
|
}
|
|
884
1027
|
forEachAsync(e) {
|
|
885
|
-
return
|
|
1028
|
+
return j(this.iterable, e);
|
|
886
1029
|
}
|
|
887
1030
|
includes(e) {
|
|
888
|
-
return
|
|
1031
|
+
return M(this.iterable, e);
|
|
889
1032
|
}
|
|
890
1033
|
indexOf(e) {
|
|
891
|
-
return
|
|
1034
|
+
return N(this.iterable, e);
|
|
892
1035
|
}
|
|
893
1036
|
join(e) {
|
|
894
|
-
return
|
|
1037
|
+
return P(this.iterable, e);
|
|
895
1038
|
}
|
|
896
1039
|
lastIndexOf(e) {
|
|
897
|
-
return
|
|
1040
|
+
return F(this.iterable, e);
|
|
898
1041
|
}
|
|
899
1042
|
map(e) {
|
|
900
|
-
return
|
|
1043
|
+
return X(I(this.iterable, e));
|
|
901
1044
|
}
|
|
902
1045
|
materialize() {
|
|
903
|
-
return
|
|
1046
|
+
return X(L(this.iterable));
|
|
904
1047
|
}
|
|
905
1048
|
max(e) {
|
|
906
|
-
return
|
|
1049
|
+
return z(this.iterable, e);
|
|
907
1050
|
}
|
|
908
1051
|
memoize(e) {
|
|
909
|
-
return
|
|
1052
|
+
return X(V(this.iterable, e));
|
|
910
1053
|
}
|
|
911
1054
|
min(e) {
|
|
912
|
-
return
|
|
1055
|
+
return q(this.iterable, e);
|
|
1056
|
+
}
|
|
1057
|
+
prepend(e) {
|
|
1058
|
+
return X(ye(this.iterable, e));
|
|
913
1059
|
}
|
|
914
1060
|
reduce(...e) {
|
|
915
|
-
return e.length === 1 ?
|
|
1061
|
+
return e.length === 1 ? Y(this.iterable, e[0]) : Y(this.iterable, e[0], e[1]);
|
|
916
1062
|
}
|
|
917
1063
|
sequenceEqual(e, t) {
|
|
918
|
-
return
|
|
1064
|
+
return Ee(this.iterable, e, t);
|
|
919
1065
|
}
|
|
920
1066
|
single(e) {
|
|
921
|
-
return
|
|
1067
|
+
return De(this.iterable, e);
|
|
922
1068
|
}
|
|
923
1069
|
skip(e) {
|
|
924
|
-
return
|
|
1070
|
+
return X(Oe(this.iterable, e));
|
|
925
1071
|
}
|
|
926
1072
|
skipWhile(e) {
|
|
927
|
-
return
|
|
1073
|
+
return X(Ae(this.iterable, e));
|
|
1074
|
+
}
|
|
1075
|
+
slice(e, t) {
|
|
1076
|
+
return X(Me(this.iterable, e, t));
|
|
928
1077
|
}
|
|
929
1078
|
some(e) {
|
|
930
|
-
return
|
|
1079
|
+
return Ie(this.iterable, e);
|
|
931
1080
|
}
|
|
932
1081
|
sum(e) {
|
|
933
|
-
return
|
|
1082
|
+
return Le(this.iterable, e);
|
|
934
1083
|
}
|
|
935
1084
|
take(e) {
|
|
936
|
-
return
|
|
1085
|
+
return X(Re(this.iterable, e));
|
|
937
1086
|
}
|
|
938
1087
|
takeWhile(e) {
|
|
939
|
-
return
|
|
1088
|
+
return X(Be(this.iterable, e));
|
|
940
1089
|
}
|
|
941
1090
|
tap(e) {
|
|
942
|
-
return
|
|
1091
|
+
return X(He(this.iterable, e));
|
|
943
1092
|
}
|
|
944
1093
|
tapChain(e) {
|
|
945
|
-
return
|
|
1094
|
+
return X(We(this.iterable, e));
|
|
946
1095
|
}
|
|
947
1096
|
tapChainCreation(e) {
|
|
948
1097
|
u(e, "chainCreationTapper", "tapChainCreation");
|
|
@@ -950,7 +1099,7 @@ var X = class {
|
|
|
950
1099
|
return e(t), t;
|
|
951
1100
|
}
|
|
952
1101
|
};
|
|
953
|
-
Object.defineProperty(
|
|
1102
|
+
Object.defineProperty(Z.prototype, Ke, {
|
|
954
1103
|
value: !0,
|
|
955
1104
|
enumerable: !1,
|
|
956
1105
|
writable: !1,
|
|
@@ -958,49 +1107,49 @@ Object.defineProperty(X.prototype, Le, {
|
|
|
958
1107
|
});
|
|
959
1108
|
//#endregion
|
|
960
1109
|
//#region src/extension.ts
|
|
961
|
-
function
|
|
962
|
-
return
|
|
1110
|
+
function Q() {
|
|
1111
|
+
return Z.prototype;
|
|
963
1112
|
}
|
|
964
|
-
function
|
|
965
|
-
return typeof e == "object" && !!e && e[
|
|
1113
|
+
function qe(e) {
|
|
1114
|
+
return typeof e == "object" && !!e && e[Ke] === !0;
|
|
966
1115
|
}
|
|
967
|
-
function
|
|
968
|
-
let n = Object.getOwnPropertyDescriptor(
|
|
969
|
-
Object.defineProperty(
|
|
1116
|
+
function Je(e, t) {
|
|
1117
|
+
let n = Object.getOwnPropertyDescriptor(Q(), e);
|
|
1118
|
+
Object.defineProperty(Q(), e, {
|
|
970
1119
|
value: t,
|
|
971
1120
|
enumerable: !1,
|
|
972
1121
|
writable: n?.writable ?? !1,
|
|
973
1122
|
configurable: !0
|
|
974
1123
|
});
|
|
975
1124
|
}
|
|
976
|
-
function
|
|
977
|
-
|
|
1125
|
+
function Ye(e, t, n) {
|
|
1126
|
+
ne(t, "name", e), u(n, "implementation", e);
|
|
978
1127
|
}
|
|
979
|
-
function
|
|
980
|
-
if (
|
|
981
|
-
|
|
1128
|
+
function Xe(e, t) {
|
|
1129
|
+
if (Ye("extend", e, t), e in X([])) throw c("extend", `"${e}" already exists on IIterableLinq: use override() to replace it`);
|
|
1130
|
+
Je(e, t);
|
|
982
1131
|
}
|
|
983
|
-
function
|
|
984
|
-
|
|
1132
|
+
function Ze(e, t) {
|
|
1133
|
+
Ye("override", e, t);
|
|
985
1134
|
let n = e;
|
|
986
|
-
if (!(n !== "constructor" && Object.prototype.hasOwnProperty.call(
|
|
987
|
-
|
|
1135
|
+
if (!(n !== "constructor" && Object.prototype.hasOwnProperty.call(Q(), n))) throw c("override", `"${n}" is not a method of IIterableLinq: use extend() to add it`);
|
|
1136
|
+
Je(n, t);
|
|
988
1137
|
}
|
|
989
1138
|
//#endregion
|
|
990
1139
|
//#region src/index.ts
|
|
991
|
-
function
|
|
992
|
-
return $(
|
|
1140
|
+
function Qe() {
|
|
1141
|
+
return $(b());
|
|
993
1142
|
}
|
|
994
1143
|
function $(e) {
|
|
995
|
-
return l(e, "from"),
|
|
1144
|
+
return l(e, "from"), X(e);
|
|
996
1145
|
}
|
|
997
|
-
function
|
|
998
|
-
if (typeof t == "number") return $(
|
|
1146
|
+
function $e(e, t, n) {
|
|
1147
|
+
if (typeof t == "number") return $(J(e, t, n));
|
|
999
1148
|
if (n !== void 0) throw c("fromRange", "The \"options\" parameter must be the second argument when \"start\" is omitted");
|
|
1000
|
-
return $(K(e, t));
|
|
1001
|
-
}
|
|
1002
|
-
function We(e, t) {
|
|
1003
1149
|
return $(J(e, t));
|
|
1004
1150
|
}
|
|
1151
|
+
function et(e, t) {
|
|
1152
|
+
return $(we(e, t));
|
|
1153
|
+
}
|
|
1005
1154
|
//#endregion
|
|
1006
|
-
export {
|
|
1155
|
+
export { Ge as Functions, O as Unit, Qe as empty, Xe as extend, $ as from, $e as fromRange, qe as isIterableLinq, Ze as override, et as repeat, k as unit };
|