iter-fest 0.0.0-main.f37b579
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/LICENSE +21 -0
- package/README.md +137 -0
- package/dist/chunk-27NJVC7K.mjs +26 -0
- package/dist/chunk-27NJVC7K.mjs.map +1 -0
- package/dist/chunk-44W7OTNE.mjs +12 -0
- package/dist/chunk-44W7OTNE.mjs.map +1 -0
- package/dist/chunk-5CHMNKXJ.mjs +20 -0
- package/dist/chunk-5CHMNKXJ.mjs.map +1 -0
- 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-GWZF5BB7.mjs +16 -0
- package/dist/chunk-GWZF5BB7.mjs.map +1 -0
- package/dist/chunk-HYU4EN7J.mjs +20 -0
- package/dist/chunk-HYU4EN7J.mjs.map +1 -0
- package/dist/chunk-JU353VSE.mjs +16 -0
- package/dist/chunk-JU353VSE.mjs.map +1 -0
- package/dist/chunk-KONB7TV6.mjs +35 -0
- package/dist/chunk-KONB7TV6.mjs.map +1 -0
- package/dist/chunk-MDBK7ND5.mjs +26 -0
- package/dist/chunk-MDBK7ND5.mjs.map +1 -0
- package/dist/chunk-MNDAEMYM.mjs +15 -0
- package/dist/chunk-MNDAEMYM.mjs.map +1 -0
- package/dist/chunk-MNLOWKTC.mjs +19 -0
- package/dist/chunk-MNLOWKTC.mjs.map +1 -0
- package/dist/chunk-TEI3K6GT.mjs +21 -0
- package/dist/chunk-TEI3K6GT.mjs.map +1 -0
- package/dist/chunk-UIEKIMLW.mjs +27 -0
- package/dist/chunk-UIEKIMLW.mjs.map +1 -0
- package/dist/chunk-V6OWQQ3Q.mjs +20 -0
- package/dist/chunk-V6OWQQ3Q.mjs.map +1 -0
- package/dist/chunk-W5NEOEVE.mjs +12 -0
- package/dist/chunk-W5NEOEVE.mjs.map +1 -0
- package/dist/chunk-WKIRSZXX.mjs +32 -0
- package/dist/chunk-WKIRSZXX.mjs.map +1 -0
- package/dist/chunk-XKBVB2JN.mjs +12 -0
- package/dist/chunk-XKBVB2JN.mjs.map +1 -0
- package/dist/chunk-XW34KZRY.mjs +17 -0
- package/dist/chunk-XW34KZRY.mjs.map +1 -0
- package/dist/chunk-Y5M2C7NQ.mjs +13 -0
- package/dist/chunk-Y5M2C7NQ.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 +21 -0
- package/dist/iter-fest.d.ts +21 -0
- package/dist/iter-fest.iterableAt.d.mts +8 -0
- package/dist/iter-fest.iterableAt.d.ts +8 -0
- package/dist/iter-fest.iterableAt.js +56 -0
- package/dist/iter-fest.iterableAt.js.map +1 -0
- package/dist/iter-fest.iterableAt.mjs +8 -0
- package/dist/iter-fest.iterableAt.mjs.map +1 -0
- package/dist/iter-fest.iterableConcat.d.mts +16 -0
- package/dist/iter-fest.iterableConcat.d.ts +16 -0
- package/dist/iter-fest.iterableConcat.js +40 -0
- package/dist/iter-fest.iterableConcat.js.map +1 -0
- package/dist/iter-fest.iterableConcat.mjs +7 -0
- package/dist/iter-fest.iterableConcat.mjs.map +1 -0
- package/dist/iter-fest.iterableEntries.d.mts +6 -0
- package/dist/iter-fest.iterableEntries.d.ts +6 -0
- package/dist/iter-fest.iterableEntries.js +36 -0
- package/dist/iter-fest.iterableEntries.js.map +1 -0
- package/dist/iter-fest.iterableEntries.mjs +7 -0
- package/dist/iter-fest.iterableEntries.mjs.map +1 -0
- 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.iterableEvery.mjs.map +1 -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.iterableFilter.mjs.map +1 -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.iterableFind.mjs.map +1 -0
- package/dist/iter-fest.iterableFindIndex.d.mts +14 -0
- package/dist/iter-fest.iterableFindIndex.d.ts +14 -0
- package/dist/iter-fest.iterableFindIndex.js +44 -0
- package/dist/iter-fest.iterableFindIndex.js.map +1 -0
- package/dist/iter-fest.iterableFindIndex.mjs +7 -0
- package/dist/iter-fest.iterableFindIndex.mjs.map +1 -0
- package/dist/iter-fest.iterableFindLast.d.mts +15 -0
- package/dist/iter-fest.iterableFindLast.d.ts +15 -0
- package/dist/iter-fest.iterableFindLast.js +44 -0
- package/dist/iter-fest.iterableFindLast.js.map +1 -0
- package/dist/iter-fest.iterableFindLast.mjs +7 -0
- package/dist/iter-fest.iterableFindLast.mjs.map +1 -0
- package/dist/iter-fest.iterableFindLastIndex.d.mts +14 -0
- package/dist/iter-fest.iterableFindLastIndex.d.ts +14 -0
- package/dist/iter-fest.iterableFindLastIndex.js +45 -0
- package/dist/iter-fest.iterableFindLastIndex.js.map +1 -0
- package/dist/iter-fest.iterableFindLastIndex.mjs +7 -0
- package/dist/iter-fest.iterableFindLastIndex.mjs.map +1 -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.iterableForEach.mjs.map +1 -0
- package/dist/iter-fest.iterableIncludes.d.mts +9 -0
- package/dist/iter-fest.iterableIncludes.d.ts +9 -0
- package/dist/iter-fest.iterableIncludes.js +56 -0
- package/dist/iter-fest.iterableIncludes.js.map +1 -0
- package/dist/iter-fest.iterableIncludes.mjs +8 -0
- package/dist/iter-fest.iterableIncludes.mjs.map +1 -0
- package/dist/iter-fest.iterableIndexOf.d.mts +9 -0
- package/dist/iter-fest.iterableIndexOf.d.ts +9 -0
- package/dist/iter-fest.iterableIndexOf.js +57 -0
- package/dist/iter-fest.iterableIndexOf.js.map +1 -0
- package/dist/iter-fest.iterableIndexOf.mjs +8 -0
- package/dist/iter-fest.iterableIndexOf.mjs.map +1 -0
- package/dist/iter-fest.iterableJoin.d.mts +8 -0
- package/dist/iter-fest.iterableJoin.d.ts +8 -0
- package/dist/iter-fest.iterableJoin.js +44 -0
- package/dist/iter-fest.iterableJoin.js.map +1 -0
- package/dist/iter-fest.iterableJoin.mjs +7 -0
- package/dist/iter-fest.iterableJoin.mjs.map +1 -0
- package/dist/iter-fest.iterableKeys.d.mts +6 -0
- package/dist/iter-fest.iterableKeys.d.ts +6 -0
- package/dist/iter-fest.iterableKeys.js +36 -0
- package/dist/iter-fest.iterableKeys.js.map +1 -0
- package/dist/iter-fest.iterableKeys.mjs +7 -0
- package/dist/iter-fest.iterableKeys.mjs.map +1 -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.iterableMap.mjs.map +1 -0
- package/dist/iter-fest.iterableReduce.d.mts +19 -0
- package/dist/iter-fest.iterableReduce.d.ts +19 -0
- 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.iterableReduce.mjs.map +1 -0
- package/dist/iter-fest.iterableSlice.d.mts +14 -0
- package/dist/iter-fest.iterableSlice.d.ts +14 -0
- package/dist/iter-fest.iterableSlice.js +65 -0
- package/dist/iter-fest.iterableSlice.js.map +1 -0
- package/dist/iter-fest.iterableSlice.mjs +8 -0
- package/dist/iter-fest.iterableSlice.mjs.map +1 -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.iterableSome.mjs.map +1 -0
- package/dist/iter-fest.iterableToSpliced.d.mts +17 -0
- package/dist/iter-fest.iterableToSpliced.d.ts +17 -0
- package/dist/iter-fest.iterableToSpliced.js +62 -0
- package/dist/iter-fest.iterableToSpliced.js.map +1 -0
- package/dist/iter-fest.iterableToSpliced.mjs +8 -0
- package/dist/iter-fest.iterableToSpliced.mjs.map +1 -0
- package/dist/iter-fest.iterableToString.d.mts +6 -0
- package/dist/iter-fest.iterableToString.d.ts +6 -0
- package/dist/iter-fest.iterableToString.js +51 -0
- package/dist/iter-fest.iterableToString.js.map +1 -0
- package/dist/iter-fest.iterableToString.mjs +8 -0
- package/dist/iter-fest.iterableToString.mjs.map +1 -0
- package/dist/iter-fest.iteratorToIterable.d.mts +3 -0
- package/dist/iter-fest.iteratorToIterable.d.ts +3 -0
- package/dist/iter-fest.iteratorToIterable.js +39 -0
- package/dist/iter-fest.iteratorToIterable.js.map +1 -0
- package/dist/iter-fest.iteratorToIterable.mjs +7 -0
- package/dist/iter-fest.iteratorToIterable.mjs.map +1 -0
- package/dist/iter-fest.js +388 -0
- package/dist/iter-fest.js.map +1 -0
- package/dist/iter-fest.mjs +88 -0
- package/dist/iter-fest.mjs.map +1 -0
- package/package.json +279 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toIntegerOrInfinity
|
|
3
|
+
} from "./chunk-W5NEOEVE.mjs";
|
|
4
|
+
|
|
5
|
+
// src/iterableToSpliced.ts
|
|
6
|
+
function* iterableToSpliced(iterable, start = 0, deleteCount = 0, ...items) {
|
|
7
|
+
let index = 0;
|
|
8
|
+
start = toIntegerOrInfinity(start);
|
|
9
|
+
start = start === -Infinity ? 0 : start;
|
|
10
|
+
if (start < 0) {
|
|
11
|
+
throw new TypeError("start cannot be a negative finite number");
|
|
12
|
+
}
|
|
13
|
+
let inserted = false;
|
|
14
|
+
for (const item of iterable) {
|
|
15
|
+
if (index + 1 > start && !inserted) {
|
|
16
|
+
yield* items;
|
|
17
|
+
inserted = true;
|
|
18
|
+
}
|
|
19
|
+
if (index < start || index >= start + deleteCount) {
|
|
20
|
+
yield item;
|
|
21
|
+
}
|
|
22
|
+
index++;
|
|
23
|
+
}
|
|
24
|
+
if (!inserted) {
|
|
25
|
+
yield* items;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
iterableToSpliced
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-WKIRSZXX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableToSpliced.ts"],"sourcesContent":["import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @param items Elements to insert into the copied array in place of the deleted elements.\n * @returns The copied array.\n */\nexport function iterableToSpliced<T>(\n iterable: Iterable<T>,\n start?: number | undefined,\n deleteCount?: number | undefined,\n ...items: T[]\n): Iterable<T>;\n\n/**\n * Copies an array and removes elements while returning the remaining elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @returns A copy of the original array with the remaining elements.\n */\nexport function iterableToSpliced<T>(\n iterable: Iterable<T>,\n start?: number | undefined,\n deleteCount?: number | undefined\n): Iterable<T>;\n\nexport function* iterableToSpliced<T>(\n iterable: Iterable<T>,\n start: number = 0,\n deleteCount: number = 0,\n ...items: T[]\n): Iterable<T> {\n let index = 0;\n\n start = toIntegerOrInfinity(start);\n start = start === -Infinity ? 0 : start;\n\n if (start < 0) {\n throw new TypeError('start cannot be a negative finite number');\n }\n\n let inserted = false;\n\n for (const item of iterable) {\n if (index + 1 > start && !inserted) {\n yield* items;\n inserted = true;\n }\n\n if (index < start || index >= start + deleteCount) {\n yield item;\n }\n\n index++;\n }\n\n if (!inserted) {\n yield* items;\n }\n}\n"],"mappings":";;;;;AA4BO,UAAU,kBACf,UACA,QAAgB,GAChB,cAAsB,MACnB,OACU;AACb,MAAI,QAAQ;AAEZ,UAAQ,oBAAoB,KAAK;AACjC,UAAQ,UAAU,YAAY,IAAI;AAElC,MAAI,QAAQ,GAAG;AACb,UAAM,IAAI,UAAU,0CAA0C;AAAA,EAChE;AAEA,MAAI,WAAW;AAEf,aAAW,QAAQ,UAAU;AAC3B,QAAI,QAAQ,IAAI,SAAS,CAAC,UAAU;AAClC,aAAO;AACP,iBAAW;AAAA,IACb;AAEA,QAAI,QAAQ,SAAS,SAAS,QAAQ,aAAa;AACjD,YAAM;AAAA,IACR;AAEA;AAAA,EACF;AAEA,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableKeys.ts"],"sourcesContent":["/**\n * Returns an iterable of keys in the iterable\n */\nexport function* iterableKeys<T>(iterable: Iterable<T>): IterableIterator<number> {\n let index = 0;\n\n for (const _ of iterable) {\n yield index++;\n }\n}\n"],"mappings":";AAGO,UAAU,aAAgB,UAAiD;AAChF,MAAI,QAAQ;AAEZ,aAAW,KAAK,UAAU;AACxB,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/iterableReduce.ts
|
|
2
|
+
function iterableReduce(iterable, callbackfn, initialValue) {
|
|
3
|
+
let index = 0;
|
|
4
|
+
let previousValue = initialValue;
|
|
5
|
+
if (typeof callbackfn !== "function") {
|
|
6
|
+
throw new TypeError(`${callbackfn} is not a function`);
|
|
7
|
+
}
|
|
8
|
+
for (const currentValue of iterable) {
|
|
9
|
+
previousValue = callbackfn(previousValue, currentValue, index++, iterable);
|
|
10
|
+
}
|
|
11
|
+
return previousValue;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
iterableReduce
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-XW34KZRY.mjs.map
|
|
@@ -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":";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 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableToString.ts"],"sourcesContent":["import { iterableJoin } from './iterableJoin';\n\n/**\n * Returns a string representation of an iterable.\n */\nexport function iterableToString<T>(iterable: Iterable<T>): string {\n return iterableJoin(iterable);\n}\n"],"mappings":";;;;;AAKO,SAAS,iBAAoB,UAA+B;AACjE,SAAO,aAAa,QAAQ;AAC9B;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/iterableFilter.ts
|
|
2
|
+
function* iterableFilter(iterable, predicate, thisArg) {
|
|
3
|
+
let index = 0;
|
|
4
|
+
if (typeof predicate !== "function") {
|
|
5
|
+
throw new TypeError(`${predicate} is not a function`);
|
|
6
|
+
}
|
|
7
|
+
const boundPredicate = predicate.bind(thisArg);
|
|
8
|
+
for (const value of iterable) {
|
|
9
|
+
if (boundPredicate(value, index++, iterable)) {
|
|
10
|
+
yield value;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
iterableFilter
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-ZUBHGSCW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableFilter.ts"],"sourcesContent":["/**\n * Returns the elements of an iterable that meet the condition specified in a callback function.\n *\n * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.\n * @param thisArg 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 iterableFilter<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => value is S,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: unknown\n): IterableIterator<S>;\n\n/**\n * Returns the elements of an iterable that meet the condition specified in a callback function.\n *\n * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.\n * @param thisArg 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 iterableFilter<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\n): IterableIterator<T>;\n\nexport function* iterableFilter<T, S extends 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?: unknown\n): IterableIterator<S> {\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 yield value as S;\n }\n }\n}\n"],"mappings":";AA0BO,UAAU,eACf,UACA,WAEA,SACqB;AACrB,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,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { iterableAt } from './iter-fest.iterableAt.mjs';
|
|
2
|
+
export { iterableConcat } from './iter-fest.iterableConcat.mjs';
|
|
3
|
+
export { iterableEntries } from './iter-fest.iterableEntries.mjs';
|
|
4
|
+
export { iterableEvery } from './iter-fest.iterableEvery.mjs';
|
|
5
|
+
export { iterableFilter } from './iter-fest.iterableFilter.mjs';
|
|
6
|
+
export { iterableFind } from './iter-fest.iterableFind.mjs';
|
|
7
|
+
export { iterableFindIndex } from './iter-fest.iterableFindIndex.mjs';
|
|
8
|
+
export { iterableFindLast } from './iter-fest.iterableFindLast.mjs';
|
|
9
|
+
export { iterableFindLastIndex } from './iter-fest.iterableFindLastIndex.mjs';
|
|
10
|
+
export { iterableForEach } from './iter-fest.iterableForEach.mjs';
|
|
11
|
+
export { iterableIncludes } from './iter-fest.iterableIncludes.mjs';
|
|
12
|
+
export { iterableIndexOf } from './iter-fest.iterableIndexOf.mjs';
|
|
13
|
+
export { iterableJoin } from './iter-fest.iterableJoin.mjs';
|
|
14
|
+
export { iterableKeys } from './iter-fest.iterableKeys.mjs';
|
|
15
|
+
export { iterableMap } from './iter-fest.iterableMap.mjs';
|
|
16
|
+
export { iterableReduce } from './iter-fest.iterableReduce.mjs';
|
|
17
|
+
export { iterableSlice } from './iter-fest.iterableSlice.mjs';
|
|
18
|
+
export { iterableSome } from './iter-fest.iterableSome.mjs';
|
|
19
|
+
export { iterableToSpliced } from './iter-fest.iterableToSpliced.mjs';
|
|
20
|
+
export { iterableToString } from './iter-fest.iterableToString.mjs';
|
|
21
|
+
export { iteratorToIterable } from './iter-fest.iteratorToIterable.mjs';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { iterableAt } from './iter-fest.iterableAt.js';
|
|
2
|
+
export { iterableConcat } from './iter-fest.iterableConcat.js';
|
|
3
|
+
export { iterableEntries } from './iter-fest.iterableEntries.js';
|
|
4
|
+
export { iterableEvery } from './iter-fest.iterableEvery.js';
|
|
5
|
+
export { iterableFilter } from './iter-fest.iterableFilter.js';
|
|
6
|
+
export { iterableFind } from './iter-fest.iterableFind.js';
|
|
7
|
+
export { iterableFindIndex } from './iter-fest.iterableFindIndex.js';
|
|
8
|
+
export { iterableFindLast } from './iter-fest.iterableFindLast.js';
|
|
9
|
+
export { iterableFindLastIndex } from './iter-fest.iterableFindLastIndex.js';
|
|
10
|
+
export { iterableForEach } from './iter-fest.iterableForEach.js';
|
|
11
|
+
export { iterableIncludes } from './iter-fest.iterableIncludes.js';
|
|
12
|
+
export { iterableIndexOf } from './iter-fest.iterableIndexOf.js';
|
|
13
|
+
export { iterableJoin } from './iter-fest.iterableJoin.js';
|
|
14
|
+
export { iterableKeys } from './iter-fest.iterableKeys.js';
|
|
15
|
+
export { iterableMap } from './iter-fest.iterableMap.js';
|
|
16
|
+
export { iterableReduce } from './iter-fest.iterableReduce.js';
|
|
17
|
+
export { iterableSlice } from './iter-fest.iterableSlice.js';
|
|
18
|
+
export { iterableSome } from './iter-fest.iterableSome.js';
|
|
19
|
+
export { iterableToSpliced } from './iter-fest.iterableToSpliced.js';
|
|
20
|
+
export { iterableToString } from './iter-fest.iterableToString.js';
|
|
21
|
+
export { iteratorToIterable } from './iter-fest.iteratorToIterable.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the item located at the specified index.
|
|
3
|
+
*
|
|
4
|
+
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
|
|
5
|
+
*/
|
|
6
|
+
declare function iterableAt<T>(iterable: Iterable<T>, index: number): T | undefined;
|
|
7
|
+
|
|
8
|
+
export { iterableAt };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the item located at the specified index.
|
|
3
|
+
*
|
|
4
|
+
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
|
|
5
|
+
*/
|
|
6
|
+
declare function iterableAt<T>(iterable: Iterable<T>, index: number): T | undefined;
|
|
7
|
+
|
|
8
|
+
export { iterableAt };
|
|
@@ -0,0 +1,56 @@
|
|
|
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/iterableAt.ts
|
|
21
|
+
var iterableAt_exports = {};
|
|
22
|
+
__export(iterableAt_exports, {
|
|
23
|
+
iterableAt: () => iterableAt
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(iterableAt_exports);
|
|
26
|
+
|
|
27
|
+
// src/private/toIntegerOrInfinity.ts
|
|
28
|
+
function toIntegerOrInfinity(value) {
|
|
29
|
+
if (value === Infinity || value === -Infinity) {
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
return ~~value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// src/iterableAt.ts
|
|
36
|
+
function iterableAt(iterable, index) {
|
|
37
|
+
let currentIndex = 0;
|
|
38
|
+
index = toIntegerOrInfinity(index);
|
|
39
|
+
if (!isFinite(index)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (index < 0) {
|
|
43
|
+
throw new TypeError("index cannot be a negative finite number");
|
|
44
|
+
}
|
|
45
|
+
for (const value of iterable) {
|
|
46
|
+
if (currentIndex++ === index) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
iterableAt
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=iter-fest.iterableAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableAt.ts","../src/private/toIntegerOrInfinity.ts"],"sourcesContent":["import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns the item located at the specified index.\n *\n * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.\n */\nexport function iterableAt<T>(iterable: Iterable<T>, index: number): T | undefined {\n let currentIndex = 0;\n\n index = toIntegerOrInfinity(index);\n\n if (!isFinite(index)) {\n return;\n }\n\n if (index < 0) {\n throw new TypeError('index cannot be a negative finite number');\n }\n\n for (const value of iterable) {\n if (currentIndex++ === index) {\n return value;\n }\n }\n\n return undefined;\n}\n","export default function toIntegerOrInfinity(value: number): number {\n if (value === Infinity || value === -Infinity) {\n return value;\n }\n\n return ~~value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAe,SAAR,oBAAqC,OAAuB;AACjE,MAAI,UAAU,YAAY,UAAU,WAAW;AAC7C,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,CAAC;AACX;;;ADCO,SAAS,WAAc,UAAuB,OAA8B;AACjF,MAAI,eAAe;AAEnB,UAAQ,oBAAoB,KAAK;AAEjC,MAAI,CAAC,SAAS,KAAK,GAAG;AACpB;AAAA,EACF;AAEA,MAAI,QAAQ,GAAG;AACb,UAAM,IAAI,UAAU,0CAA0C;AAAA,EAChE;AAEA,aAAW,SAAS,UAAU;AAC5B,QAAI,mBAAmB,OAAO;AAC5B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines two or more iterables.
|
|
3
|
+
* This method returns a new iterable without modifying any existing iterables.
|
|
4
|
+
*
|
|
5
|
+
* @param items Additional iterables and/or items to add to the end of the iterable.
|
|
6
|
+
*/
|
|
7
|
+
declare function iterableConcat<T>(iterable: Iterable<T>, ...items: Iterable<T>[]): IterableIterator<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Combines two or more iterables.
|
|
10
|
+
* This method returns a new iterable without modifying any existing iterables.
|
|
11
|
+
*
|
|
12
|
+
* @param items Additional iterables and/or items to add to the end of the iterable.
|
|
13
|
+
*/
|
|
14
|
+
declare function iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T>;
|
|
15
|
+
|
|
16
|
+
export { iterableConcat };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines two or more iterables.
|
|
3
|
+
* This method returns a new iterable without modifying any existing iterables.
|
|
4
|
+
*
|
|
5
|
+
* @param items Additional iterables and/or items to add to the end of the iterable.
|
|
6
|
+
*/
|
|
7
|
+
declare function iterableConcat<T>(iterable: Iterable<T>, ...items: Iterable<T>[]): IterableIterator<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Combines two or more iterables.
|
|
10
|
+
* This method returns a new iterable without modifying any existing iterables.
|
|
11
|
+
*
|
|
12
|
+
* @param items Additional iterables and/or items to add to the end of the iterable.
|
|
13
|
+
*/
|
|
14
|
+
declare function iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T>;
|
|
15
|
+
|
|
16
|
+
export { iterableConcat };
|
|
@@ -0,0 +1,40 @@
|
|
|
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/iterableConcat.ts
|
|
21
|
+
var iterableConcat_exports = {};
|
|
22
|
+
__export(iterableConcat_exports, {
|
|
23
|
+
iterableConcat: () => iterableConcat
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(iterableConcat_exports);
|
|
26
|
+
function* iterableConcat(iterable, ...items) {
|
|
27
|
+
yield* iterable;
|
|
28
|
+
for (const item of items) {
|
|
29
|
+
if (item && typeof item === "object" && Symbol.iterator in item) {
|
|
30
|
+
yield* item;
|
|
31
|
+
} else {
|
|
32
|
+
yield item;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
iterableConcat
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=iter-fest.iterableConcat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableConcat.ts"],"sourcesContent":["/**\n * Combines two or more iterables.\n * This method returns a new iterable without modifying any existing iterables.\n *\n * @param items Additional iterables and/or items to add to the end of the iterable.\n */\nexport function iterableConcat<T>(iterable: Iterable<T>, ...items: Iterable<T>[]): IterableIterator<T>;\n\n/**\n * Combines two or more iterables.\n * This method returns a new iterable without modifying any existing iterables.\n *\n * @param items Additional iterables and/or items to add to the end of the iterable.\n */\nexport function iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T>;\n\nexport function* iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T> {\n yield* iterable;\n\n for (const item of items) {\n if (item && typeof item === 'object' && Symbol.iterator in item) {\n yield* item;\n } else {\n yield item;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,UAAU,eAAkB,aAA0B,OAAiD;AAC5G,SAAO;AAEP,aAAW,QAAQ,OAAO;AACxB,QAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,YAAY,MAAM;AAC/D,aAAO;AAAA,IACT,OAAO;AACL,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
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/iterableEntries.ts
|
|
21
|
+
var iterableEntries_exports = {};
|
|
22
|
+
__export(iterableEntries_exports, {
|
|
23
|
+
iterableEntries: () => iterableEntries
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(iterableEntries_exports);
|
|
26
|
+
function* iterableEntries(iterable) {
|
|
27
|
+
let index = 0;
|
|
28
|
+
for (const value of iterable) {
|
|
29
|
+
yield [index++, value];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
iterableEntries
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=iter-fest.iterableEntries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableEntries.ts"],"sourcesContent":["/**\n * Returns an iterable of key, value pairs for every entry in the iterable\n */\nexport function* iterableEntries<T>(iterable: Iterable<T>): IterableIterator<[number, T]> {\n let index = 0;\n\n for (const value of iterable) {\n yield [index++, value];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,UAAU,gBAAmB,UAAsD;AACxF,MAAI,QAAQ;AAEZ,aAAW,SAAS,UAAU;AAC5B,UAAM,CAAC,SAAS,KAAK;AAAA,EACvB;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether all the members of an iterable satisfy the specified test.
|
|
3
|
+
*
|
|
4
|
+
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
5
|
+
* the predicate function for each element in the iterable until the predicate returns a value
|
|
6
|
+
* which is coercible to the Boolean value false, or until the end of the iterable.
|
|
7
|
+
*
|
|
8
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
9
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
10
|
+
*/
|
|
11
|
+
declare function iterableEvery<T, S extends T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => value is S, thisArg?: any): iterable is S[];
|
|
12
|
+
/**
|
|
13
|
+
* Determines whether all the members of an iterable satisfy the specified test.
|
|
14
|
+
*
|
|
15
|
+
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
16
|
+
* the predicate function for each element in the iterable until the predicate returns a value
|
|
17
|
+
* which is coercible to the Boolean value false, or until the end of the iterable.
|
|
18
|
+
*
|
|
19
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
20
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
21
|
+
*/
|
|
22
|
+
declare function iterableEvery<T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => unknown, thisArg?: any): boolean;
|
|
23
|
+
|
|
24
|
+
export { iterableEvery };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether all the members of an iterable satisfy the specified test.
|
|
3
|
+
*
|
|
4
|
+
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
5
|
+
* the predicate function for each element in the iterable until the predicate returns a value
|
|
6
|
+
* which is coercible to the Boolean value false, or until the end of the iterable.
|
|
7
|
+
*
|
|
8
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
9
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
10
|
+
*/
|
|
11
|
+
declare function iterableEvery<T, S extends T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => value is S, thisArg?: any): iterable is S[];
|
|
12
|
+
/**
|
|
13
|
+
* Determines whether all the members of an iterable satisfy the specified test.
|
|
14
|
+
*
|
|
15
|
+
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
16
|
+
* the predicate function for each element in the iterable until the predicate returns a value
|
|
17
|
+
* which is coercible to the Boolean value false, or until the end of the iterable.
|
|
18
|
+
*
|
|
19
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
20
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
21
|
+
*/
|
|
22
|
+
declare function iterableEvery<T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => unknown, thisArg?: any): boolean;
|
|
23
|
+
|
|
24
|
+
export { iterableEvery };
|
|
@@ -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/iterableEvery.ts
|
|
21
|
+
var iterableEvery_exports = {};
|
|
22
|
+
__export(iterableEvery_exports, {
|
|
23
|
+
iterableEvery: () => iterableEvery
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(iterableEvery_exports);
|
|
26
|
+
function iterableEvery(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 false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
iterableEvery
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=iter-fest.iterableEvery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableEvery.ts"],"sourcesContent":["/**\n * Determines whether all the members of an iterable satisfy the specified test.\n *\n * @param predicate A function that accepts up to three arguments. The every method calls\n * the predicate function for each element in the iterable until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the iterable.\n *\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableEvery<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => value is S,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): iterable is S[];\n\n/**\n * Determines whether all the members of an iterable satisfy the specified test.\n *\n * @param predicate A function that accepts up to three arguments. The every method calls\n * the predicate function for each element in the iterable until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the iterable.\n *\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableEvery<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\n): boolean;\n\nexport function iterableEvery<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 false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCO,SAAS,cACd,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,CAAC,eAAe,OAAO,SAAS,QAAQ,GAAG;AAC7C,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the elements of an iterable that meet the condition specified in a callback function.
|
|
3
|
+
*
|
|
4
|
+
* @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.
|
|
5
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
|
|
6
|
+
*/
|
|
7
|
+
declare function iterableFilter<T, S extends T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => value is S, thisArg?: unknown): IterableIterator<S>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the elements of an iterable that meet the condition specified in a callback function.
|
|
10
|
+
*
|
|
11
|
+
* @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.
|
|
12
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
|
|
13
|
+
*/
|
|
14
|
+
declare function iterableFilter<T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => unknown, thisArg?: any): IterableIterator<T>;
|
|
15
|
+
|
|
16
|
+
export { iterableFilter };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the elements of an iterable that meet the condition specified in a callback function.
|
|
3
|
+
*
|
|
4
|
+
* @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.
|
|
5
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
|
|
6
|
+
*/
|
|
7
|
+
declare function iterableFilter<T, S extends T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => value is S, thisArg?: unknown): IterableIterator<S>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the elements of an iterable that meet the condition specified in a callback function.
|
|
10
|
+
*
|
|
11
|
+
* @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.
|
|
12
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
|
|
13
|
+
*/
|
|
14
|
+
declare function iterableFilter<T>(iterable: Iterable<T>, predicate: (value: T, index: number, iterable: Iterable<T>) => unknown, thisArg?: any): IterableIterator<T>;
|
|
15
|
+
|
|
16
|
+
export { iterableFilter };
|
|
@@ -0,0 +1,42 @@
|
|
|
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/iterableFilter.ts
|
|
21
|
+
var iterableFilter_exports = {};
|
|
22
|
+
__export(iterableFilter_exports, {
|
|
23
|
+
iterableFilter: () => iterableFilter
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(iterableFilter_exports);
|
|
26
|
+
function* iterableFilter(iterable, predicate, thisArg) {
|
|
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
|
+
yield value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
iterableFilter
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=iter-fest.iterableFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableFilter.ts"],"sourcesContent":["/**\n * Returns the elements of an iterable that meet the condition specified in a callback function.\n *\n * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.\n * @param thisArg 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 iterableFilter<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => value is S,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: unknown\n): IterableIterator<S>;\n\n/**\n * Returns the elements of an iterable that meet the condition specified in a callback function.\n *\n * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the iterable.\n * @param thisArg 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 iterableFilter<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\n): IterableIterator<T>;\n\nexport function* iterableFilter<T, S extends 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?: unknown\n): IterableIterator<S> {\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 yield value as S;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BO,UAAU,eACf,UACA,WAEA,SACqB;AACrB,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,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|