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.
Files changed (177) hide show
  1. package/README.md +50 -90
  2. package/dist/chunk-5CRMPYKD.mjs +19 -0
  3. package/dist/chunk-5CRMPYKD.mjs.map +1 -0
  4. package/dist/chunk-6C3P4TNK.mjs +19 -0
  5. package/dist/chunk-6C3P4TNK.mjs.map +1 -0
  6. package/dist/chunk-EZC33HE6.mjs +15 -0
  7. package/dist/chunk-EZC33HE6.mjs.map +1 -0
  8. package/dist/chunk-JU353VSE.mjs +16 -0
  9. package/dist/chunk-JU353VSE.mjs.map +1 -0
  10. package/dist/chunk-MNLOWKTC.mjs +19 -0
  11. package/dist/chunk-MNLOWKTC.mjs.map +1 -0
  12. package/dist/{chunk-YJSIVBF7.mjs → chunk-MOBXUTO5.mjs} +5 -5
  13. package/dist/chunk-MOBXUTO5.mjs.map +1 -0
  14. package/dist/chunk-O5SQJUKB.mjs +37 -0
  15. package/dist/chunk-O5SQJUKB.mjs.map +1 -0
  16. package/dist/chunk-XW34KZRY.mjs +17 -0
  17. package/dist/chunk-XW34KZRY.mjs.map +1 -0
  18. package/dist/chunk-ZUBHGSCW.mjs +18 -0
  19. package/dist/chunk-ZUBHGSCW.mjs.map +1 -0
  20. package/dist/iter-fest.d.mts +9 -14
  21. package/dist/iter-fest.d.ts +9 -14
  22. package/dist/iter-fest.iterableEvery.d.mts +24 -0
  23. package/dist/iter-fest.iterableEvery.d.ts +24 -0
  24. package/dist/iter-fest.iterableEvery.js +43 -0
  25. package/dist/iter-fest.iterableEvery.js.map +1 -0
  26. package/dist/iter-fest.iterableEvery.mjs +7 -0
  27. package/dist/iter-fest.iterableFilter.d.mts +16 -0
  28. package/dist/iter-fest.iterableFilter.d.ts +16 -0
  29. package/dist/iter-fest.iterableFilter.js +42 -0
  30. package/dist/iter-fest.iterableFilter.js.map +1 -0
  31. package/dist/iter-fest.iterableFilter.mjs +7 -0
  32. package/dist/iter-fest.iterableFind.d.mts +15 -0
  33. package/dist/iter-fest.iterableFind.d.ts +15 -0
  34. package/dist/iter-fest.iterableFind.js +43 -0
  35. package/dist/iter-fest.iterableFind.js.map +1 -0
  36. package/dist/iter-fest.iterableFind.mjs +7 -0
  37. package/dist/iter-fest.iterableForEach.d.mts +10 -0
  38. package/dist/iter-fest.iterableForEach.d.ts +10 -0
  39. package/dist/iter-fest.iterableForEach.js +40 -0
  40. package/dist/iter-fest.iterableForEach.js.map +1 -0
  41. package/dist/iter-fest.iterableForEach.mjs +7 -0
  42. package/dist/iter-fest.iterableGetReadable.d.mts +3 -0
  43. package/dist/iter-fest.iterableGetReadable.d.ts +3 -0
  44. package/dist/{iter-fest.readableStreamFrom.js → iter-fest.iterableGetReadable.js} +9 -9
  45. package/dist/iter-fest.iterableGetReadable.js.map +1 -0
  46. package/dist/iter-fest.iterableGetReadable.mjs +7 -0
  47. package/dist/iter-fest.iterableMap.d.mts +8 -0
  48. package/dist/iter-fest.iterableMap.d.ts +8 -0
  49. package/dist/iter-fest.iterableMap.js +39 -0
  50. package/dist/iter-fest.iterableMap.js.map +1 -0
  51. package/dist/iter-fest.iterableMap.mjs +7 -0
  52. package/dist/{iter-fest.iteratorReduce.d.mts → iter-fest.iterableReduce.d.mts} +9 -13
  53. package/dist/{iter-fest.iteratorReduce.d.ts → iter-fest.iterableReduce.d.ts} +9 -13
  54. package/dist/iter-fest.iterableReduce.js +41 -0
  55. package/dist/iter-fest.iterableReduce.js.map +1 -0
  56. package/dist/iter-fest.iterableReduce.mjs +7 -0
  57. package/dist/iter-fest.iterableSome.d.mts +12 -0
  58. package/dist/iter-fest.iterableSome.d.ts +12 -0
  59. package/dist/iter-fest.iterableSome.js +43 -0
  60. package/dist/iter-fest.iterableSome.js.map +1 -0
  61. package/dist/iter-fest.iterableSome.mjs +7 -0
  62. package/dist/iter-fest.js +168 -164
  63. package/dist/iter-fest.js.map +1 -1
  64. package/dist/iter-fest.mjs +52 -72
  65. package/dist/iter-fest.pushAsyncIterableIterator.d.mts +9 -0
  66. package/dist/iter-fest.pushAsyncIterableIterator.d.ts +9 -0
  67. package/dist/{iter-fest.iterableWritableStream.js → iter-fest.pushAsyncIterableIterator.js} +30 -39
  68. package/dist/iter-fest.pushAsyncIterableIterator.js.map +1 -0
  69. package/dist/iter-fest.pushAsyncIterableIterator.mjs +7 -0
  70. package/package.json +87 -137
  71. package/dist/chunk-3S6LCGE6.mjs +0 -10
  72. package/dist/chunk-3S6LCGE6.mjs.map +0 -1
  73. package/dist/chunk-BWMXKULC.mjs +0 -46
  74. package/dist/chunk-BWMXKULC.mjs.map +0 -1
  75. package/dist/chunk-FBST4AUL.mjs +0 -10
  76. package/dist/chunk-FBST4AUL.mjs.map +0 -1
  77. package/dist/chunk-FMIHIL6A.mjs +0 -10
  78. package/dist/chunk-FMIHIL6A.mjs.map +0 -1
  79. package/dist/chunk-KYMTQJIJ.mjs +0 -10
  80. package/dist/chunk-KYMTQJIJ.mjs.map +0 -1
  81. package/dist/chunk-LIMQXDFK.mjs +0 -10
  82. package/dist/chunk-LIMQXDFK.mjs.map +0 -1
  83. package/dist/chunk-OWUGLCQB.mjs +0 -10
  84. package/dist/chunk-OWUGLCQB.mjs.map +0 -1
  85. package/dist/chunk-QX6EMOSQ.mjs +0 -10
  86. package/dist/chunk-QX6EMOSQ.mjs.map +0 -1
  87. package/dist/chunk-R6SXIXMH.mjs +0 -10
  88. package/dist/chunk-R6SXIXMH.mjs.map +0 -1
  89. package/dist/chunk-TDHR35S7.mjs +0 -10
  90. package/dist/chunk-TDHR35S7.mjs.map +0 -1
  91. package/dist/chunk-VCKLUCOT.mjs +0 -10
  92. package/dist/chunk-VCKLUCOT.mjs.map +0 -1
  93. package/dist/chunk-XQDGXAAF.mjs +0 -10
  94. package/dist/chunk-XQDGXAAF.mjs.map +0 -1
  95. package/dist/chunk-YJSIVBF7.mjs.map +0 -1
  96. package/dist/chunk-YLERARWI.mjs +0 -10
  97. package/dist/chunk-YLERARWI.mjs.map +0 -1
  98. package/dist/iter-fest.iterableWritableStream.d.mts +0 -7
  99. package/dist/iter-fest.iterableWritableStream.d.ts +0 -7
  100. package/dist/iter-fest.iterableWritableStream.js.map +0 -1
  101. package/dist/iter-fest.iterableWritableStream.mjs +0 -7
  102. package/dist/iter-fest.iteratorDrop.d.mts +0 -12
  103. package/dist/iter-fest.iteratorDrop.d.ts +0 -12
  104. package/dist/iter-fest.iteratorDrop.js +0 -44
  105. package/dist/iter-fest.iteratorDrop.js.map +0 -1
  106. package/dist/iter-fest.iteratorDrop.mjs +0 -7
  107. package/dist/iter-fest.iteratorEvery.d.mts +0 -25
  108. package/dist/iter-fest.iteratorEvery.d.ts +0 -25
  109. package/dist/iter-fest.iteratorEvery.js +0 -44
  110. package/dist/iter-fest.iteratorEvery.js.map +0 -1
  111. package/dist/iter-fest.iteratorEvery.mjs +0 -7
  112. package/dist/iter-fest.iteratorFilter.d.mts +0 -18
  113. package/dist/iter-fest.iteratorFilter.d.ts +0 -18
  114. package/dist/iter-fest.iteratorFilter.js +0 -44
  115. package/dist/iter-fest.iteratorFilter.js.map +0 -1
  116. package/dist/iter-fest.iteratorFilter.mjs +0 -7
  117. package/dist/iter-fest.iteratorFind.d.mts +0 -14
  118. package/dist/iter-fest.iteratorFind.d.ts +0 -14
  119. package/dist/iter-fest.iteratorFind.js +0 -44
  120. package/dist/iter-fest.iteratorFind.js.map +0 -1
  121. package/dist/iter-fest.iteratorFind.mjs +0 -7
  122. package/dist/iter-fest.iteratorFlatMap.d.mts +0 -12
  123. package/dist/iter-fest.iteratorFlatMap.d.ts +0 -12
  124. package/dist/iter-fest.iteratorFlatMap.js +0 -44
  125. package/dist/iter-fest.iteratorFlatMap.js.map +0 -1
  126. package/dist/iter-fest.iteratorFlatMap.mjs +0 -7
  127. package/dist/iter-fest.iteratorForEach.d.mts +0 -10
  128. package/dist/iter-fest.iteratorForEach.d.ts +0 -10
  129. package/dist/iter-fest.iteratorForEach.js +0 -44
  130. package/dist/iter-fest.iteratorForEach.js.map +0 -1
  131. package/dist/iter-fest.iteratorForEach.mjs +0 -7
  132. package/dist/iter-fest.iteratorFrom.d.mts +0 -12
  133. package/dist/iter-fest.iteratorFrom.d.ts +0 -12
  134. package/dist/iter-fest.iteratorFrom.js +0 -44
  135. package/dist/iter-fest.iteratorFrom.js.map +0 -1
  136. package/dist/iter-fest.iteratorFrom.mjs +0 -7
  137. package/dist/iter-fest.iteratorMap.d.mts +0 -10
  138. package/dist/iter-fest.iteratorMap.d.ts +0 -10
  139. package/dist/iter-fest.iteratorMap.js +0 -44
  140. package/dist/iter-fest.iteratorMap.js.map +0 -1
  141. package/dist/iter-fest.iteratorMap.mjs +0 -7
  142. package/dist/iter-fest.iteratorReduce.js +0 -44
  143. package/dist/iter-fest.iteratorReduce.js.map +0 -1
  144. package/dist/iter-fest.iteratorReduce.mjs +0 -7
  145. package/dist/iter-fest.iteratorReduce.mjs.map +0 -1
  146. package/dist/iter-fest.iteratorSome.d.mts +0 -10
  147. package/dist/iter-fest.iteratorSome.d.ts +0 -10
  148. package/dist/iter-fest.iteratorSome.js +0 -44
  149. package/dist/iter-fest.iteratorSome.js.map +0 -1
  150. package/dist/iter-fest.iteratorSome.mjs +0 -7
  151. package/dist/iter-fest.iteratorSome.mjs.map +0 -1
  152. package/dist/iter-fest.iteratorTake.d.mts +0 -12
  153. package/dist/iter-fest.iteratorTake.d.ts +0 -12
  154. package/dist/iter-fest.iteratorTake.js +0 -44
  155. package/dist/iter-fest.iteratorTake.js.map +0 -1
  156. package/dist/iter-fest.iteratorTake.mjs +0 -7
  157. package/dist/iter-fest.iteratorTake.mjs.map +0 -1
  158. package/dist/iter-fest.iteratorToArray.d.mts +0 -13
  159. package/dist/iter-fest.iteratorToArray.d.ts +0 -13
  160. package/dist/iter-fest.iteratorToArray.js +0 -44
  161. package/dist/iter-fest.iteratorToArray.js.map +0 -1
  162. package/dist/iter-fest.iteratorToArray.mjs +0 -7
  163. package/dist/iter-fest.iteratorToArray.mjs.map +0 -1
  164. package/dist/iter-fest.readableStreamFrom.d.mts +0 -3
  165. package/dist/iter-fest.readableStreamFrom.d.ts +0 -3
  166. package/dist/iter-fest.readableStreamFrom.js.map +0 -1
  167. package/dist/iter-fest.readableStreamFrom.mjs +0 -7
  168. package/dist/iter-fest.readableStreamFrom.mjs.map +0 -1
  169. /package/dist/{iter-fest.iterableWritableStream.mjs.map → iter-fest.iterableEvery.mjs.map} +0 -0
  170. /package/dist/{iter-fest.iteratorDrop.mjs.map → iter-fest.iterableFilter.mjs.map} +0 -0
  171. /package/dist/{iter-fest.iteratorEvery.mjs.map → iter-fest.iterableFind.mjs.map} +0 -0
  172. /package/dist/{iter-fest.iteratorFilter.mjs.map → iter-fest.iterableForEach.mjs.map} +0 -0
  173. /package/dist/{iter-fest.iteratorFind.mjs.map → iter-fest.iterableGetReadable.mjs.map} +0 -0
  174. /package/dist/{iter-fest.iteratorFlatMap.mjs.map → iter-fest.iterableMap.mjs.map} +0 -0
  175. /package/dist/{iter-fest.iteratorForEach.mjs.map → iter-fest.iterableReduce.mjs.map} +0 -0
  176. /package/dist/{iter-fest.iteratorFrom.mjs.map → iter-fest.iterableSome.mjs.map} +0 -0
  177. /package/dist/{iter-fest.iteratorMap.mjs.map → iter-fest.pushAsyncIterableIterator.mjs.map} +0 -0
