iter-fest 0.0.0-main.9e231bf

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 (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +137 -0
  3. package/dist/chunk-27NJVC7K.mjs +26 -0
  4. package/dist/chunk-27NJVC7K.mjs.map +1 -0
  5. package/dist/chunk-44W7OTNE.mjs +12 -0
  6. package/dist/chunk-44W7OTNE.mjs.map +1 -0
  7. package/dist/chunk-5CHMNKXJ.mjs +20 -0
  8. package/dist/chunk-5CHMNKXJ.mjs.map +1 -0
  9. package/dist/chunk-5CRMPYKD.mjs +19 -0
  10. package/dist/chunk-5CRMPYKD.mjs.map +1 -0
  11. package/dist/chunk-6C3P4TNK.mjs +19 -0
  12. package/dist/chunk-6C3P4TNK.mjs.map +1 -0
  13. package/dist/chunk-EZC33HE6.mjs +15 -0
  14. package/dist/chunk-EZC33HE6.mjs.map +1 -0
  15. package/dist/chunk-GWZF5BB7.mjs +16 -0
  16. package/dist/chunk-GWZF5BB7.mjs.map +1 -0
  17. package/dist/chunk-HYU4EN7J.mjs +20 -0
  18. package/dist/chunk-HYU4EN7J.mjs.map +1 -0
  19. package/dist/chunk-JU353VSE.mjs +16 -0
  20. package/dist/chunk-JU353VSE.mjs.map +1 -0
  21. package/dist/chunk-KONB7TV6.mjs +35 -0
  22. package/dist/chunk-KONB7TV6.mjs.map +1 -0
  23. package/dist/chunk-MDBK7ND5.mjs +26 -0
  24. package/dist/chunk-MDBK7ND5.mjs.map +1 -0
  25. package/dist/chunk-MNDAEMYM.mjs +15 -0
  26. package/dist/chunk-MNDAEMYM.mjs.map +1 -0
  27. package/dist/chunk-MNLOWKTC.mjs +19 -0
  28. package/dist/chunk-MNLOWKTC.mjs.map +1 -0
  29. package/dist/chunk-TEI3K6GT.mjs +21 -0
  30. package/dist/chunk-TEI3K6GT.mjs.map +1 -0
  31. package/dist/chunk-UIEKIMLW.mjs +27 -0
  32. package/dist/chunk-UIEKIMLW.mjs.map +1 -0
  33. package/dist/chunk-V6OWQQ3Q.mjs +20 -0
  34. package/dist/chunk-V6OWQQ3Q.mjs.map +1 -0
  35. package/dist/chunk-W5NEOEVE.mjs +12 -0
  36. package/dist/chunk-W5NEOEVE.mjs.map +1 -0
  37. package/dist/chunk-WKIRSZXX.mjs +32 -0
  38. package/dist/chunk-WKIRSZXX.mjs.map +1 -0
  39. package/dist/chunk-XKBVB2JN.mjs +12 -0
  40. package/dist/chunk-XKBVB2JN.mjs.map +1 -0
  41. package/dist/chunk-XW34KZRY.mjs +17 -0
  42. package/dist/chunk-XW34KZRY.mjs.map +1 -0
  43. package/dist/chunk-Y5M2C7NQ.mjs +13 -0
  44. package/dist/chunk-Y5M2C7NQ.mjs.map +1 -0
  45. package/dist/chunk-ZUBHGSCW.mjs +18 -0
  46. package/dist/chunk-ZUBHGSCW.mjs.map +1 -0
  47. package/dist/iter-fest.d.mts +21 -0
  48. package/dist/iter-fest.d.ts +21 -0
  49. package/dist/iter-fest.iterableAt.d.mts +8 -0
  50. package/dist/iter-fest.iterableAt.d.ts +8 -0
  51. package/dist/iter-fest.iterableAt.js +56 -0
  52. package/dist/iter-fest.iterableAt.js.map +1 -0
  53. package/dist/iter-fest.iterableAt.mjs +8 -0
  54. package/dist/iter-fest.iterableAt.mjs.map +1 -0
  55. package/dist/iter-fest.iterableConcat.d.mts +16 -0
  56. package/dist/iter-fest.iterableConcat.d.ts +16 -0
  57. package/dist/iter-fest.iterableConcat.js +40 -0
  58. package/dist/iter-fest.iterableConcat.js.map +1 -0
  59. package/dist/iter-fest.iterableConcat.mjs +7 -0
  60. package/dist/iter-fest.iterableConcat.mjs.map +1 -0
  61. package/dist/iter-fest.iterableEntries.d.mts +6 -0
  62. package/dist/iter-fest.iterableEntries.d.ts +6 -0
  63. package/dist/iter-fest.iterableEntries.js +36 -0
  64. package/dist/iter-fest.iterableEntries.js.map +1 -0
  65. package/dist/iter-fest.iterableEntries.mjs +7 -0
  66. package/dist/iter-fest.iterableEntries.mjs.map +1 -0
  67. package/dist/iter-fest.iterableEvery.d.mts +24 -0
  68. package/dist/iter-fest.iterableEvery.d.ts +24 -0
  69. package/dist/iter-fest.iterableEvery.js +43 -0
  70. package/dist/iter-fest.iterableEvery.js.map +1 -0
  71. package/dist/iter-fest.iterableEvery.mjs +7 -0
  72. package/dist/iter-fest.iterableEvery.mjs.map +1 -0
  73. package/dist/iter-fest.iterableFilter.d.mts +16 -0
  74. package/dist/iter-fest.iterableFilter.d.ts +16 -0
  75. package/dist/iter-fest.iterableFilter.js +42 -0
  76. package/dist/iter-fest.iterableFilter.js.map +1 -0
  77. package/dist/iter-fest.iterableFilter.mjs +7 -0
  78. package/dist/iter-fest.iterableFilter.mjs.map +1 -0
  79. package/dist/iter-fest.iterableFind.d.mts +15 -0
  80. package/dist/iter-fest.iterableFind.d.ts +15 -0
  81. package/dist/iter-fest.iterableFind.js +43 -0
  82. package/dist/iter-fest.iterableFind.js.map +1 -0
  83. package/dist/iter-fest.iterableFind.mjs +7 -0
  84. package/dist/iter-fest.iterableFind.mjs.map +1 -0
  85. package/dist/iter-fest.iterableFindIndex.d.mts +14 -0
  86. package/dist/iter-fest.iterableFindIndex.d.ts +14 -0
  87. package/dist/iter-fest.iterableFindIndex.js +44 -0
  88. package/dist/iter-fest.iterableFindIndex.js.map +1 -0
  89. package/dist/iter-fest.iterableFindIndex.mjs +7 -0
  90. package/dist/iter-fest.iterableFindIndex.mjs.map +1 -0
  91. package/dist/iter-fest.iterableFindLast.d.mts +15 -0
  92. package/dist/iter-fest.iterableFindLast.d.ts +15 -0
  93. package/dist/iter-fest.iterableFindLast.js +44 -0
  94. package/dist/iter-fest.iterableFindLast.js.map +1 -0
  95. package/dist/iter-fest.iterableFindLast.mjs +7 -0
  96. package/dist/iter-fest.iterableFindLast.mjs.map +1 -0
  97. package/dist/iter-fest.iterableFindLastIndex.d.mts +14 -0
  98. package/dist/iter-fest.iterableFindLastIndex.d.ts +14 -0
  99. package/dist/iter-fest.iterableFindLastIndex.js +45 -0
  100. package/dist/iter-fest.iterableFindLastIndex.js.map +1 -0
  101. package/dist/iter-fest.iterableFindLastIndex.mjs +7 -0
  102. package/dist/iter-fest.iterableFindLastIndex.mjs.map +1 -0
  103. package/dist/iter-fest.iterableForEach.d.mts +10 -0
  104. package/dist/iter-fest.iterableForEach.d.ts +10 -0
  105. package/dist/iter-fest.iterableForEach.js +40 -0
  106. package/dist/iter-fest.iterableForEach.js.map +1 -0
  107. package/dist/iter-fest.iterableForEach.mjs +7 -0
  108. package/dist/iter-fest.iterableForEach.mjs.map +1 -0
  109. package/dist/iter-fest.iterableIncludes.d.mts +9 -0
  110. package/dist/iter-fest.iterableIncludes.d.ts +9 -0
  111. package/dist/iter-fest.iterableIncludes.js +56 -0
  112. package/dist/iter-fest.iterableIncludes.js.map +1 -0
  113. package/dist/iter-fest.iterableIncludes.mjs +8 -0
  114. package/dist/iter-fest.iterableIncludes.mjs.map +1 -0
  115. package/dist/iter-fest.iterableIndexOf.d.mts +9 -0
  116. package/dist/iter-fest.iterableIndexOf.d.ts +9 -0
  117. package/dist/iter-fest.iterableIndexOf.js +57 -0
  118. package/dist/iter-fest.iterableIndexOf.js.map +1 -0
  119. package/dist/iter-fest.iterableIndexOf.mjs +8 -0
  120. package/dist/iter-fest.iterableIndexOf.mjs.map +1 -0
  121. package/dist/iter-fest.iterableJoin.d.mts +8 -0
  122. package/dist/iter-fest.iterableJoin.d.ts +8 -0
  123. package/dist/iter-fest.iterableJoin.js +44 -0
  124. package/dist/iter-fest.iterableJoin.js.map +1 -0
  125. package/dist/iter-fest.iterableJoin.mjs +7 -0
  126. package/dist/iter-fest.iterableJoin.mjs.map +1 -0
  127. package/dist/iter-fest.iterableKeys.d.mts +6 -0
  128. package/dist/iter-fest.iterableKeys.d.ts +6 -0
  129. package/dist/iter-fest.iterableKeys.js +36 -0
  130. package/dist/iter-fest.iterableKeys.js.map +1 -0
  131. package/dist/iter-fest.iterableKeys.mjs +7 -0
  132. package/dist/iter-fest.iterableKeys.mjs.map +1 -0
  133. package/dist/iter-fest.iterableMap.d.mts +8 -0
  134. package/dist/iter-fest.iterableMap.d.ts +8 -0
  135. package/dist/iter-fest.iterableMap.js +39 -0
  136. package/dist/iter-fest.iterableMap.js.map +1 -0
  137. package/dist/iter-fest.iterableMap.mjs +7 -0
  138. package/dist/iter-fest.iterableMap.mjs.map +1 -0
  139. package/dist/iter-fest.iterableReduce.d.mts +19 -0
  140. package/dist/iter-fest.iterableReduce.d.ts +19 -0
  141. package/dist/iter-fest.iterableReduce.js +41 -0
  142. package/dist/iter-fest.iterableReduce.js.map +1 -0
  143. package/dist/iter-fest.iterableReduce.mjs +7 -0
  144. package/dist/iter-fest.iterableReduce.mjs.map +1 -0
  145. package/dist/iter-fest.iterableSlice.d.mts +14 -0
  146. package/dist/iter-fest.iterableSlice.d.ts +14 -0
  147. package/dist/iter-fest.iterableSlice.js +65 -0
  148. package/dist/iter-fest.iterableSlice.js.map +1 -0
  149. package/dist/iter-fest.iterableSlice.mjs +8 -0
  150. package/dist/iter-fest.iterableSlice.mjs.map +1 -0
  151. package/dist/iter-fest.iterableSome.d.mts +12 -0
  152. package/dist/iter-fest.iterableSome.d.ts +12 -0
  153. package/dist/iter-fest.iterableSome.js +43 -0
  154. package/dist/iter-fest.iterableSome.js.map +1 -0
  155. package/dist/iter-fest.iterableSome.mjs +7 -0
  156. package/dist/iter-fest.iterableSome.mjs.map +1 -0
  157. package/dist/iter-fest.iterableToSpliced.d.mts +17 -0
  158. package/dist/iter-fest.iterableToSpliced.d.ts +17 -0
  159. package/dist/iter-fest.iterableToSpliced.js +62 -0
  160. package/dist/iter-fest.iterableToSpliced.js.map +1 -0
  161. package/dist/iter-fest.iterableToSpliced.mjs +8 -0
  162. package/dist/iter-fest.iterableToSpliced.mjs.map +1 -0
  163. package/dist/iter-fest.iterableToString.d.mts +6 -0
  164. package/dist/iter-fest.iterableToString.d.ts +6 -0
  165. package/dist/iter-fest.iterableToString.js +51 -0
  166. package/dist/iter-fest.iterableToString.js.map +1 -0
  167. package/dist/iter-fest.iterableToString.mjs +8 -0
  168. package/dist/iter-fest.iterableToString.mjs.map +1 -0
  169. package/dist/iter-fest.iteratorToIterable.d.mts +3 -0
  170. package/dist/iter-fest.iteratorToIterable.d.ts +3 -0
  171. package/dist/iter-fest.iteratorToIterable.js +39 -0
  172. package/dist/iter-fest.iteratorToIterable.js.map +1 -0
  173. package/dist/iter-fest.iteratorToIterable.mjs +7 -0
  174. package/dist/iter-fest.iteratorToIterable.mjs.map +1 -0
  175. package/dist/iter-fest.js +388 -0
  176. package/dist/iter-fest.js.map +1 -0
  177. package/dist/iter-fest.mjs +88 -0
  178. package/dist/iter-fest.mjs.map +1 -0
  179. package/package.json +279 -0
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.
3
+ * @param start The zero-based location in the array from which to start removing elements.
4
+ * @param deleteCount The number of elements to remove.
5
+ * @param items Elements to insert into the copied array in place of the deleted elements.
6
+ * @returns The copied array.
7
+ */
8
+ declare function iterableToSpliced<T>(iterable: Iterable<T>, start?: number | undefined, deleteCount?: number | undefined, ...items: T[]): Iterable<T>;
9
+ /**
10
+ * Copies an array and removes elements while returning the remaining elements.
11
+ * @param start The zero-based location in the array from which to start removing elements.
12
+ * @param deleteCount The number of elements to remove.
13
+ * @returns A copy of the original array with the remaining elements.
14
+ */
15
+ declare function iterableToSpliced<T>(iterable: Iterable<T>, start?: number | undefined, deleteCount?: number | undefined): Iterable<T>;
16
+
17
+ export { iterableToSpliced };
@@ -0,0 +1,62 @@
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/iterableToSpliced.ts
21
+ var iterableToSpliced_exports = {};
22
+ __export(iterableToSpliced_exports, {
23
+ iterableToSpliced: () => iterableToSpliced
24
+ });
25
+ module.exports = __toCommonJS(iterableToSpliced_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/iterableToSpliced.ts
36
+ function* iterableToSpliced(iterable, start = 0, deleteCount = 0, ...items) {
37
+ let index = 0;
38
+ start = toIntegerOrInfinity(start);
39
+ start = start === -Infinity ? 0 : start;
40
+ if (start < 0) {
41
+ throw new TypeError("start cannot be a negative finite number");
42
+ }
43
+ let inserted = false;
44
+ for (const item of iterable) {
45
+ if (index + 1 > start && !inserted) {
46
+ yield* items;
47
+ inserted = true;
48
+ }
49
+ if (index < start || index >= start + deleteCount) {
50
+ yield item;
51
+ }
52
+ index++;
53
+ }
54
+ if (!inserted) {
55
+ yield* items;
56
+ }
57
+ }
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ iterableToSpliced
61
+ });
62
+ //# sourceMappingURL=iter-fest.iterableToSpliced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/iterableToSpliced.ts","../src/private/toIntegerOrInfinity.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","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;;;ADsBO,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,8 @@
1
+ import {
2
+ iterableToSpliced
3
+ } from "./chunk-WKIRSZXX.mjs";
4
+ import "./chunk-W5NEOEVE.mjs";
5
+ export {
6
+ iterableToSpliced
7
+ };
8
+ //# sourceMappingURL=iter-fest.iterableToSpliced.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns a string representation of an iterable.
3
+ */
4
+ declare function iterableToString<T>(iterable: Iterable<T>): string;
5
+
6
+ export { iterableToString };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns a string representation of an iterable.
3
+ */
4
+ declare function iterableToString<T>(iterable: Iterable<T>): string;
5
+
6
+ export { iterableToString };
@@ -0,0 +1,51 @@
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/iterableToString.ts
21
+ var iterableToString_exports = {};
22
+ __export(iterableToString_exports, {
23
+ iterableToString: () => iterableToString
24
+ });
25
+ module.exports = __toCommonJS(iterableToString_exports);
26
+
27
+ // src/iterableJoin.ts
28
+ function iterableJoin(iterable, separator = ",") {
29
+ let index = 0;
30
+ let result = "";
31
+ for (const item of iterable) {
32
+ if (index) {
33
+ result += separator;
34
+ }
35
+ if (typeof item !== "undefined" && item !== null) {
36
+ result += item;
37
+ }
38
+ index++;
39
+ }
40
+ return result;
41
+ }
42
+
43
+ // src/iterableToString.ts
44
+ function iterableToString(iterable) {
45
+ return iterableJoin(iterable);
46
+ }
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ iterableToString
50
+ });
51
+ //# sourceMappingURL=iter-fest.iterableToString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/iterableToString.ts","../src/iterableJoin.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","/**\n * Adds all the elements of an iterable into a string, separated by the specified separator string.\n *\n * @param separator A string used to separate one element of the iterable from the next in the resulting string. If omitted, the iterable elements are separated with a comma.\n */\nexport function iterableJoin<T>(iterable: Iterable<T>, separator: string = ','): string {\n let index = 0;\n let result = '';\n\n for (const item of iterable) {\n if (index) {\n result += separator;\n }\n\n if (typeof item !== 'undefined' && item !== null) {\n result += item;\n }\n\n index++;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,SAAS,aAAgB,UAAuB,YAAoB,KAAa;AACtF,MAAI,QAAQ;AACZ,MAAI,SAAS;AAEb,aAAW,QAAQ,UAAU;AAC3B,QAAI,OAAO;AACT,gBAAU;AAAA,IACZ;AAEA,QAAI,OAAO,SAAS,eAAe,SAAS,MAAM;AAChD,gBAAU;AAAA,IACZ;AAEA;AAAA,EACF;AAEA,SAAO;AACT;;;ADjBO,SAAS,iBAAoB,UAA+B;AACjE,SAAO,aAAa,QAAQ;AAC9B;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ iterableToString
3
+ } from "./chunk-Y5M2C7NQ.mjs";
4
+ import "./chunk-5CHMNKXJ.mjs";
5
+ export {
6
+ iterableToString
7
+ };
8
+ //# sourceMappingURL=iter-fest.iterableToString.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function iteratorToIterable<T>(iterator: Iterator<T>): IterableIterator<T>;
2
+
3
+ export { iteratorToIterable };
@@ -0,0 +1,3 @@
1
+ declare function iteratorToIterable<T>(iterator: Iterator<T>): IterableIterator<T>;
2
+
3
+ export { iteratorToIterable };
@@ -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/iteratorToIterable.ts
21
+ var iteratorToIterable_exports = {};
22
+ __export(iteratorToIterable_exports, {
23
+ iteratorToIterable: () => iteratorToIterable
24
+ });
25
+ module.exports = __toCommonJS(iteratorToIterable_exports);
26
+ function iteratorToIterable(iterator) {
27
+ const iterableIterator = {
28
+ [Symbol.iterator]: () => iterableIterator,
29
+ next: iterator.next.bind(iterator),
30
+ ...iterator.return ? { return: iterator.return.bind(iterator) } : {},
31
+ ...iterator.throw ? { throw: iterator.throw.bind(iterator) } : {}
32
+ };
33
+ return iterableIterator;
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ iteratorToIterable
38
+ });
39
+ //# sourceMappingURL=iter-fest.iteratorToIterable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/iteratorToIterable.ts"],"sourcesContent":["export function iteratorToIterable<T>(iterator: Iterator<T>): IterableIterator<T> {\n const iterableIterator: IterableIterator<T> = {\n [Symbol.iterator]: () => iterableIterator,\n next: iterator.next.bind(iterator),\n ...(iterator.return ? { return: iterator.return.bind(iterator) } : {}),\n ...(iterator.throw ? { throw: iterator.throw.bind(iterator) } : {})\n };\n\n return iterableIterator;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,mBAAsB,UAA4C;AAChF,QAAM,mBAAwC;AAAA,IAC5C,CAAC,OAAO,QAAQ,GAAG,MAAM;AAAA,IACzB,MAAM,SAAS,KAAK,KAAK,QAAQ;AAAA,IACjC,GAAI,SAAS,SAAS,EAAE,QAAQ,SAAS,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC;AAAA,IACpE,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAM,KAAK,QAAQ,EAAE,IAAI,CAAC;AAAA,EACnE;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ iteratorToIterable
3
+ } from "./chunk-MNDAEMYM.mjs";
4
+ export {
5
+ iteratorToIterable
6
+ };
7
+ //# sourceMappingURL=iter-fest.iteratorToIterable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,388 @@
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/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ iterableAt: () => iterableAt,
24
+ iterableConcat: () => iterableConcat,
25
+ iterableEntries: () => iterableEntries,
26
+ iterableEvery: () => iterableEvery,
27
+ iterableFilter: () => iterableFilter,
28
+ iterableFind: () => iterableFind,
29
+ iterableFindIndex: () => iterableFindIndex,
30
+ iterableFindLast: () => iterableFindLast,
31
+ iterableFindLastIndex: () => iterableFindLastIndex,
32
+ iterableForEach: () => iterableForEach,
33
+ iterableIncludes: () => iterableIncludes,
34
+ iterableIndexOf: () => iterableIndexOf,
35
+ iterableJoin: () => iterableJoin,
36
+ iterableKeys: () => iterableKeys,
37
+ iterableMap: () => iterableMap,
38
+ iterableReduce: () => iterableReduce,
39
+ iterableSlice: () => iterableSlice,
40
+ iterableSome: () => iterableSome,
41
+ iterableToSpliced: () => iterableToSpliced,
42
+ iterableToString: () => iterableToString,
43
+ iteratorToIterable: () => iteratorToIterable
44
+ });
45
+ module.exports = __toCommonJS(src_exports);
46
+
47
+ // src/private/toIntegerOrInfinity.ts
48
+ function toIntegerOrInfinity(value) {
49
+ if (value === Infinity || value === -Infinity) {
50
+ return value;
51
+ }
52
+ return ~~value;
53
+ }
54
+
55
+ // src/iterableAt.ts
56
+ function iterableAt(iterable, index) {
57
+ let currentIndex = 0;
58
+ index = toIntegerOrInfinity(index);
59
+ if (!isFinite(index)) {
60
+ return;
61
+ }
62
+ if (index < 0) {
63
+ throw new TypeError("index cannot be a negative finite number");
64
+ }
65
+ for (const value of iterable) {
66
+ if (currentIndex++ === index) {
67
+ return value;
68
+ }
69
+ }
70
+ return void 0;
71
+ }
72
+
73
+ // src/iterableConcat.ts
74
+ function* iterableConcat(iterable, ...items) {
75
+ yield* iterable;
76
+ for (const item of items) {
77
+ if (item && typeof item === "object" && Symbol.iterator in item) {
78
+ yield* item;
79
+ } else {
80
+ yield item;
81
+ }
82
+ }
83
+ }
84
+
85
+ // src/iterableEntries.ts
86
+ function* iterableEntries(iterable) {
87
+ let index = 0;
88
+ for (const value of iterable) {
89
+ yield [index++, value];
90
+ }
91
+ }
92
+
93
+ // src/iterableEvery.ts
94
+ function iterableEvery(iterable, predicate, thisArg = void 0) {
95
+ let index = 0;
96
+ if (typeof predicate !== "function") {
97
+ throw new TypeError(`${predicate} is not a function`);
98
+ }
99
+ const boundPredicate = predicate.bind(thisArg);
100
+ for (const value of iterable) {
101
+ if (!boundPredicate(value, index++, iterable)) {
102
+ return false;
103
+ }
104
+ }
105
+ return true;
106
+ }
107
+
108
+ // src/iterableFilter.ts
109
+ function* iterableFilter(iterable, predicate, thisArg) {
110
+ let index = 0;
111
+ if (typeof predicate !== "function") {
112
+ throw new TypeError(`${predicate} is not a function`);
113
+ }
114
+ const boundPredicate = predicate.bind(thisArg);
115
+ for (const value of iterable) {
116
+ if (boundPredicate(value, index++, iterable)) {
117
+ yield value;
118
+ }
119
+ }
120
+ }
121
+
122
+ // src/iterableFind.ts
123
+ function iterableFind(iterable, predicate, thisArg) {
124
+ let index = 0;
125
+ if (typeof predicate !== "function") {
126
+ throw new TypeError(`${predicate} is not a function`);
127
+ }
128
+ const boundPredicate = predicate.bind(thisArg);
129
+ for (const value of iterable) {
130
+ if (boundPredicate(value, index++, iterable)) {
131
+ return value;
132
+ }
133
+ }
134
+ return void 0;
135
+ }
136
+
137
+ // src/iterableFindIndex.ts
138
+ function iterableFindIndex(iterable, predicate, thisArg) {
139
+ let index = 0;
140
+ if (typeof predicate !== "function") {
141
+ throw new TypeError(`${predicate} is not a function`);
142
+ }
143
+ const boundPredicate = predicate.bind(thisArg);
144
+ for (const value of iterable) {
145
+ if (boundPredicate(value, index, iterable)) {
146
+ return index;
147
+ }
148
+ index++;
149
+ }
150
+ return -1;
151
+ }
152
+
153
+ // src/iterableFindLast.ts
154
+ function iterableFindLast(iterable, predicate, thisArg) {
155
+ let index = 0;
156
+ let last;
157
+ if (typeof predicate !== "function") {
158
+ throw new TypeError(`${predicate} is not a function`);
159
+ }
160
+ const boundPredicate = predicate.bind(thisArg);
161
+ for (const value of iterable) {
162
+ if (boundPredicate(value, index++, iterable)) {
163
+ last = value;
164
+ }
165
+ }
166
+ return last;
167
+ }
168
+
169
+ // src/iterableFindLastIndex.ts
170
+ function iterableFindLastIndex(iterable, predicate, thisArg) {
171
+ let index = 0;
172
+ let lastIndex = -1;
173
+ if (typeof predicate !== "function") {
174
+ throw new TypeError(`${predicate} is not a function`);
175
+ }
176
+ const boundPredicate = predicate.bind(thisArg);
177
+ for (const value of iterable) {
178
+ if (boundPredicate(value, index, iterable)) {
179
+ lastIndex = index;
180
+ }
181
+ index++;
182
+ }
183
+ return lastIndex;
184
+ }
185
+
186
+ // src/iterableForEach.ts
187
+ function iterableForEach(iterable, callbackfn, thisArg) {
188
+ let index = 0;
189
+ if (typeof callbackfn !== "function") {
190
+ throw new TypeError(`${callbackfn} is not a function`);
191
+ }
192
+ const boundCallbackfn = callbackfn.bind(thisArg);
193
+ for (const value of iterable) {
194
+ boundCallbackfn(value, index++, iterable);
195
+ }
196
+ }
197
+
198
+ // src/iterableIncludes.ts
199
+ function iterableIncludes(iterable, searchElement, fromIndex = 0) {
200
+ let index = 0;
201
+ fromIndex = toIntegerOrInfinity(fromIndex);
202
+ if (fromIndex !== Infinity) {
203
+ fromIndex = fromIndex === -Infinity ? 0 : fromIndex;
204
+ if (fromIndex < 0) {
205
+ throw new TypeError("fromIndex cannot be a negative finite number");
206
+ }
207
+ for (const item of iterable) {
208
+ if (index++ >= fromIndex && Object.is(item, searchElement)) {
209
+ return true;
210
+ }
211
+ }
212
+ }
213
+ return false;
214
+ }
215
+
216
+ // src/iterableIndexOf.ts
217
+ function iterableIndexOf(iterable, searchElement, fromIndex = 0) {
218
+ let index = 0;
219
+ fromIndex = toIntegerOrInfinity(fromIndex);
220
+ if (fromIndex !== Infinity) {
221
+ fromIndex = fromIndex === -Infinity ? 0 : fromIndex;
222
+ if (fromIndex < 0) {
223
+ throw new TypeError("fromIndex cannot be a negative finite number");
224
+ }
225
+ for (const item of iterable) {
226
+ if (index >= fromIndex && Object.is(item, searchElement)) {
227
+ return index;
228
+ }
229
+ index++;
230
+ }
231
+ }
232
+ return -1;
233
+ }
234
+
235
+ // src/iterableJoin.ts
236
+ function iterableJoin(iterable, separator = ",") {
237
+ let index = 0;
238
+ let result = "";
239
+ for (const item of iterable) {
240
+ if (index) {
241
+ result += separator;
242
+ }
243
+ if (typeof item !== "undefined" && item !== null) {
244
+ result += item;
245
+ }
246
+ index++;
247
+ }
248
+ return result;
249
+ }
250
+
251
+ // src/iterableKeys.ts
252
+ function* iterableKeys(iterable) {
253
+ let index = 0;
254
+ for (const _ of iterable) {
255
+ yield index++;
256
+ }
257
+ }
258
+
259
+ // src/iterableMap.ts
260
+ function* iterableMap(iterable, callbackfn, thisArg) {
261
+ let index = 0;
262
+ if (typeof callbackfn !== "function") {
263
+ throw new TypeError(`${callbackfn} is not a function`);
264
+ }
265
+ for (const value of iterable) {
266
+ yield callbackfn.call(thisArg, value, index++, iterable);
267
+ }
268
+ }
269
+
270
+ // src/iterableReduce.ts
271
+ function iterableReduce(iterable, callbackfn, initialValue) {
272
+ let index = 0;
273
+ let previousValue = initialValue;
274
+ if (typeof callbackfn !== "function") {
275
+ throw new TypeError(`${callbackfn} is not a function`);
276
+ }
277
+ for (const currentValue of iterable) {
278
+ previousValue = callbackfn(previousValue, currentValue, index++, iterable);
279
+ }
280
+ return previousValue;
281
+ }
282
+
283
+ // src/iterableSlice.ts
284
+ function* iterableSlice(iterable, start = 0, end = Infinity) {
285
+ let index = 0;
286
+ start = toIntegerOrInfinity(start);
287
+ start = start === -Infinity ? 0 : start;
288
+ end = toIntegerOrInfinity(end);
289
+ end = end === -Infinity ? 0 : end;
290
+ if (start < 0) {
291
+ throw new TypeError("start cannot be a negative finite number");
292
+ }
293
+ if (end < 0) {
294
+ throw new TypeError("end cannot be a negative finite number");
295
+ }
296
+ if (start === Infinity) {
297
+ return;
298
+ }
299
+ for (const item of iterable) {
300
+ if (index >= start && index < end) {
301
+ yield item;
302
+ }
303
+ index++;
304
+ if (index > end) {
305
+ break;
306
+ }
307
+ }
308
+ }
309
+
310
+ // src/iterableSome.ts
311
+ function iterableSome(iterable, predicate, thisArg = void 0) {
312
+ let index = 0;
313
+ if (typeof predicate !== "function") {
314
+ throw new TypeError(`${predicate} is not a function`);
315
+ }
316
+ const boundPredicate = predicate.bind(thisArg);
317
+ for (const value of iterable) {
318
+ if (boundPredicate(value, index++, iterable)) {
319
+ return true;
320
+ }
321
+ }
322
+ return false;
323
+ }
324
+
325
+ // src/iterableToSpliced.ts
326
+ function* iterableToSpliced(iterable, start = 0, deleteCount = 0, ...items) {
327
+ let index = 0;
328
+ start = toIntegerOrInfinity(start);
329
+ start = start === -Infinity ? 0 : start;
330
+ if (start < 0) {
331
+ throw new TypeError("start cannot be a negative finite number");
332
+ }
333
+ let inserted = false;
334
+ for (const item of iterable) {
335
+ if (index + 1 > start && !inserted) {
336
+ yield* items;
337
+ inserted = true;
338
+ }
339
+ if (index < start || index >= start + deleteCount) {
340
+ yield item;
341
+ }
342
+ index++;
343
+ }
344
+ if (!inserted) {
345
+ yield* items;
346
+ }
347
+ }
348
+
349
+ // src/iterableToString.ts
350
+ function iterableToString(iterable) {
351
+ return iterableJoin(iterable);
352
+ }
353
+
354
+ // src/iteratorToIterable.ts
355
+ function iteratorToIterable(iterator) {
356
+ const iterableIterator = {
357
+ [Symbol.iterator]: () => iterableIterator,
358
+ next: iterator.next.bind(iterator),
359
+ ...iterator.return ? { return: iterator.return.bind(iterator) } : {},
360
+ ...iterator.throw ? { throw: iterator.throw.bind(iterator) } : {}
361
+ };
362
+ return iterableIterator;
363
+ }
364
+ // Annotate the CommonJS export names for ESM import in node:
365
+ 0 && (module.exports = {
366
+ iterableAt,
367
+ iterableConcat,
368
+ iterableEntries,
369
+ iterableEvery,
370
+ iterableFilter,
371
+ iterableFind,
372
+ iterableFindIndex,
373
+ iterableFindLast,
374
+ iterableFindLastIndex,
375
+ iterableForEach,
376
+ iterableIncludes,
377
+ iterableIndexOf,
378
+ iterableJoin,
379
+ iterableKeys,
380
+ iterableMap,
381
+ iterableReduce,
382
+ iterableSlice,
383
+ iterableSome,
384
+ iterableToSpliced,
385
+ iterableToString,
386
+ iteratorToIterable
387
+ });
388
+ //# sourceMappingURL=iter-fest.js.map