iterable-linq-utility 0.7.0 → 0.9.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/README.md +35 -12
- package/dist/index.d.cts +224 -0
- package/dist/index.d.ts +224 -0
- package/dist/iterable-linq-utility.js +420 -230
- package/dist/iterable-linq-utility.umd.cjs +1 -1
- package/package.json +2 -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 re(e, t) {
|
|
125
|
+
return new m(() => new ie(e, t));
|
|
174
126
|
}
|
|
175
|
-
var
|
|
127
|
+
var ie = 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
|
|
139
|
+
//#region src/functions/append.ts
|
|
140
|
+
function ae(e, t) {
|
|
141
|
+
return l(e, "append"), new m(() => new oe(e, t));
|
|
142
|
+
}
|
|
143
|
+
var oe = 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 se(e, t) {
|
|
158
|
+
return l(e, "at"), d(t, "index", "at"), t >= 0 ? ce(e, t) : le(e, -t);
|
|
159
|
+
}
|
|
160
|
+
function ce(e, t) {
|
|
161
|
+
let n = 0;
|
|
162
|
+
for (let r of e) if (n++ === t) return r;
|
|
163
|
+
}
|
|
164
|
+
function le(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 ue(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 g(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 de(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 fe(n));
|
|
196
|
+
}
|
|
197
|
+
var fe = 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
|
|
217
|
+
function _(e, t) {
|
|
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;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
187
230
|
//#region src/functions/distinct.ts
|
|
188
231
|
function v(e, t) {
|
|
189
|
-
return l(e, "distinct"), t !== void 0 && u(t, "keySelector", "distinct"), new
|
|
232
|
+
return l(e, "distinct"), t !== void 0 && u(t, "keySelector", "distinct"), new m(() => new pe(e, t));
|
|
190
233
|
}
|
|
191
|
-
var
|
|
234
|
+
var pe = class extends h {
|
|
192
235
|
keySelector;
|
|
193
236
|
seen = /* @__PURE__ */ new Set();
|
|
194
237
|
constructor(e, t) {
|
|
@@ -210,11 +253,11 @@ var le = class extends _ {
|
|
|
210
253
|
//#endregion
|
|
211
254
|
//#region src/functions/empty.ts
|
|
212
255
|
function y() {
|
|
213
|
-
return
|
|
256
|
+
return re(void 0, () => void 0);
|
|
214
257
|
}
|
|
215
258
|
//#endregion
|
|
216
259
|
//#region src/functions/every.ts
|
|
217
|
-
function
|
|
260
|
+
function b(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 x(e, t) {
|
|
269
|
+
return l(e, "filter"), u(t, "predicate", "filter"), new m(() => new me(e, t));
|
|
227
270
|
}
|
|
228
|
-
var
|
|
271
|
+
var me = 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 S(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 C(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 w(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 T(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 E(e, t) {
|
|
326
|
+
return l(e, "flatMap"), u(t, "mapper", "flatMap"), new m(() => new he(e, t));
|
|
284
327
|
}
|
|
285
|
-
var
|
|
328
|
+
var he = 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
|
+
}, D = 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 O() {
|
|
398
|
+
return D.instance;
|
|
356
399
|
}
|
|
357
400
|
//#endregion
|
|
358
401
|
//#region src/functions/forEach.ts
|
|
359
|
-
function
|
|
402
|
+
function k(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 O();
|
|
364
407
|
}
|
|
365
|
-
async function
|
|
408
|
+
async function A(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 O();
|
|
370
413
|
}
|
|
371
414
|
//#endregion
|
|
372
415
|
//#region src/functions/includes.ts
|
|
373
|
-
function
|
|
416
|
+
function j(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 M(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 N(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 P(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 F(e, t) {
|
|
449
|
+
return l(e, "map"), u(t, "mapper", "map"), new m(() => new ge(e, t));
|
|
407
450
|
}
|
|
408
|
-
var
|
|
451
|
+
var ge = 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 _e(e) {
|
|
428
471
|
l(e, "LinkedList.from");
|
|
429
|
-
let t = new
|
|
472
|
+
let t = new I();
|
|
430
473
|
for (let n of e) t.addLast(n);
|
|
431
474
|
return t;
|
|
432
475
|
}
|
|
433
|
-
var
|
|
476
|
+
var I = 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 = _e(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 ye(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 ye(this.source, this.cache, !1);
|
|
537
580
|
}
|
|
538
581
|
changePartialMemoizationBehaviour() {
|
|
539
|
-
return new
|
|
582
|
+
return new W(this.source);
|
|
540
583
|
}
|
|
541
|
-
},
|
|
584
|
+
}, ye = 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 be(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 xe(e, t) {
|
|
605
|
+
return l(e, "prepend"), new m(() => new Se(e, t));
|
|
606
|
+
}
|
|
607
|
+
var Se = 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
619
|
function K(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 = Ce(i, a, Math.abs(s), l);
|
|
627
|
+
return u.length > 0 ? new m(() => new we(u.first, u.step, u.length)) : y();
|
|
570
628
|
}
|
|
571
|
-
function
|
|
629
|
+
function Ce(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 we = class extends p {
|
|
584
642
|
first;
|
|
585
643
|
step;
|
|
586
644
|
length;
|
|
@@ -595,14 +653,14 @@ var ve = class extends h {
|
|
|
595
653
|
//#endregion
|
|
596
654
|
//#region src/functions/reduce.ts
|
|
597
655
|
function q(e, ...t) {
|
|
598
|
-
if (l(e, "reduce"), t.length === 1) return
|
|
656
|
+
if (l(e, "reduce"), t.length === 1) return Te(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 Te(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,36 @@ function ye(e, t) {
|
|
|
611
669
|
}
|
|
612
670
|
//#endregion
|
|
613
671
|
//#region src/functions/repeat.ts
|
|
614
|
-
function
|
|
615
|
-
return
|
|
672
|
+
function Ee(e, t) {
|
|
673
|
+
return f(t, "count", "repeat"), re(t, (t) => t > 0 ? [e, t - 1] : void 0);
|
|
616
674
|
}
|
|
617
675
|
//#endregion
|
|
676
|
+
//#region src/functions/reverse.ts
|
|
677
|
+
function De(e) {
|
|
678
|
+
return l(e, "reverse"), new m(() => new Oe(e));
|
|
679
|
+
}
|
|
680
|
+
var Oe = class extends h {
|
|
681
|
+
reversed;
|
|
682
|
+
advance() {
|
|
683
|
+
return this.reversed ??= this.fill(), this.reversed.next();
|
|
684
|
+
}
|
|
685
|
+
onReturn(e) {
|
|
686
|
+
this.reversed = void 0, super.onReturn(e);
|
|
687
|
+
}
|
|
688
|
+
fill() {
|
|
689
|
+
let e = new I();
|
|
690
|
+
for (let t = this.source.next(); t.done !== !0; t = this.source.next()) e.addFirst(t.value);
|
|
691
|
+
return e[Symbol.iterator]();
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
//#endregion
|
|
618
695
|
//#region src/functions/sequenceEqual.ts
|
|
619
|
-
function
|
|
696
|
+
function ke(e, t) {
|
|
620
697
|
return e === t;
|
|
621
698
|
}
|
|
622
|
-
function
|
|
699
|
+
function Ae(e, t, n) {
|
|
623
700
|
l(e, "sequenceEqual"), l(t, "sequenceEqual"), n !== void 0 && u(n, "equals", "sequenceEqual");
|
|
624
|
-
let r = n ??
|
|
701
|
+
let r = n ?? ke, i = t[Symbol.iterator](), a = !0;
|
|
625
702
|
try {
|
|
626
703
|
for (let t of e) {
|
|
627
704
|
a = !1;
|
|
@@ -635,7 +712,7 @@ function xe(e, t, n) {
|
|
|
635
712
|
}
|
|
636
713
|
//#endregion
|
|
637
714
|
//#region src/functions/single.ts
|
|
638
|
-
function
|
|
715
|
+
function je(e, t) {
|
|
639
716
|
l(e, "single");
|
|
640
717
|
let n = !1, r;
|
|
641
718
|
if (t === void 0) {
|
|
@@ -655,10 +732,10 @@ function Se(e, t) {
|
|
|
655
732
|
}
|
|
656
733
|
//#endregion
|
|
657
734
|
//#region src/functions/skip.ts
|
|
658
|
-
function
|
|
659
|
-
return l(e, "skip"),
|
|
735
|
+
function Me(e, t) {
|
|
736
|
+
return l(e, "skip"), f(t, "count", "skip"), new m(() => new Ne(e, t));
|
|
660
737
|
}
|
|
661
|
-
var
|
|
738
|
+
var Ne = class extends h {
|
|
662
739
|
count;
|
|
663
740
|
constructor(e, t) {
|
|
664
741
|
super(e), this.count = t;
|
|
@@ -673,11 +750,91 @@ var we = class extends _ {
|
|
|
673
750
|
}
|
|
674
751
|
};
|
|
675
752
|
//#endregion
|
|
753
|
+
//#region src/functions/slice.ts
|
|
754
|
+
function J(e, t, n) {
|
|
755
|
+
l(e, "slice"), t !== void 0 && d(t, "start", "slice"), n !== void 0 && d(n, "end", "slice");
|
|
756
|
+
let r = t ?? 0;
|
|
757
|
+
if (r < 0) return new m(() => new Ie(e, -r, n));
|
|
758
|
+
if (n !== void 0 && n < 0) return new m(() => new Fe(e, r, -n));
|
|
759
|
+
let i = n === void 0 ? Infinity : n > r ? n : 0;
|
|
760
|
+
return new m(() => new Pe(e, r, i));
|
|
761
|
+
}
|
|
762
|
+
var Pe = class extends h {
|
|
763
|
+
start;
|
|
764
|
+
end;
|
|
765
|
+
constructor(e, t, n) {
|
|
766
|
+
super(e), this.start = t, this.end = n;
|
|
767
|
+
}
|
|
768
|
+
advance() {
|
|
769
|
+
if (this.index >= this.end) return this.source.return?.(), s();
|
|
770
|
+
for (; this.index < this.start;) {
|
|
771
|
+
let e = this.source.next();
|
|
772
|
+
if (e.done === !0) return e;
|
|
773
|
+
this.index++;
|
|
774
|
+
}
|
|
775
|
+
let e = this.source.next();
|
|
776
|
+
return e.done !== !0 && this.index++, e;
|
|
777
|
+
}
|
|
778
|
+
}, Fe = class extends h {
|
|
779
|
+
start;
|
|
780
|
+
size;
|
|
781
|
+
buffer = [];
|
|
782
|
+
position = 0;
|
|
783
|
+
full = !1;
|
|
784
|
+
constructor(e, t, n) {
|
|
785
|
+
super(e), this.start = t, this.size = n;
|
|
786
|
+
}
|
|
787
|
+
advance() {
|
|
788
|
+
for (; this.index < this.start;) {
|
|
789
|
+
let e = this.source.next();
|
|
790
|
+
if (e.done === !0) return e;
|
|
791
|
+
this.index++;
|
|
792
|
+
}
|
|
793
|
+
for (let e = this.source.next(); e.done !== !0; e = this.source.next()) {
|
|
794
|
+
if (this.full) {
|
|
795
|
+
let t = this.buffer[this.position];
|
|
796
|
+
return this.store(e.value), o(t);
|
|
797
|
+
}
|
|
798
|
+
this.store(e.value);
|
|
799
|
+
}
|
|
800
|
+
return s();
|
|
801
|
+
}
|
|
802
|
+
store(e) {
|
|
803
|
+
this.buffer[this.position] = e, ++this.position === this.size && (this.position = 0, this.full = !0);
|
|
804
|
+
}
|
|
805
|
+
}, Ie = class extends h {
|
|
806
|
+
size;
|
|
807
|
+
end;
|
|
808
|
+
buffer;
|
|
809
|
+
position = 0;
|
|
810
|
+
remaining = 0;
|
|
811
|
+
constructor(e, t, n) {
|
|
812
|
+
super(e), this.size = t, this.end = n;
|
|
813
|
+
}
|
|
814
|
+
advance() {
|
|
815
|
+
if (this.buffer ??= this.fill(), this.remaining === 0) return this.buffer = [], s();
|
|
816
|
+
this.remaining--;
|
|
817
|
+
let e = this.buffer[this.position];
|
|
818
|
+
return ++this.position === this.buffer.length && (this.position = 0), o(e);
|
|
819
|
+
}
|
|
820
|
+
fill() {
|
|
821
|
+
let e = [], t = 0, n = 0;
|
|
822
|
+
for (let r = this.source.next(); r.done !== !0; r = this.source.next()) e[n] = r.value, t++, ++n === this.size && (n = 0);
|
|
823
|
+
let r = this.end === void 0 ? t : this.end < 0 ? Math.max(t + this.end, 0) : Math.min(this.end, t);
|
|
824
|
+
return this.position = t > this.size ? n : 0, this.remaining = Math.max(r - (t - e.length), 0), e;
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region src/functions/skipLast.ts
|
|
829
|
+
function Le(e, t) {
|
|
830
|
+
return l(e, "skipLast"), f(t, "count", "skipLast"), t === 0 ? J(e) : J(e, 0, -t);
|
|
831
|
+
}
|
|
832
|
+
//#endregion
|
|
676
833
|
//#region src/functions/skipWhile.ts
|
|
677
|
-
function
|
|
678
|
-
return l(e, "skipWhile"), u(t, "predicate", "skipWhile"), new
|
|
834
|
+
function Re(e, t) {
|
|
835
|
+
return l(e, "skipWhile"), u(t, "predicate", "skipWhile"), new m(() => new ze(e, t));
|
|
679
836
|
}
|
|
680
|
-
var
|
|
837
|
+
var ze = class extends h {
|
|
681
838
|
predicate;
|
|
682
839
|
skipping = !0;
|
|
683
840
|
constructor(e, t) {
|
|
@@ -699,7 +856,7 @@ var Ee = class extends _ {
|
|
|
699
856
|
};
|
|
700
857
|
//#endregion
|
|
701
858
|
//#region src/functions/some.ts
|
|
702
|
-
function
|
|
859
|
+
function Be(e, t) {
|
|
703
860
|
if (l(e, "some"), t === void 0) {
|
|
704
861
|
for (let t of e) return !0;
|
|
705
862
|
return !1;
|
|
@@ -711,7 +868,7 @@ function De(e, t) {
|
|
|
711
868
|
}
|
|
712
869
|
//#endregion
|
|
713
870
|
//#region src/functions/sum.ts
|
|
714
|
-
function
|
|
871
|
+
function Ve(e, t) {
|
|
715
872
|
l(e, "sum");
|
|
716
873
|
let n = 0;
|
|
717
874
|
if (t === void 0) {
|
|
@@ -725,10 +882,10 @@ function Oe(e, t) {
|
|
|
725
882
|
}
|
|
726
883
|
//#endregion
|
|
727
884
|
//#region src/functions/take.ts
|
|
728
|
-
function
|
|
729
|
-
return l(e, "take"),
|
|
885
|
+
function He(e, t) {
|
|
886
|
+
return l(e, "take"), f(t, "count", "take"), new m(() => new Ue(e, t));
|
|
730
887
|
}
|
|
731
|
-
var
|
|
888
|
+
var Ue = class extends h {
|
|
732
889
|
count;
|
|
733
890
|
constructor(e, t) {
|
|
734
891
|
super(e), this.count = t;
|
|
@@ -740,11 +897,16 @@ var Ae = class extends _ {
|
|
|
740
897
|
}
|
|
741
898
|
};
|
|
742
899
|
//#endregion
|
|
900
|
+
//#region src/functions/takeLast.ts
|
|
901
|
+
function We(e, t) {
|
|
902
|
+
return l(e, "takeLast"), f(t, "count", "takeLast"), t === 0 ? J(e, 0, 0) : J(e, -t);
|
|
903
|
+
}
|
|
904
|
+
//#endregion
|
|
743
905
|
//#region src/functions/takeWhile.ts
|
|
744
|
-
function
|
|
745
|
-
return l(e, "takeWhile"), u(t, "predicate", "takeWhile"), new
|
|
906
|
+
function Ge(e, t) {
|
|
907
|
+
return l(e, "takeWhile"), u(t, "predicate", "takeWhile"), new m(() => new Ke(e, t));
|
|
746
908
|
}
|
|
747
|
-
var
|
|
909
|
+
var Ke = class extends h {
|
|
748
910
|
predicate;
|
|
749
911
|
constructor(e, t) {
|
|
750
912
|
super(e), this.predicate = t;
|
|
@@ -763,10 +925,10 @@ var Me = class extends _ {
|
|
|
763
925
|
};
|
|
764
926
|
//#endregion
|
|
765
927
|
//#region src/functions/tap.ts
|
|
766
|
-
function
|
|
767
|
-
return l(e, "tap"), u(t, "tapper", "tap"), new
|
|
928
|
+
function qe(e, t) {
|
|
929
|
+
return l(e, "tap"), u(t, "tapper", "tap"), new m(() => new Je(e, t));
|
|
768
930
|
}
|
|
769
|
-
var
|
|
931
|
+
var Je = class extends h {
|
|
770
932
|
tapper;
|
|
771
933
|
constructor(e, t) {
|
|
772
934
|
super(e), this.tapper = t;
|
|
@@ -784,51 +946,58 @@ var Pe = class extends _ {
|
|
|
784
946
|
};
|
|
785
947
|
//#endregion
|
|
786
948
|
//#region src/functions/tapChain.ts
|
|
787
|
-
function
|
|
788
|
-
return l(e, "tapChain"), u(t, "tapper", "tapChain"), new
|
|
949
|
+
function Ye(e, t) {
|
|
950
|
+
return l(e, "tapChain"), u(t, "tapper", "tapChain"), new m(() => (t(e, 0), e[Symbol.iterator]()));
|
|
789
951
|
}
|
|
790
952
|
//#endregion
|
|
791
953
|
//#region src/functions/index.ts
|
|
792
|
-
var
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
954
|
+
var Xe = /* @__PURE__ */ t({
|
|
955
|
+
append: () => ae,
|
|
956
|
+
at: () => se,
|
|
957
|
+
average: () => ue,
|
|
958
|
+
collectToArray: () => g,
|
|
959
|
+
concat: () => de,
|
|
960
|
+
count: () => _,
|
|
797
961
|
distinct: () => v,
|
|
798
962
|
empty: () => y,
|
|
799
|
-
every: () =>
|
|
800
|
-
filter: () =>
|
|
801
|
-
find: () =>
|
|
802
|
-
findIndex: () =>
|
|
803
|
-
findLast: () =>
|
|
804
|
-
findLastIndex: () =>
|
|
805
|
-
flatMap: () =>
|
|
806
|
-
forEach: () =>
|
|
807
|
-
forEachAsync: () =>
|
|
808
|
-
getMemoizeDefaultOptions: () =>
|
|
809
|
-
includes: () =>
|
|
810
|
-
indexOf: () =>
|
|
811
|
-
join: () =>
|
|
812
|
-
lastIndexOf: () =>
|
|
813
|
-
map: () =>
|
|
814
|
-
materialize: () =>
|
|
815
|
-
max: () =>
|
|
816
|
-
memoize: () =>
|
|
817
|
-
min: () =>
|
|
963
|
+
every: () => b,
|
|
964
|
+
filter: () => x,
|
|
965
|
+
find: () => S,
|
|
966
|
+
findIndex: () => C,
|
|
967
|
+
findLast: () => w,
|
|
968
|
+
findLastIndex: () => T,
|
|
969
|
+
flatMap: () => E,
|
|
970
|
+
forEach: () => k,
|
|
971
|
+
forEachAsync: () => A,
|
|
972
|
+
getMemoizeDefaultOptions: () => B,
|
|
973
|
+
includes: () => j,
|
|
974
|
+
indexOf: () => M,
|
|
975
|
+
join: () => N,
|
|
976
|
+
lastIndexOf: () => P,
|
|
977
|
+
map: () => F,
|
|
978
|
+
materialize: () => L,
|
|
979
|
+
max: () => z,
|
|
980
|
+
memoize: () => V,
|
|
981
|
+
min: () => be,
|
|
982
|
+
prepend: () => xe,
|
|
818
983
|
range: () => K,
|
|
819
984
|
reduce: () => q,
|
|
820
|
-
repeat: () =>
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
985
|
+
repeat: () => Ee,
|
|
986
|
+
reverse: () => De,
|
|
987
|
+
sequenceEqual: () => Ae,
|
|
988
|
+
single: () => je,
|
|
989
|
+
skip: () => Me,
|
|
990
|
+
skipLast: () => Le,
|
|
991
|
+
skipWhile: () => Re,
|
|
992
|
+
slice: () => J,
|
|
993
|
+
some: () => Be,
|
|
994
|
+
sum: () => Ve,
|
|
995
|
+
take: () => He,
|
|
996
|
+
takeLast: () => We,
|
|
997
|
+
takeWhile: () => Ge,
|
|
998
|
+
tap: () => qe,
|
|
999
|
+
tapChain: () => Ye
|
|
1000
|
+
}), Ze = Symbol.for("iterable-linq-utility.IIterableLinq");
|
|
832
1001
|
//#endregion
|
|
833
1002
|
//#region src/linqIterable.ts
|
|
834
1003
|
function Y(e) {
|
|
@@ -842,107 +1011,128 @@ var X = class {
|
|
|
842
1011
|
[Symbol.iterator]() {
|
|
843
1012
|
return this.iterable[Symbol.iterator]();
|
|
844
1013
|
}
|
|
1014
|
+
append(e) {
|
|
1015
|
+
return Y(ae(this.iterable, e));
|
|
1016
|
+
}
|
|
845
1017
|
at(e) {
|
|
846
|
-
return
|
|
1018
|
+
return se(this.iterable, e);
|
|
847
1019
|
}
|
|
848
1020
|
average(e) {
|
|
849
|
-
return
|
|
1021
|
+
return ue(this.iterable, e);
|
|
850
1022
|
}
|
|
851
1023
|
collectToArray() {
|
|
852
|
-
return
|
|
1024
|
+
return g(this.iterable);
|
|
1025
|
+
}
|
|
1026
|
+
concat(...e) {
|
|
1027
|
+
return Y(de(this.iterable, ...e));
|
|
853
1028
|
}
|
|
854
1029
|
count(e) {
|
|
855
|
-
return
|
|
1030
|
+
return _(this.iterable, e);
|
|
856
1031
|
}
|
|
857
1032
|
distinct(e) {
|
|
858
1033
|
return Y(v(this.iterable, e));
|
|
859
1034
|
}
|
|
860
1035
|
every(e) {
|
|
861
|
-
return
|
|
1036
|
+
return b(this.iterable, e);
|
|
862
1037
|
}
|
|
863
1038
|
filter(e) {
|
|
864
|
-
return Y(
|
|
1039
|
+
return Y(x(this.iterable, e));
|
|
865
1040
|
}
|
|
866
1041
|
find(e) {
|
|
867
|
-
return
|
|
1042
|
+
return S(this.iterable, e);
|
|
868
1043
|
}
|
|
869
1044
|
findIndex(e) {
|
|
870
|
-
return
|
|
1045
|
+
return C(this.iterable, e);
|
|
871
1046
|
}
|
|
872
1047
|
findLast(e) {
|
|
873
|
-
return
|
|
1048
|
+
return w(this.iterable, e);
|
|
874
1049
|
}
|
|
875
1050
|
findLastIndex(e) {
|
|
876
|
-
return
|
|
1051
|
+
return T(this.iterable, e);
|
|
877
1052
|
}
|
|
878
1053
|
flatMap(e) {
|
|
879
|
-
return Y(
|
|
1054
|
+
return Y(E(this.iterable, e));
|
|
880
1055
|
}
|
|
881
1056
|
forEach(e) {
|
|
882
|
-
return
|
|
1057
|
+
return k(this.iterable, e);
|
|
883
1058
|
}
|
|
884
1059
|
forEachAsync(e) {
|
|
885
|
-
return
|
|
1060
|
+
return A(this.iterable, e);
|
|
886
1061
|
}
|
|
887
1062
|
includes(e) {
|
|
888
|
-
return
|
|
1063
|
+
return j(this.iterable, e);
|
|
889
1064
|
}
|
|
890
1065
|
indexOf(e) {
|
|
891
|
-
return
|
|
1066
|
+
return M(this.iterable, e);
|
|
892
1067
|
}
|
|
893
1068
|
join(e) {
|
|
894
|
-
return
|
|
1069
|
+
return N(this.iterable, e);
|
|
895
1070
|
}
|
|
896
1071
|
lastIndexOf(e) {
|
|
897
|
-
return
|
|
1072
|
+
return P(this.iterable, e);
|
|
898
1073
|
}
|
|
899
1074
|
map(e) {
|
|
900
|
-
return Y(
|
|
1075
|
+
return Y(F(this.iterable, e));
|
|
901
1076
|
}
|
|
902
1077
|
materialize() {
|
|
903
|
-
return Y(
|
|
1078
|
+
return Y(L(this.iterable));
|
|
904
1079
|
}
|
|
905
1080
|
max(e) {
|
|
906
|
-
return
|
|
1081
|
+
return z(this.iterable, e);
|
|
907
1082
|
}
|
|
908
1083
|
memoize(e) {
|
|
909
|
-
return Y(
|
|
1084
|
+
return Y(V(this.iterable, e));
|
|
910
1085
|
}
|
|
911
1086
|
min(e) {
|
|
912
|
-
return
|
|
1087
|
+
return be(this.iterable, e);
|
|
1088
|
+
}
|
|
1089
|
+
prepend(e) {
|
|
1090
|
+
return Y(xe(this.iterable, e));
|
|
913
1091
|
}
|
|
914
1092
|
reduce(...e) {
|
|
915
1093
|
return e.length === 1 ? q(this.iterable, e[0]) : q(this.iterable, e[0], e[1]);
|
|
916
1094
|
}
|
|
1095
|
+
reverse() {
|
|
1096
|
+
return Y(De(this.iterable));
|
|
1097
|
+
}
|
|
917
1098
|
sequenceEqual(e, t) {
|
|
918
|
-
return
|
|
1099
|
+
return Ae(this.iterable, e, t);
|
|
919
1100
|
}
|
|
920
1101
|
single(e) {
|
|
921
|
-
return
|
|
1102
|
+
return je(this.iterable, e);
|
|
922
1103
|
}
|
|
923
1104
|
skip(e) {
|
|
924
|
-
return Y(
|
|
1105
|
+
return Y(Me(this.iterable, e));
|
|
1106
|
+
}
|
|
1107
|
+
skipLast(e) {
|
|
1108
|
+
return Y(Le(this.iterable, e));
|
|
925
1109
|
}
|
|
926
1110
|
skipWhile(e) {
|
|
927
|
-
return Y(
|
|
1111
|
+
return Y(Re(this.iterable, e));
|
|
1112
|
+
}
|
|
1113
|
+
slice(e, t) {
|
|
1114
|
+
return Y(J(this.iterable, e, t));
|
|
928
1115
|
}
|
|
929
1116
|
some(e) {
|
|
930
|
-
return
|
|
1117
|
+
return Be(this.iterable, e);
|
|
931
1118
|
}
|
|
932
1119
|
sum(e) {
|
|
933
|
-
return
|
|
1120
|
+
return Ve(this.iterable, e);
|
|
934
1121
|
}
|
|
935
1122
|
take(e) {
|
|
936
|
-
return Y(
|
|
1123
|
+
return Y(He(this.iterable, e));
|
|
1124
|
+
}
|
|
1125
|
+
takeLast(e) {
|
|
1126
|
+
return Y(We(this.iterable, e));
|
|
937
1127
|
}
|
|
938
1128
|
takeWhile(e) {
|
|
939
|
-
return Y(
|
|
1129
|
+
return Y(Ge(this.iterable, e));
|
|
940
1130
|
}
|
|
941
1131
|
tap(e) {
|
|
942
|
-
return Y(
|
|
1132
|
+
return Y(qe(this.iterable, e));
|
|
943
1133
|
}
|
|
944
1134
|
tapChain(e) {
|
|
945
|
-
return Y(
|
|
1135
|
+
return Y(Ye(this.iterable, e));
|
|
946
1136
|
}
|
|
947
1137
|
tapChainCreation(e) {
|
|
948
1138
|
u(e, "chainCreationTapper", "tapChainCreation");
|
|
@@ -950,7 +1140,7 @@ var X = class {
|
|
|
950
1140
|
return e(t), t;
|
|
951
1141
|
}
|
|
952
1142
|
};
|
|
953
|
-
Object.defineProperty(X.prototype,
|
|
1143
|
+
Object.defineProperty(X.prototype, Ze, {
|
|
954
1144
|
value: !0,
|
|
955
1145
|
enumerable: !1,
|
|
956
1146
|
writable: !1,
|
|
@@ -961,8 +1151,8 @@ Object.defineProperty(X.prototype, Le, {
|
|
|
961
1151
|
function Z() {
|
|
962
1152
|
return X.prototype;
|
|
963
1153
|
}
|
|
964
|
-
function
|
|
965
|
-
return typeof e == "object" && !!e && e[
|
|
1154
|
+
function Qe(e) {
|
|
1155
|
+
return typeof e == "object" && !!e && e[Ze] === !0;
|
|
966
1156
|
}
|
|
967
1157
|
function Q(e, t) {
|
|
968
1158
|
let n = Object.getOwnPropertyDescriptor(Z(), e);
|
|
@@ -973,34 +1163,34 @@ function Q(e, t) {
|
|
|
973
1163
|
configurable: !0
|
|
974
1164
|
});
|
|
975
1165
|
}
|
|
976
|
-
function
|
|
977
|
-
|
|
1166
|
+
function $e(e, t, n) {
|
|
1167
|
+
ne(t, "name", e), u(n, "implementation", e);
|
|
978
1168
|
}
|
|
979
|
-
function
|
|
980
|
-
if (
|
|
1169
|
+
function et(e, t) {
|
|
1170
|
+
if ($e("extend", e, t), e in Y([])) throw c("extend", `"${e}" already exists on IIterableLinq: use override() to replace it`);
|
|
981
1171
|
Q(e, t);
|
|
982
1172
|
}
|
|
983
|
-
function
|
|
984
|
-
|
|
1173
|
+
function tt(e, t) {
|
|
1174
|
+
$e("override", e, t);
|
|
985
1175
|
let n = e;
|
|
986
1176
|
if (!(n !== "constructor" && Object.prototype.hasOwnProperty.call(Z(), n))) throw c("override", `"${n}" is not a method of IIterableLinq: use extend() to add it`);
|
|
987
1177
|
Q(n, t);
|
|
988
1178
|
}
|
|
989
1179
|
//#endregion
|
|
990
1180
|
//#region src/index.ts
|
|
991
|
-
function
|
|
1181
|
+
function nt() {
|
|
992
1182
|
return $(y());
|
|
993
1183
|
}
|
|
994
1184
|
function $(e) {
|
|
995
1185
|
return l(e, "from"), Y(e);
|
|
996
1186
|
}
|
|
997
|
-
function
|
|
1187
|
+
function rt(e, t, n) {
|
|
998
1188
|
if (typeof t == "number") return $(K(e, t, n));
|
|
999
1189
|
if (n !== void 0) throw c("fromRange", "The \"options\" parameter must be the second argument when \"start\" is omitted");
|
|
1000
1190
|
return $(K(e, t));
|
|
1001
1191
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return $(
|
|
1192
|
+
function it(e, t) {
|
|
1193
|
+
return $(Ee(e, t));
|
|
1004
1194
|
}
|
|
1005
1195
|
//#endregion
|
|
1006
|
-
export {
|
|
1196
|
+
export { Xe as Functions, D as Unit, nt as empty, et as extend, $ as from, rt as fromRange, Qe as isIterableLinq, tt as override, it as repeat, O as unit };
|