@@ -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,7 @@
1
+ import {
2
+ iterableEvery
3
+ } from "./chunk-5CRMPYKD.mjs";
4
+ export {
5
+ iterableEvery
6
+ };
7
+ //# sourceMappingURL=iter-fest.iterableEvery.mjs.map
@@ -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":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ iterableFilter
3
+ } from "./chunk-ZUBHGSCW.mjs";
4
+ export {
5
+ iterableFilter
6
+ };
7
+ //# sourceMappingURL=iter-fest.iterableFilter.mjs.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Returns the value of the first element in the iterable where predicate is true, and undefined
3
+ * otherwise.
4
+ *
5
+ * @param predicate find calls predicate once for each element of the iterable, in ascending
6
+ * order, until it finds one where predicate returns true. If such an element is found, find
7
+ * immediately returns that element value. Otherwise, find returns undefined.
8
+ *
9
+ * @param thisArg If provided, it will be used as the this value for each invocation of
10
+ * predicate. If it is not provided, undefined is used instead.
11
+ */
12
+ declare function iterableFind<T, S extends T>(iterable: Iterable<T>, predicate: (value: T, index: number, obj: Iterable<T>) => value is S, thisArg?: any): S | undefined;
13
+ declare function iterableFind<T>(iterable: Iterable<T>, predicate: (value: T, index: number, obj: Iterable<T>) => unknown, thisArg?: any): T | undefined;
14
+
15
+ export { iterableFind };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Returns the value of the first element in the iterable where predicate is true, and undefined
3
+ * otherwise.
4
+ *
5
+ * @param predicate find calls predicate once for each element of the iterable, in ascending
6
+ * order, until it finds one where predicate returns true. If such an element is found, find
7
+ * immediately returns that element value. Otherwise, find returns undefined.
8
+ *
9
+ * @param thisArg If provided, it will be used as the this value for each invocation of
10
+ * predicate. If it is not provided, undefined is used instead.
11
+ */
12
+ declare function iterableFind<T, S extends T>(iterable: Iterable<T>, predicate: (value: T, index: number, obj: Iterable<T>) => value is S, thisArg?: any): S | undefined;
13
+ declare function iterableFind<T>(iterable: Iterable<T>, predicate: (value: T, index: number, obj: Iterable<T>) => unknown, thisArg?: any): T | undefined;
14
+
15
+ export { iterableFind };
@@ -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/iterableFind.ts
21
+ var iterableFind_exports = {};
22
+ __export(iterableFind_exports, {
23
+ iterableFind: () => iterableFind
24
+ });
25
+ module.exports = __toCommonJS(iterableFind_exports);
26
+ function iterableFind(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
+ return value;
35
+ }
36
+ }
37
+ return void 0;
38
+ }
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ iterableFind
42
+ });
43
+ //# sourceMappingURL=iter-fest.iterableFind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/iterableFind.ts"],"sourcesContent":["/**\n * Returns the value of the first element in the iterable where predicate is true, and undefined\n * otherwise.\n *\n * @param predicate find calls predicate once for each element of the iterable, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n *\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\nexport function iterableFind<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, obj: Iterable<T>) => value is S,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): S | undefined;\n\nexport function iterableFind<T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, obj: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): T | undefined;\n\nexport function iterableFind<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, obj: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): S | undefined {\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 value as S;\n }\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBO,SAAS,aACd,UACA,WAEA,SACe;AACf,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":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ iterableFind
3
+ } from "./chunk-MNLOWKTC.mjs";
4
+ export {
5
+ iterableFind
6
+ };
7
+ //# sourceMappingURL=iter-fest.iterableFind.mjs.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Performs the specified action for each element in an iterable.
3
+ *
4
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the iterable.
5
+ *
6
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
7
+ */
8
+ declare function iterableForEach<T>(iterable: Iterable<T>, callbackfn: (value: T, index: number, iterable: Iterable<T>) => void, thisArg?: any): void;
9
+
10
+ export { iterableForEach };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Performs the specified action for each element in an iterable.
3
+ *
4
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the iterable.
5
+ *
6
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
7
+ */
8
+ declare function iterableForEach<T>(iterable: Iterable<T>, callbackfn: (value: T, index: number, iterable: Iterable<T>) => void, thisArg?: any): void;
9
+
10
+ export { iterableForEach };
@@ -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/iterableForEach.ts
21
+ var iterableForEach_exports = {};
22
+ __export(iterableForEach_exports, {
23
+ iterableForEach: () => iterableForEach
24
+ });
25
+ module.exports = __toCommonJS(iterableForEach_exports);
26
+ function iterableForEach(iterable, callbackfn, thisArg) {
27
+ let index = 0;
28
+ if (typeof callbackfn !== "function") {
29
+ throw new TypeError(`${callbackfn} is not a function`);
30
+ }
31
+ const boundCallbackfn = callbackfn.bind(thisArg);
32
+ for (const value of iterable) {
33
+ boundCallbackfn(value, index++, iterable);
34
+ }
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ iterableForEach
39
+ });
40
+ //# sourceMappingURL=iter-fest.iterableForEach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/iterableForEach.ts"],"sourcesContent":["/**\n * Performs the specified action for each element in an iterable.\n *\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the iterable.\n *\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableForEach<T>(\n iterable: Iterable<T>,\n callbackfn: (value: T, index: number, iterable: Iterable<T>) => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): void {\n let index = 0;\n\n if (typeof callbackfn !== 'function') {\n throw new TypeError(`${callbackfn} is not a function`);\n }\n\n const boundCallbackfn = callbackfn.bind(thisArg);\n\n for (const value of iterable) {\n boundCallbackfn(value, index++, iterable);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,gBACd,UACA,YAEA,SACM;AACN,MAAI,QAAQ;AAEZ,MAAI,OAAO,eAAe,YAAY;AACpC,UAAM,IAAI,UAAU,GAAG,UAAU,oBAAoB;AAAA,EACvD;AAEA,QAAM,kBAAkB,WAAW,KAAK,OAAO;AAE/C,aAAW,SAAS,UAAU;AAC5B,oBAAgB,OAAO,SAAS,QAAQ;AAAA,EAC1C;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ iterableForEach
3
+ } from "./chunk-JU353VSE.mjs";
4
+ export {
5
+ iterableForEach
6
+ };
7
+ //# sourceMappingURL=iter-fest.iterableForEach.mjs.map
@@ -0,0 +1,3 @@
1
+ declare function iterableGetReadable<T>(iterable: AsyncIterable<T> | Iterable<T>): ReadableStream<T>;
2
+
3
+ export { iterableGetReadable };
@@ -0,0 +1,3 @@
1
+ declare function iterableGetReadable<T>(iterable: AsyncIterable<T> | Iterable<T>): ReadableStream<T>;
2
+
3
+ export { iterableGetReadable };
@@ -17,17 +17,17 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // src/readableStreamFrom.ts
21
- var readableStreamFrom_exports = {};
22
- __export(readableStreamFrom_exports, {
23
- readableStreamFrom: () => readableStreamFrom
20
+ // src/iterableGetReadable.ts
21
+ var iterableGetReadable_exports = {};
22
+ __export(iterableGetReadable_exports, {
23
+ iterableGetReadable: () => iterableGetReadable
24
24
  });
25
- module.exports = __toCommonJS(readableStreamFrom_exports);
25
+ module.exports = __toCommonJS(iterableGetReadable_exports);
26
26
  function isIterable(iterable) {
27
27
  return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
28
28
  }
29
- function readableStreamFrom(anyIterable) {
30
- const iterator = isIterable(anyIterable) ? anyIterable[Symbol.iterator]() : anyIterable[Symbol.asyncIterator]();
29
+ function iterableGetReadable(iterable) {
30
+ const iterator = isIterable(iterable) ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
31
31
  return new ReadableStream({
32
32
  async pull(controller) {
33
33
  const result = await iterator.next();
@@ -41,6 +41,6 @@ function readableStreamFrom(anyIterable) {
41
41
  }
42
42
  // Annotate the CommonJS export names for ESM import in node:
43
43
  0 && (module.exports = {
44
- readableStreamFrom
44
+ iterableGetReadable
45
45
  });
46
- //# sourceMappingURL=iter-fest.readableStreamFrom.js.map
46
+ //# sourceMappingURL=iter-fest.iterableGetReadable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/iterableGetReadable.ts"],"sourcesContent":["function isIterable(iterable: unknown): iterable is Iterable<unknown> {\n return !!(iterable && typeof iterable === 'object' && Symbol.iterator in iterable);\n}\n\nexport function iterableGetReadable<T>(iterable: AsyncIterable<T> | Iterable<T>): ReadableStream<T> {\n const iterator = isIterable(iterable) ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n return new ReadableStream({\n async pull(controller) {\n const result = await iterator.next();\n\n if (result.done) {\n controller.close();\n } else {\n controller.enqueue(result.value);\n }\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,WAAW,UAAkD;AACpE,SAAO,CAAC,EAAE,YAAY,OAAO,aAAa,YAAY,OAAO,YAAY;AAC3E;AAEO,SAAS,oBAAuB,UAA6D;AAClG,QAAM,WAAW,WAAW,QAAQ,IAAI,SAAS,OAAO,QAAQ,EAAE,IAAI,SAAS,OAAO,aAAa,EAAE;AAErG,SAAO,IAAI,eAAe;AAAA,IACxB,MAAM,KAAK,YAAY;AACrB,YAAM,SAAS,MAAM,SAAS,KAAK;AAEnC,UAAI,OAAO,MAAM;AACf,mBAAW,MAAM;AAAA,MACnB,OAAO;AACL,mBAAW,QAAQ,OAAO,KAAK;AAAA,MACjC;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ iterableGetReadable
3
+ } from "./chunk-MOBXUTO5.mjs";
4
+ export {
5
+ iterableGetReadable
6
+ };
7
+ //# sourceMappingURL=iter-fest.iterableGetReadable.mjs.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
3
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
4
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
5
+ */
6
+ declare function iterableMap<T, U>(iterable: Iterable<T>, callbackfn: (value: T, index: number, array: Iterable<T>) => U, thisArg?: any): IterableIterator<U>;
7
+
8
+ export { iterableMap };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
3
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
4
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
5
+ */
6
+ declare function iterableMap<T, U>(iterable: Iterable<T>, callbackfn: (value: T, index: number, array: Iterable<T>) => U, thisArg?: any): IterableIterator<U>;
7
+
8
+ export { iterableMap };
@@ -0,0 +1,39 @@
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/iterableMap.ts
21
+ var iterableMap_exports = {};
22
+ __export(iterableMap_exports, {
23
+ iterableMap: () => iterableMap
24
+ });
25
+ module.exports = __toCommonJS(iterableMap_exports);
26
+ function* iterableMap(iterable, callbackfn, thisArg) {
27
+ let index = 0;
28
+ if (typeof callbackfn !== "function") {
29
+ throw new TypeError(`${callbackfn} is not a function`);
30
+ }
31
+ for (const value of iterable) {
32
+ yield callbackfn.call(thisArg, value, index++, iterable);
33
+ }
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ iterableMap
38
+ });
39
+ //# sourceMappingURL=iter-fest.iterableMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/iterableMap.ts"],"sourcesContent":["/**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\nexport function* iterableMap<T, U>(\n iterable: Iterable<T>,\n callbackfn: (value: T, index: number, array: Iterable<T>) => U,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): IterableIterator<U> {\n let index = 0;\n\n if (typeof callbackfn !== 'function') {\n throw new TypeError(`${callbackfn} is not a function`);\n }\n\n for (const value of iterable) {\n yield callbackfn.call(thisArg, value, index++, iterable);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,UAAU,YACf,UACA,YAEA,SACqB;AACrB,MAAI,QAAQ;AAEZ,MAAI,OAAO,eAAe,YAAY;AACpC,UAAM,IAAI,UAAU,GAAG,UAAU,oBAAoB;AAAA,EACvD;AAEA,aAAW,SAAS,UAAU;AAC5B,UAAM,WAAW,KAAK,SAAS,OAAO,SAAS,QAAQ;AAAA,EACzD;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ iterableMap
3
+ } from "./chunk-EZC33HE6.mjs";
4
+ export {
5
+ iterableMap
6
+ };
7
+ //# sourceMappingURL=iter-fest.iterableMap.mjs.map
@@ -1,23 +1,19 @@
1
1
  /**
2
- * Calls the specified callback function for all the elements in an iterator. 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.
2
+ * 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.
3
3
  *
4
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
4
+ * @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.
5
5
  *
6
- * @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 iterator value.
7
- *
8
- * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md
6
+ * @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.
9
7
  */
10
- declare function iteratorReduce<T>(iterator: Iterator<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
11
- declare function iteratorReduce<T>(iterator: Iterator<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
8
+ declare function iterableReduce<T>(iterable: Iterable<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T): T;
9
+ declare function iterableReduce<T>(iterable: Iterable<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T, initialValue: T): T;
12
10
  /**
13
- * Calls the specified callback function for all the elements in an iterator. 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.
11
+ * 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.
14
12
  *
15
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
13
+ * @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.
16
14
  *
17
15
  * @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.
18
- *
19
- * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md
20
16
  */
21
- declare function iteratorReduce<T, U>(iterator: Iterator<T>, callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
17
+ declare function iterableReduce<T, U>(iterable: Iterable<T>, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, iterable: Iterable<T>) => U, initialValue: U): U;
22
18
 
23
- export { iteratorReduce };
19
+ export { iterableReduce };
@@ -1,23 +1,19 @@
1
1
  /**
2
- * Calls the specified callback function for all the elements in an iterator. 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.
2
+ * 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.
3
3
  *
4
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
4
+ * @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.
5
5
  *
6
- * @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 iterator value.
7
- *
8
- * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md
6
+ * @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.
9
7
  */
10
- declare function iteratorReduce<T>(iterator: Iterator<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
11
- declare function iteratorReduce<T>(iterator: Iterator<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
8
+ declare function iterableReduce<T>(iterable: Iterable<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T): T;
9
+ declare function iterableReduce<T>(iterable: Iterable<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T, initialValue: T): T;
12
10
  /**
13
- * Calls the specified callback function for all the elements in an iterator. 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.
11
+ * 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.
14
12
  *
15
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
13
+ * @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.
16
14
  *
17
15
  * @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.
18
- *
19
- * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md
20
16
  */
21
- declare function iteratorReduce<T, U>(iterator: Iterator<T>, callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
17
+ declare function iterableReduce<T, U>(iterable: Iterable<T>, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, iterable: Iterable<T>) => U, initialValue: U): U;
22
18
 
23
- export { iteratorReduce };
19
+ export { iterableReduce };
@@ -0,0 +1,41 @@
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/iterableReduce.ts
21
+ var iterableReduce_exports = {};
22
+ __export(iterableReduce_exports, {
23
+ iterableReduce: () => iterableReduce
24
+ });
25
+ module.exports = __toCommonJS(iterableReduce_exports);
26
+ function iterableReduce(iterable, callbackfn, initialValue) {
27
+ let index = 0;
28
+ let previousValue = initialValue;
29
+ if (typeof callbackfn !== "function") {
30
+ throw new TypeError(`${callbackfn} is not a function`);
31
+ }
32
+ for (const currentValue of iterable) {
33
+ previousValue = callbackfn(previousValue, currentValue, index++, iterable);
34
+ }
35
+ return previousValue;
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ iterableReduce
40
+ });
41
+ //# sourceMappingURL=iter-fest.iterableReduce.js.map