iter-fest 0.1.1-main.149c8ad → 0.1.1-main.1dec735
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 -90
- 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 -14
- package/dist/iter-fest.d.ts +9 -14
- package/dist/iter-fest.iterableEvery.d.mts +24 -0
- package/dist/iter-fest.iterableEvery.d.ts +24 -0
- package/dist/iter-fest.iterableEvery.js +43 -0
- 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 -164
- package/dist/iter-fest.js.map +1 -1
- package/dist/iter-fest.mjs +52 -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 -137
- 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-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.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.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.iterableWritableStream.mjs.map → iter-fest.iterableEvery.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorDrop.mjs.map → iter-fest.iterableFilter.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorEvery.mjs.map → iter-fest.iterableFind.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFilter.mjs.map → iter-fest.iterableForEach.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFind.mjs.map → iter-fest.iterableGetReadable.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFlatMap.mjs.map → iter-fest.iterableMap.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorForEach.mjs.map → iter-fest.iterableReduce.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorFrom.mjs.map → iter-fest.iterableSome.mjs.map} +0 -0
- /package/dist/{iter-fest.iteratorMap.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,8 +30,8 @@ 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
37
|
asyncIteratorToAsyncIterable: () => asyncIteratorToAsyncIterable,
|
|
@@ -39,32 +39,27 @@ __export(src_exports, {
|
|
|
39
39
|
iterableAt: () => iterableAt,
|
|
40
40
|
iterableConcat: () => iterableConcat,
|
|
41
41
|
iterableEntries: () => iterableEntries,
|
|
42
|
+
iterableEvery: () => iterableEvery,
|
|
43
|
+
iterableFilter: () => iterableFilter,
|
|
44
|
+
iterableFind: () => iterableFind,
|
|
42
45
|
iterableFindIndex: () => iterableFindIndex,
|
|
43
46
|
iterableFindLast: () => iterableFindLast,
|
|
44
47
|
iterableFindLastIndex: () => iterableFindLastIndex,
|
|
48
|
+
iterableForEach: () => iterableForEach,
|
|
49
|
+
iterableGetReadable: () => iterableGetReadable,
|
|
45
50
|
iterableIncludes: () => iterableIncludes,
|
|
46
51
|
iterableIndexOf: () => iterableIndexOf,
|
|
47
52
|
iterableJoin: () => iterableJoin,
|
|
48
53
|
iterableKeys: () => iterableKeys,
|
|
54
|
+
iterableMap: () => iterableMap,
|
|
55
|
+
iterableReduce: () => iterableReduce,
|
|
49
56
|
iterableSlice: () => iterableSlice,
|
|
57
|
+
iterableSome: () => iterableSome,
|
|
50
58
|
iterableToSpliced: () => iterableToSpliced,
|
|
51
59
|
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
60
|
iteratorToIterable: () => iteratorToIterable,
|
|
65
61
|
observableFromAsync: () => observableFromAsync,
|
|
66
62
|
observableSubscribeAsReadable: () => observableSubscribeAsReadable,
|
|
67
|
-
readableStreamFrom: () => readableStreamFrom,
|
|
68
63
|
readerValues: () => readerValues
|
|
69
64
|
});
|
|
70
65
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -97,6 +92,39 @@ var Observable = class extends import_observable2.default {
|
|
|
97
92
|
}
|
|
98
93
|
};
|
|
99
94
|
|
|
95
|
+
// src/private/withResolvers.ts
|
|
96
|
+
var import_with_resolvers = __toESM(require("core-js-pure/full/promise/with-resolvers"));
|
|
97
|
+
function withResolvers() {
|
|
98
|
+
return (0, import_with_resolvers.default)();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/PushAsyncIterableIterator.ts
|
|
102
|
+
var CLOSE = Symbol("close");
|
|
103
|
+
var PushAsyncIterableIterator = class {
|
|
104
|
+
#closed = false;
|
|
105
|
+
#pushResolvers = withResolvers();
|
|
106
|
+
[Symbol.asyncIterator]() {
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
close() {
|
|
110
|
+
this.#closed = true;
|
|
111
|
+
this.#pushResolvers.resolve(CLOSE);
|
|
112
|
+
}
|
|
113
|
+
async next() {
|
|
114
|
+
const value = await this.#pushResolvers.promise;
|
|
115
|
+
if (value === CLOSE) {
|
|
116
|
+
return { done: true, value: void 0 };
|
|
117
|
+
}
|
|
118
|
+
return { done: false, value };
|
|
119
|
+
}
|
|
120
|
+
push(value) {
|
|
121
|
+
if (!this.#closed) {
|
|
122
|
+
this.#pushResolvers.resolve(value);
|
|
123
|
+
this.#pushResolvers = withResolvers();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
100
128
|
// src/asyncGeneratorWithLastValue.ts
|
|
101
129
|
var STILL_ITERATING = Symbol();
|
|
102
130
|
function asyncGeneratorWithLastValue(generator) {
|
|
@@ -216,6 +244,50 @@ function* iterableEntries(iterable) {
|
|
|
216
244
|
}
|
|
217
245
|
}
|
|
218
246
|
|
|
247
|
+
// src/iterableEvery.ts
|
|
248
|
+
function iterableEvery(iterable, predicate, thisArg = void 0) {
|
|
249
|
+
let index = 0;
|
|
250
|
+
if (typeof predicate !== "function") {
|
|
251
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
252
|
+
}
|
|
253
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
254
|
+
for (const value of iterable) {
|
|
255
|
+
if (!boundPredicate(value, index++, iterable)) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// src/iterableFilter.ts
|
|
263
|
+
function* iterableFilter(iterable, predicate, thisArg) {
|
|
264
|
+
let index = 0;
|
|
265
|
+
if (typeof predicate !== "function") {
|
|
266
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
267
|
+
}
|
|
268
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
269
|
+
for (const value of iterable) {
|
|
270
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
271
|
+
yield value;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// src/iterableFind.ts
|
|
277
|
+
function iterableFind(iterable, predicate, thisArg) {
|
|
278
|
+
let index = 0;
|
|
279
|
+
if (typeof predicate !== "function") {
|
|
280
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
281
|
+
}
|
|
282
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
283
|
+
for (const value of iterable) {
|
|
284
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
285
|
+
return value;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return void 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
219
291
|
// src/iterableFindIndex.ts
|
|
220
292
|
function iterableFindIndex(iterable, predicate, thisArg) {
|
|
221
293
|
let index = 0;
|
|
@@ -265,6 +337,36 @@ function iterableFindLastIndex(iterable, predicate, thisArg) {
|
|
|
265
337
|
return lastIndex;
|
|
266
338
|
}
|
|
267
339
|
|
|
340
|
+
// src/iterableForEach.ts
|
|
341
|
+
function iterableForEach(iterable, callbackfn, thisArg) {
|
|
342
|
+
let index = 0;
|
|
343
|
+
if (typeof callbackfn !== "function") {
|
|
344
|
+
throw new TypeError(`${callbackfn} is not a function`);
|
|
345
|
+
}
|
|
346
|
+
const boundCallbackfn = callbackfn.bind(thisArg);
|
|
347
|
+
for (const value of iterable) {
|
|
348
|
+
boundCallbackfn(value, index++, iterable);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// src/iterableGetReadable.ts
|
|
353
|
+
function isIterable(iterable) {
|
|
354
|
+
return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
|
|
355
|
+
}
|
|
356
|
+
function iterableGetReadable(iterable) {
|
|
357
|
+
const iterator = isIterable(iterable) ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
|
358
|
+
return new ReadableStream({
|
|
359
|
+
async pull(controller) {
|
|
360
|
+
const result = await iterator.next();
|
|
361
|
+
if (result.done) {
|
|
362
|
+
controller.close();
|
|
363
|
+
} else {
|
|
364
|
+
controller.enqueue(result.value);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
268
370
|
// src/iterableIncludes.ts
|
|
269
371
|
function iterableIncludes(iterable, searchElement, fromIndex = 0) {
|
|
270
372
|
let index = 0;
|
|
@@ -326,6 +428,30 @@ function* iterableKeys(iterable) {
|
|
|
326
428
|
}
|
|
327
429
|
}
|
|
328
430
|
|
|
431
|
+
// src/iterableMap.ts
|
|
432
|
+
function* iterableMap(iterable, callbackfn, thisArg) {
|
|
433
|
+
let index = 0;
|
|
434
|
+
if (typeof callbackfn !== "function") {
|
|
435
|
+
throw new TypeError(`${callbackfn} is not a function`);
|
|
436
|
+
}
|
|
437
|
+
for (const value of iterable) {
|
|
438
|
+
yield callbackfn.call(thisArg, value, index++, iterable);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// src/iterableReduce.ts
|
|
443
|
+
function iterableReduce(iterable, callbackfn, initialValue) {
|
|
444
|
+
let index = 0;
|
|
445
|
+
let previousValue = initialValue;
|
|
446
|
+
if (typeof callbackfn !== "function") {
|
|
447
|
+
throw new TypeError(`${callbackfn} is not a function`);
|
|
448
|
+
}
|
|
449
|
+
for (const currentValue of iterable) {
|
|
450
|
+
previousValue = callbackfn(previousValue, currentValue, index++, iterable);
|
|
451
|
+
}
|
|
452
|
+
return previousValue;
|
|
453
|
+
}
|
|
454
|
+
|
|
329
455
|
// src/iterableSlice.ts
|
|
330
456
|
function* iterableSlice(iterable, start = 0, end = Infinity) {
|
|
331
457
|
let index = 0;
|
|
@@ -353,6 +479,21 @@ function* iterableSlice(iterable, start = 0, end = Infinity) {
|
|
|
353
479
|
}
|
|
354
480
|
}
|
|
355
481
|
|
|
482
|
+
// src/iterableSome.ts
|
|
483
|
+
function iterableSome(iterable, predicate, thisArg = void 0) {
|
|
484
|
+
let index = 0;
|
|
485
|
+
if (typeof predicate !== "function") {
|
|
486
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
487
|
+
}
|
|
488
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
489
|
+
for (const value of iterable) {
|
|
490
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return false;
|
|
495
|
+
}
|
|
496
|
+
|
|
356
497
|
// src/iterableToSpliced.ts
|
|
357
498
|
function* iterableToSpliced(iterable, start = 0, deleteCount = 0, ...items) {
|
|
358
499
|
let index = 0;
|
|
@@ -382,120 +523,6 @@ function iterableToString(iterable) {
|
|
|
382
523
|
return iterableJoin(iterable);
|
|
383
524
|
}
|
|
384
525
|
|
|
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
526
|
// src/iteratorToIterable.ts
|
|
500
527
|
function iteratorToIterable(iterator) {
|
|
501
528
|
const iterableIterator = {
|
|
@@ -553,24 +580,6 @@ function observableSubscribeAsReadable(observable) {
|
|
|
553
580
|
});
|
|
554
581
|
}
|
|
555
582
|
|
|
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
583
|
// src/readerValues.ts
|
|
575
584
|
function readerValues(reader) {
|
|
576
585
|
const iterable = {
|
|
@@ -593,8 +602,8 @@ function readerValues(reader) {
|
|
|
593
602
|
}
|
|
594
603
|
// Annotate the CommonJS export names for ESM import in node:
|
|
595
604
|
0 && (module.exports = {
|
|
596
|
-
IterableWritableStream,
|
|
597
605
|
Observable,
|
|
606
|
+
PushAsyncIterableIterator,
|
|
598
607
|
SymbolObservable,
|
|
599
608
|
asyncGeneratorWithLastValue,
|
|
600
609
|
asyncIteratorToAsyncIterable,
|
|
@@ -602,32 +611,27 @@ function readerValues(reader) {
|
|
|
602
611
|
iterableAt,
|
|
603
612
|
iterableConcat,
|
|
604
613
|
iterableEntries,
|
|
614
|
+
iterableEvery,
|
|
615
|
+
iterableFilter,
|
|
616
|
+
iterableFind,
|
|
605
617
|
iterableFindIndex,
|
|
606
618
|
iterableFindLast,
|
|
607
619
|
iterableFindLastIndex,
|
|
620
|
+
iterableForEach,
|
|
621
|
+
iterableGetReadable,
|
|
608
622
|
iterableIncludes,
|
|
609
623
|
iterableIndexOf,
|
|
610
624
|
iterableJoin,
|
|
611
625
|
iterableKeys,
|
|
626
|
+
iterableMap,
|
|
627
|
+
iterableReduce,
|
|
612
628
|
iterableSlice,
|
|
629
|
+
iterableSome,
|
|
613
630
|
iterableToSpliced,
|
|
614
631
|
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
632
|
iteratorToIterable,
|
|
628
633
|
observableFromAsync,
|
|
629
634
|
observableSubscribeAsReadable,
|
|
630
|
-
readableStreamFrom,
|
|
631
635
|
readerValues
|
|
632
636
|
});
|
|
633
637
|
//# sourceMappingURL=iter-fest.js.map
|