iterflow 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 +44 -0
- package/dist/fn/index.cjs.map +1 -1
- package/dist/fn/index.js.map +1 -1
- package/dist/index.cjs +378 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +152 -5
- package/dist/index.d.ts +152 -5
- package/dist/index.js +377 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -99,6 +99,30 @@ var TypeConversionError = class extends iterflowError {
|
|
|
99
99
|
this.expectedType = expectedType;
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
+
var TimeoutError = class extends iterflowError {
|
|
103
|
+
timeoutMs;
|
|
104
|
+
constructor(timeoutMs, operation) {
|
|
105
|
+
super(
|
|
106
|
+
`Operation timed out after ${timeoutMs}ms`,
|
|
107
|
+
operation,
|
|
108
|
+
{ timeoutMs }
|
|
109
|
+
);
|
|
110
|
+
this.name = "TimeoutError";
|
|
111
|
+
this.timeoutMs = timeoutMs;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
var AbortError = class extends iterflowError {
|
|
115
|
+
reason;
|
|
116
|
+
constructor(operation, reason) {
|
|
117
|
+
super(
|
|
118
|
+
reason ? `Operation aborted: ${reason}` : "Operation aborted",
|
|
119
|
+
operation,
|
|
120
|
+
{ reason }
|
|
121
|
+
);
|
|
122
|
+
this.name = "AbortError";
|
|
123
|
+
this.reason = reason;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
102
126
|
|
|
103
127
|
// src/validation.ts
|
|
104
128
|
function validatePositiveInteger(value, paramName, operation) {
|
|
@@ -322,6 +346,56 @@ var iterflow = class _iterflow {
|
|
|
322
346
|
}
|
|
323
347
|
});
|
|
324
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Limits the maximum number of iterations to prevent infinite loops.
|
|
351
|
+
* Unlike `take()` which silently stops at the limit, this method throws
|
|
352
|
+
* an OperationError if the limit is exceeded, making infinite loops explicit.
|
|
353
|
+
*
|
|
354
|
+
* @param maxIterations - Maximum number of iterations allowed (must be at least 1)
|
|
355
|
+
* @returns A new iterflow that will throw if limit is exceeded
|
|
356
|
+
* @throws {ValidationError} If maxIterations is not a positive integer
|
|
357
|
+
* @throws {OperationError} If iteration count exceeds maxIterations
|
|
358
|
+
* @example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* // Safely process potentially infinite iterator
|
|
361
|
+
* iter.range(Infinity).limit(1000).toArray(); // Throws after 1000 iterations
|
|
362
|
+
*
|
|
363
|
+
* // Regular finite iterator works normally
|
|
364
|
+
* iter([1, 2, 3]).limit(10).toArray(); // [1, 2, 3]
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
367
|
+
limit(maxIterations) {
|
|
368
|
+
validatePositiveInteger(maxIterations, "maxIterations", "limit");
|
|
369
|
+
if (this._sourceArray) {
|
|
370
|
+
if (this._sourceArray.length > maxIterations) {
|
|
371
|
+
throw new OperationError(
|
|
372
|
+
`Iterator exceeded limit of ${maxIterations} iterations`,
|
|
373
|
+
"limit",
|
|
374
|
+
void 0,
|
|
375
|
+
{ maxIterations, actualCount: this._sourceArray.length }
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
return new _iterflow(this._sourceArray);
|
|
379
|
+
}
|
|
380
|
+
const self = this;
|
|
381
|
+
return new _iterflow({
|
|
382
|
+
*[Symbol.iterator]() {
|
|
383
|
+
let count = 0;
|
|
384
|
+
for (const value of self) {
|
|
385
|
+
if (count >= maxIterations) {
|
|
386
|
+
throw new OperationError(
|
|
387
|
+
`Iterator exceeded limit of ${maxIterations} iterations`,
|
|
388
|
+
"limit",
|
|
389
|
+
void 0,
|
|
390
|
+
{ maxIterations }
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
yield value;
|
|
394
|
+
count++;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
}
|
|
325
399
|
/**
|
|
326
400
|
* Skips the first `count` elements from the iterator.
|
|
327
401
|
*
|
|
@@ -577,17 +651,43 @@ var iterflow = class _iterflow {
|
|
|
577
651
|
* Collects all elements into an array.
|
|
578
652
|
* This is a terminal operation that consumes the iterator.
|
|
579
653
|
*
|
|
580
|
-
* @
|
|
654
|
+
* @param maxSize - Optional maximum array size. If provided and the iterator produces
|
|
655
|
+
* more elements, collection stops at maxSize (no error thrown).
|
|
656
|
+
* This is useful for safely collecting from potentially large iterators.
|
|
657
|
+
* @returns Array containing all elements (up to maxSize if specified)
|
|
658
|
+
* @throws {ValidationError} If maxSize is provided but not a positive integer
|
|
581
659
|
* @example
|
|
582
660
|
* ```typescript
|
|
583
661
|
* iter([1, 2, 3]).map(x => x * 2).toArray(); // [2, 4, 6]
|
|
662
|
+
*
|
|
663
|
+
* // Safely collect from large/infinite iterator
|
|
664
|
+
* iter.range(Infinity).toArray(1000); // [0, 1, 2, ..., 999]
|
|
665
|
+
*
|
|
666
|
+
* // Works with finite iterators too
|
|
667
|
+
* iter([1, 2, 3]).toArray(10); // [1, 2, 3] (stops early)
|
|
584
668
|
* ```
|
|
585
669
|
*/
|
|
586
|
-
toArray() {
|
|
670
|
+
toArray(maxSize) {
|
|
671
|
+
if (maxSize !== void 0) {
|
|
672
|
+
validatePositiveInteger(maxSize, "maxSize", "toArray");
|
|
673
|
+
}
|
|
587
674
|
if (this._sourceArray) {
|
|
675
|
+
if (maxSize !== void 0) {
|
|
676
|
+
return this._sourceArray.slice(0, maxSize);
|
|
677
|
+
}
|
|
588
678
|
return this._sourceArray.slice();
|
|
589
679
|
}
|
|
590
|
-
|
|
680
|
+
if (maxSize === void 0) {
|
|
681
|
+
return Array.from(this);
|
|
682
|
+
}
|
|
683
|
+
const result = [];
|
|
684
|
+
for (const value of this) {
|
|
685
|
+
if (result.length >= maxSize) {
|
|
686
|
+
break;
|
|
687
|
+
}
|
|
688
|
+
result.push(value);
|
|
689
|
+
}
|
|
690
|
+
return result;
|
|
591
691
|
}
|
|
592
692
|
/**
|
|
593
693
|
* Counts the total number of elements in the iterator.
|
|
@@ -1501,6 +1601,8 @@ var iterflow = class _iterflow {
|
|
|
1501
1601
|
/**
|
|
1502
1602
|
* Alias for stdDev() method for compatibility.
|
|
1503
1603
|
* Calculates the standard deviation of all numeric elements.
|
|
1604
|
+
*
|
|
1605
|
+
* @deprecated Use stdDev() instead. This alias will be removed in v1.0.0.
|
|
1504
1606
|
*/
|
|
1505
1607
|
stddev() {
|
|
1506
1608
|
return this.stdDev();
|
|
@@ -1508,6 +1610,8 @@ var iterflow = class _iterflow {
|
|
|
1508
1610
|
/**
|
|
1509
1611
|
* Alias for drop() method for compatibility.
|
|
1510
1612
|
* Skips the first `count` elements from the iterator.
|
|
1613
|
+
*
|
|
1614
|
+
* @deprecated Use drop() instead. This alias will be removed in v1.0.0.
|
|
1511
1615
|
*/
|
|
1512
1616
|
skip(count) {
|
|
1513
1617
|
return this.drop(count);
|
|
@@ -1744,6 +1848,45 @@ var Asynciterflow = class _Asynciterflow {
|
|
|
1744
1848
|
}
|
|
1745
1849
|
});
|
|
1746
1850
|
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Limits the maximum number of iterations to prevent infinite loops.
|
|
1853
|
+
* Unlike `take()` which silently stops at the limit, this method throws
|
|
1854
|
+
* an OperationError if the limit is exceeded, making infinite loops explicit.
|
|
1855
|
+
*
|
|
1856
|
+
* @param maxIterations - Maximum number of iterations allowed (must be at least 1)
|
|
1857
|
+
* @returns A new async iterflow that will throw if limit is exceeded
|
|
1858
|
+
* @throws {ValidationError} If maxIterations is not a positive integer
|
|
1859
|
+
* @throws {OperationError} If iteration count exceeds maxIterations
|
|
1860
|
+
* @example
|
|
1861
|
+
* ```typescript
|
|
1862
|
+
* // Safely process potentially infinite async iterator
|
|
1863
|
+
* await asyncIter.range(Infinity).limit(1000).toArray(); // Throws after 1000 iterations
|
|
1864
|
+
*
|
|
1865
|
+
* // Regular finite iterator works normally
|
|
1866
|
+
* await asyncIter([1, 2, 3]).limit(10).toArray(); // [1, 2, 3]
|
|
1867
|
+
* ```
|
|
1868
|
+
*/
|
|
1869
|
+
limit(maxIterations) {
|
|
1870
|
+
validatePositiveInteger(maxIterations, "maxIterations", "limit");
|
|
1871
|
+
const self = this;
|
|
1872
|
+
return new _Asynciterflow({
|
|
1873
|
+
async *[Symbol.asyncIterator]() {
|
|
1874
|
+
let count = 0;
|
|
1875
|
+
for await (const value of self) {
|
|
1876
|
+
if (count >= maxIterations) {
|
|
1877
|
+
throw new OperationError(
|
|
1878
|
+
`Iterator exceeded limit of ${maxIterations} iterations`,
|
|
1879
|
+
"limit",
|
|
1880
|
+
void 0,
|
|
1881
|
+
{ maxIterations }
|
|
1882
|
+
);
|
|
1883
|
+
}
|
|
1884
|
+
yield value;
|
|
1885
|
+
count++;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1747
1890
|
/**
|
|
1748
1891
|
* Maps each element to an async iterable and flattens the results.
|
|
1749
1892
|
*
|
|
@@ -1946,15 +2089,28 @@ var Asynciterflow = class _Asynciterflow {
|
|
|
1946
2089
|
* Collects all elements into an array.
|
|
1947
2090
|
* This is a terminal operation that consumes the async iterator.
|
|
1948
2091
|
*
|
|
1949
|
-
* @
|
|
2092
|
+
* @param maxSize - Optional maximum array size. If provided and the iterator produces
|
|
2093
|
+
* more elements, collection stops at maxSize (no error thrown).
|
|
2094
|
+
* This is useful for safely collecting from potentially large iterators.
|
|
2095
|
+
* @returns Promise of array containing all elements (up to maxSize if specified)
|
|
2096
|
+
* @throws {ValidationError} If maxSize is provided but not a positive integer
|
|
1950
2097
|
* @example
|
|
1951
2098
|
* ```typescript
|
|
1952
2099
|
* await asyncIter([1, 2, 3]).map(async x => x * 2).toArray(); // [2, 4, 6]
|
|
2100
|
+
*
|
|
2101
|
+
* // Safely collect from large async iterator
|
|
2102
|
+
* await asyncIter(infiniteStream).toArray(1000); // First 1000 items
|
|
1953
2103
|
* ```
|
|
1954
2104
|
*/
|
|
1955
|
-
async toArray() {
|
|
2105
|
+
async toArray(maxSize) {
|
|
2106
|
+
if (maxSize !== void 0) {
|
|
2107
|
+
validatePositiveInteger(maxSize, "maxSize", "toArray");
|
|
2108
|
+
}
|
|
1956
2109
|
const result = [];
|
|
1957
2110
|
for await (const value of this) {
|
|
2111
|
+
if (maxSize !== void 0 && result.length >= maxSize) {
|
|
2112
|
+
break;
|
|
2113
|
+
}
|
|
1958
2114
|
result.push(value);
|
|
1959
2115
|
}
|
|
1960
2116
|
return result;
|
|
@@ -3206,6 +3362,221 @@ var Asynciterflow = class _Asynciterflow {
|
|
|
3206
3362
|
}
|
|
3207
3363
|
});
|
|
3208
3364
|
}
|
|
3365
|
+
/**
|
|
3366
|
+
* Adds a timeout to async iteration operations.
|
|
3367
|
+
* If any single iteration (next() call) takes longer than the specified timeout,
|
|
3368
|
+
* a TimeoutError is thrown. Each iteration gets its own timeout window.
|
|
3369
|
+
*
|
|
3370
|
+
* @param ms - Timeout duration in milliseconds (must be positive)
|
|
3371
|
+
* @returns A new async iterflow with timeout protection
|
|
3372
|
+
* @throws {ValidationError} If ms is not a positive number
|
|
3373
|
+
* @throws {TimeoutError} If any iteration exceeds the timeout
|
|
3374
|
+
* @example
|
|
3375
|
+
* ```typescript
|
|
3376
|
+
* // Protect against slow async operations
|
|
3377
|
+
* await asyncIter([1, 2, 3])
|
|
3378
|
+
* .map(async x => {
|
|
3379
|
+
* await slowOperation(x); // Each must complete within 5000ms
|
|
3380
|
+
* return x;
|
|
3381
|
+
* })
|
|
3382
|
+
* .timeout(5000)
|
|
3383
|
+
* .toArray();
|
|
3384
|
+
* ```
|
|
3385
|
+
*/
|
|
3386
|
+
timeout(ms) {
|
|
3387
|
+
validatePositiveInteger(ms, "timeout", "timeout");
|
|
3388
|
+
const self = this;
|
|
3389
|
+
return new _Asynciterflow({
|
|
3390
|
+
async *[Symbol.asyncIterator]() {
|
|
3391
|
+
const iterator = self[Symbol.asyncIterator]();
|
|
3392
|
+
while (true) {
|
|
3393
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
3394
|
+
setTimeout(() => {
|
|
3395
|
+
reject(new TimeoutError(ms, "timeout"));
|
|
3396
|
+
}, ms);
|
|
3397
|
+
});
|
|
3398
|
+
const result = await Promise.race([iterator.next(), timeoutPromise]);
|
|
3399
|
+
if (result.done) break;
|
|
3400
|
+
yield result.value;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
});
|
|
3404
|
+
}
|
|
3405
|
+
/**
|
|
3406
|
+
* Adds AbortSignal support to the async iteration.
|
|
3407
|
+
* If the signal is aborted, iteration stops immediately with an AbortError.
|
|
3408
|
+
* Checks the signal before each iteration and listens for abort events.
|
|
3409
|
+
*
|
|
3410
|
+
* @param signal - AbortSignal to control iteration cancellation
|
|
3411
|
+
* @returns A new async iterflow with abort support
|
|
3412
|
+
* @throws {AbortError} If the signal is aborted
|
|
3413
|
+
* @example
|
|
3414
|
+
* ```typescript
|
|
3415
|
+
* const controller = new AbortController();
|
|
3416
|
+
*
|
|
3417
|
+
* // Cancel after 5 seconds
|
|
3418
|
+
* setTimeout(() => controller.abort('Timeout reached'), 5000);
|
|
3419
|
+
*
|
|
3420
|
+
* try {
|
|
3421
|
+
* await asyncIter(largeDataset)
|
|
3422
|
+
* .withSignal(controller.signal)
|
|
3423
|
+
* .map(processItem)
|
|
3424
|
+
* .toArray();
|
|
3425
|
+
* } catch (error) {
|
|
3426
|
+
* if (error instanceof AbortError) {
|
|
3427
|
+
* console.log('Operation cancelled:', error.reason);
|
|
3428
|
+
* }
|
|
3429
|
+
* }
|
|
3430
|
+
* ```
|
|
3431
|
+
*/
|
|
3432
|
+
withSignal(signal) {
|
|
3433
|
+
const self = this;
|
|
3434
|
+
return new _Asynciterflow({
|
|
3435
|
+
async *[Symbol.asyncIterator]() {
|
|
3436
|
+
if (signal.aborted) {
|
|
3437
|
+
throw new AbortError(
|
|
3438
|
+
"withSignal",
|
|
3439
|
+
typeof signal.reason === "string" ? signal.reason : void 0
|
|
3440
|
+
);
|
|
3441
|
+
}
|
|
3442
|
+
const iterator = self[Symbol.asyncIterator]();
|
|
3443
|
+
let abortReject;
|
|
3444
|
+
const abortPromise = new Promise((_, reject) => {
|
|
3445
|
+
abortReject = reject;
|
|
3446
|
+
});
|
|
3447
|
+
const abortHandler = () => {
|
|
3448
|
+
if (abortReject) {
|
|
3449
|
+
abortReject(
|
|
3450
|
+
new AbortError(
|
|
3451
|
+
"withSignal",
|
|
3452
|
+
typeof signal.reason === "string" ? signal.reason : void 0
|
|
3453
|
+
)
|
|
3454
|
+
);
|
|
3455
|
+
}
|
|
3456
|
+
};
|
|
3457
|
+
signal.addEventListener("abort", abortHandler);
|
|
3458
|
+
try {
|
|
3459
|
+
while (true) {
|
|
3460
|
+
const result = await Promise.race([iterator.next(), abortPromise]);
|
|
3461
|
+
if (result.done) break;
|
|
3462
|
+
yield result.value;
|
|
3463
|
+
}
|
|
3464
|
+
} finally {
|
|
3465
|
+
signal.removeEventListener("abort", abortHandler);
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
});
|
|
3469
|
+
}
|
|
3470
|
+
/**
|
|
3471
|
+
* Interleaves elements from this async iterator with elements from other async/sync iterables.
|
|
3472
|
+
* Takes one element from each iterable in round-robin fashion.
|
|
3473
|
+
*
|
|
3474
|
+
* @param others - Variable number of async/sync iterables to interleave with
|
|
3475
|
+
* @returns A new async iterflow with elements from all iterables interleaved
|
|
3476
|
+
* @example
|
|
3477
|
+
* ```typescript
|
|
3478
|
+
* await asyncIter([1, 2, 3]).interleave([4, 5, 6]).toArray(); // [1, 4, 2, 5, 3, 6]
|
|
3479
|
+
* ```
|
|
3480
|
+
*/
|
|
3481
|
+
interleave(...others) {
|
|
3482
|
+
const self = this;
|
|
3483
|
+
return new _Asynciterflow({
|
|
3484
|
+
async *[Symbol.asyncIterator]() {
|
|
3485
|
+
const allIterables = [self, ...others];
|
|
3486
|
+
if (allIterables.length === 0) return;
|
|
3487
|
+
const iterators = allIterables.map(
|
|
3488
|
+
(it) => Symbol.asyncIterator in it ? it[Symbol.asyncIterator]() : (async function* () {
|
|
3489
|
+
yield* it;
|
|
3490
|
+
})()
|
|
3491
|
+
);
|
|
3492
|
+
const active = new Set(iterators);
|
|
3493
|
+
while (active.size > 0) {
|
|
3494
|
+
for (const iterator of iterators) {
|
|
3495
|
+
if (!active.has(iterator)) continue;
|
|
3496
|
+
const result = await iterator.next();
|
|
3497
|
+
if (result.done) {
|
|
3498
|
+
active.delete(iterator);
|
|
3499
|
+
} else {
|
|
3500
|
+
yield result.value;
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
});
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* Merges this async iterator with other sorted async/sync iterables into a single sorted async iterator.
|
|
3509
|
+
* Assumes all input iterables are already sorted in ascending order.
|
|
3510
|
+
*
|
|
3511
|
+
* @param others - Variable number of sorted async/sync iterables to merge with
|
|
3512
|
+
* @returns A new async iterflow with all elements merged in sorted order
|
|
3513
|
+
* @example
|
|
3514
|
+
* ```typescript
|
|
3515
|
+
* await asyncIter([1, 3, 5]).merge([2, 4, 6]).toArray(); // [1, 2, 3, 4, 5, 6]
|
|
3516
|
+
* ```
|
|
3517
|
+
*/
|
|
3518
|
+
merge(...others) {
|
|
3519
|
+
const self = this;
|
|
3520
|
+
return new _Asynciterflow({
|
|
3521
|
+
async *[Symbol.asyncIterator]() {
|
|
3522
|
+
const allIterables = [self, ...others];
|
|
3523
|
+
if (allIterables.length === 0) return;
|
|
3524
|
+
const compareFn = (a, b) => {
|
|
3525
|
+
if (a < b) return -1;
|
|
3526
|
+
if (a > b) return 1;
|
|
3527
|
+
return 0;
|
|
3528
|
+
};
|
|
3529
|
+
const heap = [];
|
|
3530
|
+
for (let i = 0; i < allIterables.length; i++) {
|
|
3531
|
+
const iterable = allIterables[i];
|
|
3532
|
+
const iterator = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : (async function* () {
|
|
3533
|
+
yield* iterable;
|
|
3534
|
+
})();
|
|
3535
|
+
const result = await iterator.next();
|
|
3536
|
+
if (!result.done) {
|
|
3537
|
+
heap.push({ value: result.value, iterator, index: i });
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3540
|
+
const bubbleDown = (index) => {
|
|
3541
|
+
const length = heap.length;
|
|
3542
|
+
while (true) {
|
|
3543
|
+
let smallest = index;
|
|
3544
|
+
const leftChild = 2 * index + 1;
|
|
3545
|
+
const rightChild = 2 * index + 2;
|
|
3546
|
+
if (leftChild < length && compareFn(heap[leftChild].value, heap[smallest].value) < 0) {
|
|
3547
|
+
smallest = leftChild;
|
|
3548
|
+
}
|
|
3549
|
+
if (rightChild < length && compareFn(heap[rightChild].value, heap[smallest].value) < 0) {
|
|
3550
|
+
smallest = rightChild;
|
|
3551
|
+
}
|
|
3552
|
+
if (smallest === index) break;
|
|
3553
|
+
const temp = heap[index];
|
|
3554
|
+
heap[index] = heap[smallest];
|
|
3555
|
+
heap[smallest] = temp;
|
|
3556
|
+
index = smallest;
|
|
3557
|
+
}
|
|
3558
|
+
};
|
|
3559
|
+
for (let i = Math.floor(heap.length / 2) - 1; i >= 0; i--) {
|
|
3560
|
+
bubbleDown(i);
|
|
3561
|
+
}
|
|
3562
|
+
while (heap.length > 0) {
|
|
3563
|
+
const min = heap[0];
|
|
3564
|
+
yield min.value;
|
|
3565
|
+
const nextResult = await min.iterator.next();
|
|
3566
|
+
if (nextResult.done) {
|
|
3567
|
+
heap[0] = heap[heap.length - 1];
|
|
3568
|
+
heap.pop();
|
|
3569
|
+
if (heap.length > 0) {
|
|
3570
|
+
bubbleDown(0);
|
|
3571
|
+
}
|
|
3572
|
+
} else {
|
|
3573
|
+
heap[0] = { value: nextResult.value, iterator: min.iterator, index: min.index };
|
|
3574
|
+
bubbleDown(0);
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
});
|
|
3579
|
+
}
|
|
3209
3580
|
};
|
|
3210
3581
|
function asyncIter(source) {
|
|
3211
3582
|
if (Symbol.asyncIterator in source) {
|
|
@@ -3949,10 +4320,12 @@ function iter(source) {
|
|
|
3949
4320
|
iter2.chain = chain;
|
|
3950
4321
|
})(iter || (iter = {}));
|
|
3951
4322
|
|
|
4323
|
+
exports.AbortError = AbortError;
|
|
3952
4324
|
exports.Asynciterflow = Asynciterflow;
|
|
3953
4325
|
exports.EmptySequenceError = EmptySequenceError;
|
|
3954
4326
|
exports.IndexOutOfBoundsError = IndexOutOfBoundsError;
|
|
3955
4327
|
exports.OperationError = OperationError;
|
|
4328
|
+
exports.TimeoutError = TimeoutError;
|
|
3956
4329
|
exports.TypeConversionError = TypeConversionError;
|
|
3957
4330
|
exports.ValidationError = ValidationError;
|
|
3958
4331
|
exports.addTrace = addTrace;
|