iter-fest 0.1.1-main.dd552c2 → 0.1.1-main.edf2470
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 +50 -91
- package/dist/chunk-5CRMPYKD.mjs +19 -0
- package/dist/chunk-5CRMPYKD.mjs.map +1 -0
- package/dist/chunk-6C3P4TNK.mjs +19 -0
- package/dist/chunk-6C3P4TNK.mjs.map +1 -0
- package/dist/chunk-EZC33HE6.mjs +15 -0
- package/dist/chunk-EZC33HE6.mjs.map +1 -0
- package/dist/chunk-JU353VSE.mjs +16 -0
- package/dist/chunk-JU353VSE.mjs.map +1 -0
- package/dist/chunk-MNLOWKTC.mjs +19 -0
- package/dist/chunk-MNLOWKTC.mjs.map +1 -0
- package/dist/{chunk-YJSIVBF7.mjs → chunk-MOBXUTO5.mjs} +5 -5
- package/dist/chunk-MOBXUTO5.mjs.map +1 -0
- package/dist/chunk-O5SQJUKB.mjs +37 -0
- package/dist/chunk-O5SQJUKB.mjs.map +1 -0
- package/dist/chunk-XW34KZRY.mjs +17 -0
- package/dist/chunk-XW34KZRY.mjs.map +1 -0
- package/dist/chunk-ZUBHGSCW.mjs +18 -0
- package/dist/chunk-ZUBHGSCW.mjs.map +1 -0
- package/dist/iter-fest.d.mts +9 -15
- package/dist/iter-fest.d.ts +9 -15
- package/dist/iter-fest.iterableEvery.d.mts +24 -0
- package/dist/iter-fest.iterableEvery.d.ts +24 -0
- package/dist/{iter-fest.asyncIteratorToAsyncIterable.js → iter-fest.iterableEvery.js} +19 -15
- package/dist/iter-fest.iterableEvery.js.map +1 -0
- package/dist/iter-fest.iterableEvery.mjs +7 -0
- package/dist/iter-fest.iterableFilter.d.mts +16 -0
- package/dist/iter-fest.iterableFilter.d.ts +16 -0
- package/dist/iter-fest.iterableFilter.js +42 -0
- package/dist/iter-fest.iterableFilter.js.map +1 -0
- package/dist/iter-fest.iterableFilter.mjs +7 -0
- package/dist/iter-fest.iterableFind.d.mts +15 -0
- package/dist/iter-fest.iterableFind.d.ts +15 -0
- package/dist/iter-fest.iterableFind.js +43 -0
- package/dist/iter-fest.iterableFind.js.map +1 -0
- package/dist/iter-fest.iterableFind.mjs +7 -0
- package/dist/iter-fest.iterableForEach.d.mts +10 -0
- package/dist/iter-fest.iterableForEach.d.ts +10 -0
- package/dist/iter-fest.iterableForEach.js +40 -0
- package/dist/iter-fest.iterableForEach.js.map +1 -0
- package/dist/iter-fest.iterableForEach.mjs +7 -0
- package/dist/iter-fest.iterableGetReadable.d.mts +3 -0
- package/dist/iter-fest.iterableGetReadable.d.ts +3 -0
- package/dist/{iter-fest.readableStreamFrom.js → iter-fest.iterableGetReadable.js} +9 -9
- package/dist/iter-fest.iterableGetReadable.js.map +1 -0
- package/dist/iter-fest.iterableGetReadable.mjs +7 -0
- package/dist/iter-fest.iterableMap.d.mts +8 -0
- package/dist/iter-fest.iterableMap.d.ts +8 -0
- package/dist/iter-fest.iterableMap.js +39 -0
- package/dist/iter-fest.iterableMap.js.map +1 -0
- package/dist/iter-fest.iterableMap.mjs +7 -0
- package/dist/{iter-fest.iteratorReduce.d.mts → iter-fest.iterableReduce.d.mts} +9 -13
- package/dist/{iter-fest.iteratorReduce.d.ts → iter-fest.iterableReduce.d.ts} +9 -13
- package/dist/iter-fest.iterableReduce.js +41 -0
- package/dist/iter-fest.iterableReduce.js.map +1 -0
- package/dist/iter-fest.iterableReduce.mjs +7 -0
- package/dist/iter-fest.iterableSome.d.mts +12 -0
- package/dist/iter-fest.iterableSome.d.ts +12 -0
- package/dist/iter-fest.iterableSome.js +43 -0
- package/dist/iter-fest.iterableSome.js.map +1 -0
- package/dist/iter-fest.iterableSome.mjs +7 -0
- package/dist/iter-fest.js +168 -177
- package/dist/iter-fest.js.map +1 -1
- package/dist/iter-fest.mjs +48 -72
- package/dist/iter-fest.pushAsyncIterableIterator.d.mts +9 -0
- package/dist/iter-fest.pushAsyncIterableIterator.d.ts +9 -0
- package/dist/{iter-fest.iterableWritableStream.js → iter-fest.pushAsyncIterableIterator.js} +30 -39
- package/dist/iter-fest.pushAsyncIterableIterator.js.map +1 -0
- package/dist/iter-fest.pushAsyncIterableIterator.mjs +7 -0
- package/package.json +87 -147
- package/dist/chunk-3S6LCGE6.mjs +0 -10
- package/dist/chunk-3S6LCGE6.mjs.map +0 -1
- package/dist/chunk-BWMXKULC.mjs +0 -46
- package/dist/chunk-BWMXKULC.mjs.map +0 -1
- package/dist/chunk-FBST4AUL.mjs +0 -10
- package/dist/chunk-FBST4AUL.mjs.map +0 -1
- package/dist/chunk-FMIHIL6A.mjs +0 -10
- package/dist/chunk-FMIHIL6A.mjs.map +0 -1
- package/dist/chunk-KYMTQJIJ.mjs +0 -10
- package/dist/chunk-KYMTQJIJ.mjs.map +0 -1
- package/dist/chunk-LIMQXDFK.mjs +0 -10
- package/dist/chunk-LIMQXDFK.mjs.map +0 -1
- package/dist/chunk-OWUGLCQB.mjs +0 -10
- package/dist/chunk-OWUGLCQB.mjs.map +0 -1
- package/dist/chunk-P4OSZLEH.mjs +0 -15
- package/dist/chunk-P4OSZLEH.mjs.map +0 -1
- package/dist/chunk-QX6EMOSQ.mjs +0 -10
- package/dist/chunk-QX6EMOSQ.mjs.map +0 -1
- package/dist/chunk-R6SXIXMH.mjs +0 -10
- package/dist/chunk-R6SXIXMH.mjs.map +0 -1
- package/dist/chunk-TDHR35S7.mjs +0 -10
- package/dist/chunk-TDHR35S7.mjs.map +0 -1
- package/dist/chunk-VCKLUCOT.mjs +0 -10
- package/dist/chunk-VCKLUCOT.mjs.map +0 -1
- package/dist/chunk-XQDGXAAF.mjs +0 -10
- package/dist/chunk-XQDGXAAF.mjs.map +0 -1
- package/dist/chunk-YJSIVBF7.mjs.map +0 -1
- package/dist/chunk-YLERARWI.mjs +0 -10
- package/dist/chunk-YLERARWI.mjs.map +0 -1
- package/dist/iter-fest.asyncIteratorToAsyncIterable.d.mts +0 -3
- package/dist/iter-fest.asyncIteratorToAsyncIterable.d.ts +0 -3
- package/dist/iter-fest.asyncIteratorToAsyncIterable.js.map +0 -1
- package/dist/iter-fest.asyncIteratorToAsyncIterable.mjs +0 -7
- package/dist/iter-fest.iterableWritableStream.d.mts +0 -7
- package/dist/iter-fest.iterableWritableStream.d.ts +0 -7
- package/dist/iter-fest.iterableWritableStream.js.map +0 -1
- package/dist/iter-fest.iterableWritableStream.mjs +0 -7
- package/dist/iter-fest.iteratorDrop.d.mts +0 -12
- package/dist/iter-fest.iteratorDrop.d.ts +0 -12
- package/dist/iter-fest.iteratorDrop.js +0 -44
- package/dist/iter-fest.iteratorDrop.js.map +0 -1
- package/dist/iter-fest.iteratorDrop.mjs +0 -7
- package/dist/iter-fest.iteratorEvery.d.mts +0 -25
- package/dist/iter-fest.iteratorEvery.d.ts +0 -25
- package/dist/iter-fest.iteratorEvery.js +0 -44
- package/dist/iter-fest.iteratorEvery.js.map +0 -1
- package/dist/iter-fest.iteratorEvery.mjs +0 -7
- package/dist/iter-fest.iteratorFilter.d.mts +0 -18
- package/dist/iter-fest.iteratorFilter.d.ts +0 -18
- package/dist/iter-fest.iteratorFilter.js +0 -44
- package/dist/iter-fest.iteratorFilter.js.map +0 -1
- package/dist/iter-fest.iteratorFilter.mjs +0 -7
- package/dist/iter-fest.iteratorFind.d.mts +0 -14
- package/dist/iter-fest.iteratorFind.d.ts +0 -14
- package/dist/iter-fest.iteratorFind.js +0 -44
- package/dist/iter-fest.iteratorFind.js.map +0 -1
- package/dist/iter-fest.iteratorFind.mjs +0 -7
- package/dist/iter-fest.iteratorFlatMap.d.mts +0 -12
- package/dist/iter-fest.iteratorFlatMap.d.ts +0 -12
- package/dist/iter-fest.iteratorFlatMap.js +0 -44
- package/dist/iter-fest.iteratorFlatMap.js.map +0 -1
- package/dist/iter-fest.iteratorFlatMap.mjs +0 -7
- package/dist/iter-fest.iteratorForEach.d.mts +0 -10
- package/dist/iter-fest.iteratorForEach.d.ts +0 -10
- package/dist/iter-fest.iteratorForEach.js +0 -44
- package/dist/iter-fest.iteratorForEach.js.map +0 -1
- package/dist/iter-fest.iteratorForEach.mjs +0 -7
- package/dist/iter-fest.iteratorFrom.d.mts +0 -12
- package/dist/iter-fest.iteratorFrom.d.ts +0 -12
- package/dist/iter-fest.iteratorFrom.js +0 -44
- package/dist/iter-fest.iteratorFrom.js.map +0 -1
- package/dist/iter-fest.iteratorFrom.mjs +0 -7
- package/dist/iter-fest.iteratorMap.d.mts +0 -10
- package/dist/iter-fest.iteratorMap.d.ts +0 -10
- package/dist/iter-fest.iteratorMap.js +0 -44
- package/dist/iter-fest.iteratorMap.js.map +0 -1
- package/dist/iter-fest.iteratorMap.mjs +0 -7
- package/dist/iter-fest.iteratorMap.mjs.map +0 -1
- package/dist/iter-fest.iteratorReduce.js +0 -44
- package/dist/iter-fest.iteratorReduce.js.map +0 -1
- package/dist/iter-fest.iteratorReduce.mjs +0 -7
- package/dist/iter-fest.iteratorReduce.mjs.map +0 -1
- package/dist/iter-fest.iteratorSome.d.mts +0 -10
- package/dist/iter-fest.iteratorSome.d.ts +0 -10
- package/dist/iter-fest.iteratorSome.js +0 -44
- package/dist/iter-fest.iteratorSome.js.map +0 -1
- package/dist/iter-fest.iteratorSome.mjs +0 -7
- package/dist/iter-fest.iteratorSome.mjs.map +0 -1
- package/dist/iter-fest.iteratorTake.d.mts +0 -12
- package/dist/iter-fest.iteratorTake.d.ts +0 -12
- package/dist/iter-fest.iteratorTake.js +0 -44
- package/dist/iter-fest.iteratorTake.js.map +0 -1
- package/dist/iter-fest.iteratorTake.mjs +0 -7
- package/dist/iter-fest.iteratorTake.mjs.map +0 -1
- package/dist/iter-fest.iteratorToArray.d.mts +0 -13
- package/dist/iter-fest.iteratorToArray.d.ts +0 -13
- package/dist/iter-fest.iteratorToArray.js +0 -44
- package/dist/iter-fest.iteratorToArray.js.map +0 -1
- package/dist/iter-fest.iteratorToArray.mjs +0 -7
- package/dist/iter-fest.iteratorToArray.mjs.map +0 -1
- package/dist/iter-fest.readableStreamFrom.d.mts +0 -3
- package/dist/iter-fest.readableStreamFrom.d.ts +0 -3
- package/dist/iter-fest.readableStreamFrom.js.map +0 -1
- package/dist/iter-fest.readableStreamFrom.mjs +0 -7
- package/dist/iter-fest.readableStreamFrom.mjs.map +0 -1
- /package/dist/{iter-fest.asyncIteratorToAsyncIterable.mjs.map → iter-fest.iterableEvery.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableWritableStream.mjs.map → iter-fest.iterableFilter.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorDrop.mjs.map → iter-fest.iterableFind.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorEvery.mjs.map → iter-fest.iterableForEach.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFilter.mjs.map → iter-fest.iterableGetReadable.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFind.mjs.map → iter-fest.iterableMap.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFlatMap.mjs.map → iter-fest.iterableReduce.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorForEach.mjs.map → iter-fest.iterableSome.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFrom.mjs.map → iter-fest.pushAsyncIterableIterator.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableReduce.ts"],"sourcesContent":["/**\n * Calls the specified callback function for all the elements in an iterable. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n *\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterable.\n *\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an iterable value.\n */\nexport function iterableReduce<T>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T\n): T;\n\nexport function iterableReduce<T>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T,\n initialValue: T\n): T;\n\n/**\n * Calls the specified callback function for all the elements in an iterable. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n *\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterable.\n *\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n\nexport function iterableReduce<T, U>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: U, currentValue: T, currentIndex: number, iterable: Iterable<T>) => U,\n initialValue: U\n): U;\n\nexport function iterableReduce<T, U = undefined>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: U | undefined, currentValue: T, currentIndex: number, iterable: Iterable<T>) => U,\n initialValue?: U\n): U | undefined {\n let index = 0;\n let previousValue: U | undefined = initialValue;\n\n if (typeof callbackfn !== 'function') {\n throw new TypeError(`${callbackfn} is not a function`);\n }\n\n for (const currentValue of iterable) {\n previousValue = callbackfn(previousValue, currentValue, index++, iterable);\n }\n\n return previousValue;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCO,SAAS,eACd,UACA,YACA,cACe;AACf,MAAI,QAAQ;AACZ,MAAI,gBAA+B;AAEnC,MAAI,OAAO,eAAe,YAAY;AACpC,UAAM,IAAI,UAAU,GAAG,UAAU,oBAAoB;AAAA,EACvD;AAEA,aAAW,gBAAgB,UAAU;AACnC,oBAAgB,WAAW,eAAe,cAAc,SAAS,QAAQ;AAAA,EAC3E;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether the specified callback function returns true for any element of an iterable.
|
|
3
|
+
*
|
|
4
|
+
* @param predicate
|
|
5
|
+
* A function that accepts up to three arguments. The some method calls the predicate function for each element in the iterable until the predicate returns a value which is coercible to the Boolean value true, or until the end of the iterable.
|
|
6
|
+
*
|
|
7
|
+
* @param thisArg
|
|
8
|
+
* An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
|
|
9
|
+
*/
|
|
10
|
+
declare function iterableSome<T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => unknown, thisArg?: any): boolean;
|
|
11
|
+
|
|
12
|
+
export { iterableSome };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether the specified callback function returns true for any element of an iterable.
|
|
3
|
+
*
|
|
4
|
+
* @param predicate
|
|
5
|
+
* A function that accepts up to three arguments. The some method calls the predicate function for each element in the iterable until the predicate returns a value which is coercible to the Boolean value true, or until the end of the iterable.
|
|
6
|
+
*
|
|
7
|
+
* @param thisArg
|
|
8
|
+
* An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
|
|
9
|
+
*/
|
|
10
|
+
declare function iterableSome<T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => unknown, thisArg?: any): boolean;
|
|
11
|
+
|
|
12
|
+
export { iterableSome };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/iterableSome.ts
|
|
21
|
+
var iterableSome_exports = {};
|
|
22
|
+
__export(iterableSome_exports, {
|
|
23
|
+
iterableSome: () => iterableSome
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(iterableSome_exports);
|
|
26
|
+
function iterableSome(iterable, predicate, thisArg = void 0) {
|
|
27
|
+
let index = 0;
|
|
28
|
+
if (typeof predicate !== "function") {
|
|
29
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
30
|
+
}
|
|
31
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
32
|
+
for (const value of iterable) {
|
|
33
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
iterableSome
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=iter-fest.iterableSome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableSome.ts"],"sourcesContent":["/**\n * Determines whether the specified callback function returns true for any element of an iterable.\n *\n * @param predicate\n * A function that accepts up to three arguments. The some method calls the predicate function for each element in the iterable until the predicate returns a value which is coercible to the Boolean value true, or until the end of the iterable.\n *\n * @param thisArg\n * An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableSome<T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg: any = undefined\n): boolean {\n let index = 0;\n\n if (typeof predicate !== 'function') {\n throw new TypeError(`${predicate} is not a function`);\n }\n\n const boundPredicate = predicate.bind(thisArg);\n\n for (const value of iterable) {\n if (boundPredicate(value, index++, iterable)) {\n return true;\n }\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,SAAS,aACd,UACA,WAEA,UAAe,QACN;AACT,MAAI,QAAQ;AAEZ,MAAI,OAAO,cAAc,YAAY;AACnC,UAAM,IAAI,UAAU,GAAG,SAAS,oBAAoB;AAAA,EACtD;AAEA,QAAM,iBAAiB,UAAU,KAAK,OAAO;AAE7C,aAAW,SAAS,UAAU;AAC5B,QAAI,eAAe,OAAO,SAAS,QAAQ,GAAG;AAC5C,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/iter-fest.js
CHANGED
|
@@ -9,11 +9,11 @@ var __export = (target, all) => {
|
|
|
9
9
|
for (var name in all)
|
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
|
-
var __copyProps = (to,
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
15
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () =>
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
@@ -30,41 +30,35 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
-
IterableWritableStream: () => IterableWritableStream,
|
|
34
33
|
Observable: () => Observable,
|
|
34
|
+
PushAsyncIterableIterator: () => PushAsyncIterableIterator,
|
|
35
35
|
SymbolObservable: () => SymbolObservable,
|
|
36
36
|
asyncGeneratorWithLastValue: () => asyncGeneratorWithLastValue,
|
|
37
|
-
asyncIteratorToAsyncIterable: () => asyncIteratorToAsyncIterable,
|
|
38
37
|
generatorWithLastValue: () => generatorWithLastValue,
|
|
39
38
|
iterableAt: () => iterableAt,
|
|
40
39
|
iterableConcat: () => iterableConcat,
|
|
41
40
|
iterableEntries: () => iterableEntries,
|
|
41
|
+
iterableEvery: () => iterableEvery,
|
|
42
|
+
iterableFilter: () => iterableFilter,
|
|
43
|
+
iterableFind: () => iterableFind,
|
|
42
44
|
iterableFindIndex: () => iterableFindIndex,
|
|
43
45
|
iterableFindLast: () => iterableFindLast,
|
|
44
46
|
iterableFindLastIndex: () => iterableFindLastIndex,
|
|
47
|
+
iterableForEach: () => iterableForEach,
|
|
48
|
+
iterableGetReadable: () => iterableGetReadable,
|
|
45
49
|
iterableIncludes: () => iterableIncludes,
|
|
46
50
|
iterableIndexOf: () => iterableIndexOf,
|
|
47
51
|
iterableJoin: () => iterableJoin,
|
|
48
52
|
iterableKeys: () => iterableKeys,
|
|
53
|
+
iterableMap: () => iterableMap,
|
|
54
|
+
iterableReduce: () => iterableReduce,
|
|
49
55
|
iterableSlice: () => iterableSlice,
|
|
56
|
+
iterableSome: () => iterableSome,
|
|
50
57
|
iterableToSpliced: () => iterableToSpliced,
|
|
51
58
|
iterableToString: () => iterableToString,
|
|
52
|
-
iteratorDrop: () => iteratorDrop,
|
|
53
|
-
iteratorEvery: () => iteratorEvery,
|
|
54
|
-
iteratorFilter: () => iteratorFilter,
|
|
55
|
-
iteratorFind: () => iteratorFind,
|
|
56
|
-
iteratorFlatMap: () => iteratorFlatMap,
|
|
57
|
-
iteratorForEach: () => iteratorForEach,
|
|
58
|
-
iteratorFrom: () => iteratorFrom,
|
|
59
|
-
iteratorMap: () => iteratorMap,
|
|
60
|
-
iteratorReduce: () => iteratorReduce,
|
|
61
|
-
iteratorSome: () => iteratorSome,
|
|
62
|
-
iteratorTake: () => iteratorTake,
|
|
63
|
-
iteratorToArray: () => iteratorToArray,
|
|
64
59
|
iteratorToIterable: () => iteratorToIterable,
|
|
65
60
|
observableFromAsync: () => observableFromAsync,
|
|
66
61
|
observableSubscribeAsReadable: () => observableSubscribeAsReadable,
|
|
67
|
-
readableStreamFrom: () => readableStreamFrom,
|
|
68
62
|
readerValues: () => readerValues
|
|
69
63
|
});
|
|
70
64
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -97,6 +91,39 @@ var Observable = class extends import_observable2.default {
|
|
|
97
91
|
}
|
|
98
92
|
};
|
|
99
93
|
|
|
94
|
+
// src/private/withResolvers.ts
|
|
95
|
+
var import_with_resolvers = __toESM(require("core-js-pure/full/promise/with-resolvers"));
|
|
96
|
+
function withResolvers() {
|
|
97
|
+
return (0, import_with_resolvers.default)();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// src/PushAsyncIterableIterator.ts
|
|
101
|
+
var CLOSE = Symbol("close");
|
|
102
|
+
var PushAsyncIterableIterator = class {
|
|
103
|
+
#closed = false;
|
|
104
|
+
#pushResolvers = withResolvers();
|
|
105
|
+
[Symbol.asyncIterator]() {
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
close() {
|
|
109
|
+
this.#closed = true;
|
|
110
|
+
this.#pushResolvers.resolve(CLOSE);
|
|
111
|
+
}
|
|
112
|
+
async next() {
|
|
113
|
+
const value = await this.#pushResolvers.promise;
|
|
114
|
+
if (value === CLOSE) {
|
|
115
|
+
return { done: true, value: void 0 };
|
|
116
|
+
}
|
|
117
|
+
return { done: false, value };
|
|
118
|
+
}
|
|
119
|
+
push(value) {
|
|
120
|
+
if (!this.#closed) {
|
|
121
|
+
this.#pushResolvers.resolve(value);
|
|
122
|
+
this.#pushResolvers = withResolvers();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
100
127
|
// src/asyncGeneratorWithLastValue.ts
|
|
101
128
|
var STILL_ITERATING = Symbol();
|
|
102
129
|
function asyncGeneratorWithLastValue(generator) {
|
|
@@ -128,17 +155,6 @@ function asyncGeneratorWithLastValue(generator) {
|
|
|
128
155
|
return asyncGeneratorWithLastValue2;
|
|
129
156
|
}
|
|
130
157
|
|
|
131
|
-
// src/asyncIteratorToAsyncIterable.ts
|
|
132
|
-
function asyncIteratorToAsyncIterable(asyncIterator) {
|
|
133
|
-
const asyncIterableIterator = {
|
|
134
|
-
[Symbol.asyncIterator]: () => asyncIterableIterator,
|
|
135
|
-
next: asyncIterator.next.bind(asyncIterator),
|
|
136
|
-
...asyncIterator.return ? { return: asyncIterator.return.bind(asyncIterator) } : {},
|
|
137
|
-
...asyncIterator.throw ? { throw: asyncIterator.throw.bind(asyncIterator) } : {}
|
|
138
|
-
};
|
|
139
|
-
return asyncIterableIterator;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
158
|
// src/generatorWithLastValue.ts
|
|
143
159
|
var STILL_ITERATING2 = Symbol();
|
|
144
160
|
function generatorWithLastValue(generator) {
|
|
@@ -216,6 +232,50 @@ function* iterableEntries(iterable) {
|
|
|
216
232
|
}
|
|
217
233
|
}
|
|
218
234
|
|
|
235
|
+
// src/iterableEvery.ts
|
|
236
|
+
function iterableEvery(iterable, predicate, thisArg = void 0) {
|
|
237
|
+
let index = 0;
|
|
238
|
+
if (typeof predicate !== "function") {
|
|
239
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
240
|
+
}
|
|
241
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
242
|
+
for (const value of iterable) {
|
|
243
|
+
if (!boundPredicate(value, index++, iterable)) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// src/iterableFilter.ts
|
|
251
|
+
function* iterableFilter(iterable, predicate, thisArg) {
|
|
252
|
+
let index = 0;
|
|
253
|
+
if (typeof predicate !== "function") {
|
|
254
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
255
|
+
}
|
|
256
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
257
|
+
for (const value of iterable) {
|
|
258
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
259
|
+
yield value;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// src/iterableFind.ts
|
|
265
|
+
function iterableFind(iterable, predicate, thisArg) {
|
|
266
|
+
let index = 0;
|
|
267
|
+
if (typeof predicate !== "function") {
|
|
268
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
269
|
+
}
|
|
270
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
271
|
+
for (const value of iterable) {
|
|
272
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
273
|
+
return value;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return void 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
219
279
|
// src/iterableFindIndex.ts
|
|
220
280
|
function iterableFindIndex(iterable, predicate, thisArg) {
|
|
221
281
|
let index = 0;
|
|
@@ -265,6 +325,36 @@ function iterableFindLastIndex(iterable, predicate, thisArg) {
|
|
|
265
325
|
return lastIndex;
|
|
266
326
|
}
|
|
267
327
|
|
|
328
|
+
// src/iterableForEach.ts
|
|
329
|
+
function iterableForEach(iterable, callbackfn, thisArg) {
|
|
330
|
+
let index = 0;
|
|
331
|
+
if (typeof callbackfn !== "function") {
|
|
332
|
+
throw new TypeError(`${callbackfn} is not a function`);
|
|
333
|
+
}
|
|
334
|
+
const boundCallbackfn = callbackfn.bind(thisArg);
|
|
335
|
+
for (const value of iterable) {
|
|
336
|
+
boundCallbackfn(value, index++, iterable);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// src/iterableGetReadable.ts
|
|
341
|
+
function isIterable(iterable) {
|
|
342
|
+
return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
|
|
343
|
+
}
|
|
344
|
+
function iterableGetReadable(iterable) {
|
|
345
|
+
const iterator = isIterable(iterable) ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
|
346
|
+
return new ReadableStream({
|
|
347
|
+
async pull(controller) {
|
|
348
|
+
const result = await iterator.next();
|
|
349
|
+
if (result.done) {
|
|
350
|
+
controller.close();
|
|
351
|
+
} else {
|
|
352
|
+
controller.enqueue(result.value);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
|
|
268
358
|
// src/iterableIncludes.ts
|
|
269
359
|
function iterableIncludes(iterable, searchElement, fromIndex = 0) {
|
|
270
360
|
let index = 0;
|
|
@@ -326,6 +416,30 @@ function* iterableKeys(iterable) {
|
|
|
326
416
|
}
|
|
327
417
|
}
|
|
328
418
|
|
|
419
|
+
// src/iterableMap.ts
|
|
420
|
+
function* iterableMap(iterable, callbackfn, thisArg) {
|
|
421
|
+
let index = 0;
|
|
422
|
+
if (typeof callbackfn !== "function") {
|
|
423
|
+
throw new TypeError(`${callbackfn} is not a function`);
|
|
424
|
+
}
|
|
425
|
+
for (const value of iterable) {
|
|
426
|
+
yield callbackfn.call(thisArg, value, index++, iterable);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// src/iterableReduce.ts
|
|
431
|
+
function iterableReduce(iterable, callbackfn, initialValue) {
|
|
432
|
+
let index = 0;
|
|
433
|
+
let previousValue = initialValue;
|
|
434
|
+
if (typeof callbackfn !== "function") {
|
|
435
|
+
throw new TypeError(`${callbackfn} is not a function`);
|
|
436
|
+
}
|
|
437
|
+
for (const currentValue of iterable) {
|
|
438
|
+
previousValue = callbackfn(previousValue, currentValue, index++, iterable);
|
|
439
|
+
}
|
|
440
|
+
return previousValue;
|
|
441
|
+
}
|
|
442
|
+
|
|
329
443
|
// src/iterableSlice.ts
|
|
330
444
|
function* iterableSlice(iterable, start = 0, end = Infinity) {
|
|
331
445
|
let index = 0;
|
|
@@ -353,6 +467,21 @@ function* iterableSlice(iterable, start = 0, end = Infinity) {
|
|
|
353
467
|
}
|
|
354
468
|
}
|
|
355
469
|
|
|
470
|
+
// src/iterableSome.ts
|
|
471
|
+
function iterableSome(iterable, predicate, thisArg = void 0) {
|
|
472
|
+
let index = 0;
|
|
473
|
+
if (typeof predicate !== "function") {
|
|
474
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
475
|
+
}
|
|
476
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
477
|
+
for (const value of iterable) {
|
|
478
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
|
|
356
485
|
// src/iterableToSpliced.ts
|
|
357
486
|
function* iterableToSpliced(iterable, start = 0, deleteCount = 0, ...items) {
|
|
358
487
|
let index = 0;
|
|
@@ -382,120 +511,6 @@ function iterableToString(iterable) {
|
|
|
382
511
|
return iterableJoin(iterable);
|
|
383
512
|
}
|
|
384
513
|
|
|
385
|
-
// src/private/withResolvers.ts
|
|
386
|
-
var import_with_resolvers = __toESM(require("core-js-pure/full/promise/with-resolvers"));
|
|
387
|
-
function withResolvers() {
|
|
388
|
-
return (0, import_with_resolvers.default)();
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
// src/iterableWritableStream.ts
|
|
392
|
-
var CLOSE = Symbol();
|
|
393
|
-
var IterableWritableStream = class extends WritableStream {
|
|
394
|
-
constructor() {
|
|
395
|
-
super({
|
|
396
|
-
close: () => {
|
|
397
|
-
this.#buffer.push(CLOSE);
|
|
398
|
-
this.#writeResolvers.resolve();
|
|
399
|
-
},
|
|
400
|
-
write: (chunk) => {
|
|
401
|
-
this.#buffer.push(chunk);
|
|
402
|
-
this.#writeResolvers.resolve();
|
|
403
|
-
this.#writeResolvers = withResolvers();
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
#buffer = [];
|
|
408
|
-
#writeResolvers = withResolvers();
|
|
409
|
-
[Symbol.asyncIterator]() {
|
|
410
|
-
return {
|
|
411
|
-
next: async () => {
|
|
412
|
-
while (!this.#buffer.length) {
|
|
413
|
-
await this.#writeResolvers.promise;
|
|
414
|
-
}
|
|
415
|
-
const value = this.#buffer[0];
|
|
416
|
-
if (value === CLOSE) {
|
|
417
|
-
return { done: true, value: void 0 };
|
|
418
|
-
}
|
|
419
|
-
this.#buffer.shift();
|
|
420
|
-
await void 0;
|
|
421
|
-
return { done: false, value };
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
// src/iteratorDrop.ts
|
|
428
|
-
var import_drop = __toESM(require("core-js-pure/full/iterator/drop"));
|
|
429
|
-
function iteratorDrop(iterator, limit) {
|
|
430
|
-
return (0, import_drop.default)(iterator, limit);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
// src/iteratorEvery.ts
|
|
434
|
-
var import_every = __toESM(require("core-js-pure/full/iterator/every"));
|
|
435
|
-
function iteratorEvery(iterator, predicate) {
|
|
436
|
-
return (0, import_every.default)(iterator, predicate);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
// src/iteratorFilter.ts
|
|
440
|
-
var import_filter = __toESM(require("core-js-pure/full/iterator/filter"));
|
|
441
|
-
function iteratorFilter(iterator, predicate) {
|
|
442
|
-
return (0, import_filter.default)(iterator, predicate);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
// src/iteratorFind.ts
|
|
446
|
-
var import_find = __toESM(require("core-js-pure/full/iterator/find"));
|
|
447
|
-
function iteratorFind(iterator, predicate) {
|
|
448
|
-
return (0, import_find.default)(iterator, predicate);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
// src/iteratorFlatMap.ts
|
|
452
|
-
var import_flat_map = __toESM(require("core-js-pure/full/iterator/flat-map"));
|
|
453
|
-
function iteratorFlatMap(iterable, mapperFn) {
|
|
454
|
-
return (0, import_flat_map.default)(iterable, mapperFn);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// src/iteratorForEach.ts
|
|
458
|
-
var import_for_each = __toESM(require("core-js-pure/full/iterator/for-each"));
|
|
459
|
-
function iteratorForEach(iterator, callbackfn) {
|
|
460
|
-
(0, import_for_each.default)(iterator, callbackfn);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// src/iteratorFrom.ts
|
|
464
|
-
var import_from = __toESM(require("core-js-pure/full/iterator/from"));
|
|
465
|
-
function iteratorFrom(iteratorLike) {
|
|
466
|
-
return (0, import_from.default)(iteratorLike);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
// src/iteratorMap.ts
|
|
470
|
-
var import_map = __toESM(require("core-js-pure/full/iterator/map"));
|
|
471
|
-
function iteratorMap(iterator, callbackfn) {
|
|
472
|
-
return (0, import_map.default)(iterator, callbackfn);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// src/iteratorReduce.ts
|
|
476
|
-
var import_reduce = __toESM(require("core-js-pure/full/iterator/reduce"));
|
|
477
|
-
function iteratorReduce(iterator, callbackfn, initialValue) {
|
|
478
|
-
return (0, import_reduce.default)(iterator, callbackfn, initialValue);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
// src/iteratorSome.ts
|
|
482
|
-
var import_some = __toESM(require("core-js-pure/full/iterator/some"));
|
|
483
|
-
function iteratorSome(iterator, predicate) {
|
|
484
|
-
return (0, import_some.default)(iterator, predicate);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
// src/iteratorTake.ts
|
|
488
|
-
var import_take = __toESM(require("core-js-pure/full/iterator/take"));
|
|
489
|
-
function iteratorTake(iterator, limit) {
|
|
490
|
-
return (0, import_take.default)(iterator, limit);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
// src/iteratorToArray.ts
|
|
494
|
-
var import_to_array = __toESM(require("core-js-pure/full/iterator/to-array"));
|
|
495
|
-
function iteratorToArray(iteratorLike) {
|
|
496
|
-
return (0, import_to_array.default)(iteratorLike);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
514
|
// src/iteratorToIterable.ts
|
|
500
515
|
function iteratorToIterable(iterator) {
|
|
501
516
|
const iterableIterator = {
|
|
@@ -553,24 +568,6 @@ function observableSubscribeAsReadable(observable) {
|
|
|
553
568
|
});
|
|
554
569
|
}
|
|
555
570
|
|
|
556
|
-
// src/readableStreamFrom.ts
|
|
557
|
-
function isIterable(iterable) {
|
|
558
|
-
return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
|
|
559
|
-
}
|
|
560
|
-
function readableStreamFrom(anyIterable) {
|
|
561
|
-
const iterator = isIterable(anyIterable) ? anyIterable[Symbol.iterator]() : anyIterable[Symbol.asyncIterator]();
|
|
562
|
-
return new ReadableStream({
|
|
563
|
-
async pull(controller) {
|
|
564
|
-
const result = await iterator.next();
|
|
565
|
-
if (result.done) {
|
|
566
|
-
controller.close();
|
|
567
|
-
} else {
|
|
568
|
-
controller.enqueue(result.value);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
|
|
574
571
|
// src/readerValues.ts
|
|
575
572
|
function readerValues(reader) {
|
|
576
573
|
const iterable = {
|
|
@@ -593,41 +590,35 @@ function readerValues(reader) {
|
|
|
593
590
|
}
|
|
594
591
|
// Annotate the CommonJS export names for ESM import in node:
|
|
595
592
|
0 && (module.exports = {
|
|
596
|
-
IterableWritableStream,
|
|
597
593
|
Observable,
|
|
594
|
+
PushAsyncIterableIterator,
|
|
598
595
|
SymbolObservable,
|
|
599
596
|
asyncGeneratorWithLastValue,
|
|
600
|
-
asyncIteratorToAsyncIterable,
|
|
601
597
|
generatorWithLastValue,
|
|
602
598
|
iterableAt,
|
|
603
599
|
iterableConcat,
|
|
604
600
|
iterableEntries,
|
|
601
|
+
iterableEvery,
|
|
602
|
+
iterableFilter,
|
|
603
|
+
iterableFind,
|
|
605
604
|
iterableFindIndex,
|
|
606
605
|
iterableFindLast,
|
|
607
606
|
iterableFindLastIndex,
|
|
607
|
+
iterableForEach,
|
|
608
|
+
iterableGetReadable,
|
|
608
609
|
iterableIncludes,
|
|
609
610
|
iterableIndexOf,
|
|
610
611
|
iterableJoin,
|
|
611
612
|
iterableKeys,
|
|
613
|
+
iterableMap,
|
|
614
|
+
iterableReduce,
|
|
612
615
|
iterableSlice,
|
|
616
|
+
iterableSome,
|
|
613
617
|
iterableToSpliced,
|
|
614
618
|
iterableToString,
|
|
615
|
-
iteratorDrop,
|
|
616
|
-
iteratorEvery,
|
|
617
|
-
iteratorFilter,
|
|
618
|
-
iteratorFind,
|
|
619
|
-
iteratorFlatMap,
|
|
620
|
-
iteratorForEach,
|
|
621
|
-
iteratorFrom,
|
|
622
|
-
iteratorMap,
|
|
623
|
-
iteratorReduce,
|
|
624
|
-
iteratorSome,
|
|
625
|
-
iteratorTake,
|
|
626
|
-
iteratorToArray,
|
|
627
619
|
iteratorToIterable,
|
|
628
620
|
observableFromAsync,
|
|
629
621
|
observableSubscribeAsReadable,
|
|
630
|
-
readableStreamFrom,
|
|
631
622
|
readerValues
|
|
632
623
|
});
|
|
633
624
|
//# sourceMappingURL=iter-fest.js.map
|