iter-fest 0.1.1-main.cfcce86 → 0.1.1-main.dd552c2

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 (200) hide show
  1. package/README.md +126 -45
  2. package/dist/chunk-2DE3J4J7.mjs +35 -0
  3. package/dist/chunk-2DE3J4J7.mjs.map +1 -0
  4. package/dist/chunk-3S6LCGE6.mjs +10 -0
  5. package/dist/chunk-3S6LCGE6.mjs.map +1 -0
  6. package/dist/chunk-ANRVAYLW.mjs +35 -0
  7. package/dist/chunk-ANRVAYLW.mjs.map +1 -0
  8. package/dist/chunk-BWMXKULC.mjs +46 -0
  9. package/dist/chunk-BWMXKULC.mjs.map +1 -0
  10. package/dist/chunk-FBST4AUL.mjs +10 -0
  11. package/dist/chunk-FBST4AUL.mjs.map +1 -0
  12. package/dist/chunk-FMIHIL6A.mjs +10 -0
  13. package/dist/chunk-FMIHIL6A.mjs.map +1 -0
  14. package/dist/chunk-KYMTQJIJ.mjs +10 -0
  15. package/dist/chunk-KYMTQJIJ.mjs.map +1 -0
  16. package/dist/chunk-LIMQXDFK.mjs +10 -0
  17. package/dist/chunk-LIMQXDFK.mjs.map +1 -0
  18. package/dist/chunk-OWUGLCQB.mjs +10 -0
  19. package/dist/chunk-OWUGLCQB.mjs.map +1 -0
  20. package/dist/chunk-P4OSZLEH.mjs +15 -0
  21. package/dist/chunk-P4OSZLEH.mjs.map +1 -0
  22. package/dist/chunk-QX6EMOSQ.mjs +10 -0
  23. package/dist/chunk-QX6EMOSQ.mjs.map +1 -0
  24. package/dist/chunk-R6SXIXMH.mjs +10 -0
  25. package/dist/chunk-R6SXIXMH.mjs.map +1 -0
  26. package/dist/chunk-TDHR35S7.mjs +10 -0
  27. package/dist/chunk-TDHR35S7.mjs.map +1 -0
  28. package/dist/chunk-VCKLUCOT.mjs +10 -0
  29. package/dist/chunk-VCKLUCOT.mjs.map +1 -0
  30. package/dist/chunk-XQDGXAAF.mjs +10 -0
  31. package/dist/chunk-XQDGXAAF.mjs.map +1 -0
  32. package/dist/{chunk-MOBXUTO5.mjs → chunk-YJSIVBF7.mjs} +5 -5
  33. package/dist/chunk-YJSIVBF7.mjs.map +1 -0
  34. package/dist/chunk-YLERARWI.mjs +10 -0
  35. package/dist/chunk-YLERARWI.mjs.map +1 -0
  36. package/dist/iter-fest.asyncGeneratorWithLastValue.d.mts +6 -0
  37. package/dist/iter-fest.asyncGeneratorWithLastValue.d.ts +6 -0
  38. package/dist/iter-fest.asyncGeneratorWithLastValue.js +59 -0
  39. package/dist/iter-fest.asyncGeneratorWithLastValue.js.map +1 -0
  40. package/dist/iter-fest.asyncGeneratorWithLastValue.mjs +7 -0
  41. package/dist/iter-fest.asyncIteratorToAsyncIterable.d.mts +3 -0
  42. package/dist/iter-fest.asyncIteratorToAsyncIterable.d.ts +3 -0
  43. package/dist/{iter-fest.iterableForEach.js → iter-fest.asyncIteratorToAsyncIterable.js} +15 -16
  44. package/dist/iter-fest.asyncIteratorToAsyncIterable.js.map +1 -0
  45. package/dist/iter-fest.asyncIteratorToAsyncIterable.mjs +7 -0
  46. package/dist/iter-fest.d.mts +17 -9
  47. package/dist/iter-fest.d.ts +17 -9
  48. package/dist/iter-fest.generatorWithLastValue.d.mts +6 -0
  49. package/dist/iter-fest.generatorWithLastValue.d.ts +6 -0
  50. package/dist/iter-fest.generatorWithLastValue.js +59 -0
  51. package/dist/iter-fest.generatorWithLastValue.js.map +1 -0
  52. package/dist/iter-fest.generatorWithLastValue.mjs +7 -0
  53. package/dist/iter-fest.iterableWritableStream.d.mts +7 -0
  54. package/dist/iter-fest.iterableWritableStream.d.ts +7 -0
  55. package/dist/{iter-fest.pushAsyncIterableIterator.js → iter-fest.iterableWritableStream.js} +39 -30
  56. package/dist/iter-fest.iterableWritableStream.js.map +1 -0
  57. package/dist/iter-fest.iterableWritableStream.mjs +7 -0
  58. package/dist/iter-fest.iteratorDrop.d.mts +12 -0
  59. package/dist/iter-fest.iteratorDrop.d.ts +12 -0
  60. package/dist/iter-fest.iteratorDrop.js +44 -0
  61. package/dist/iter-fest.iteratorDrop.js.map +1 -0
  62. package/dist/iter-fest.iteratorDrop.mjs +7 -0
  63. package/dist/iter-fest.iteratorEvery.d.mts +25 -0
  64. package/dist/iter-fest.iteratorEvery.d.ts +25 -0
  65. package/dist/iter-fest.iteratorEvery.js +44 -0
  66. package/dist/iter-fest.iteratorEvery.js.map +1 -0
  67. package/dist/iter-fest.iteratorEvery.mjs +7 -0
  68. package/dist/iter-fest.iteratorFilter.d.mts +18 -0
  69. package/dist/iter-fest.iteratorFilter.d.ts +18 -0
  70. package/dist/iter-fest.iteratorFilter.js +44 -0
  71. package/dist/iter-fest.iteratorFilter.js.map +1 -0
  72. package/dist/iter-fest.iteratorFilter.mjs +7 -0
  73. package/dist/iter-fest.iteratorFind.d.mts +14 -0
  74. package/dist/iter-fest.iteratorFind.d.ts +14 -0
  75. package/dist/iter-fest.iteratorFind.js +44 -0
  76. package/dist/iter-fest.iteratorFind.js.map +1 -0
  77. package/dist/iter-fest.iteratorFind.mjs +7 -0
  78. package/dist/iter-fest.iteratorFlatMap.d.mts +12 -0
  79. package/dist/iter-fest.iteratorFlatMap.d.ts +12 -0
  80. package/dist/iter-fest.iteratorFlatMap.js +44 -0
  81. package/dist/iter-fest.iteratorFlatMap.js.map +1 -0
  82. package/dist/iter-fest.iteratorFlatMap.mjs +7 -0
  83. package/dist/iter-fest.iteratorForEach.d.mts +10 -0
  84. package/dist/iter-fest.iteratorForEach.d.ts +10 -0
  85. package/dist/iter-fest.iteratorForEach.js +44 -0
  86. package/dist/iter-fest.iteratorForEach.js.map +1 -0
  87. package/dist/iter-fest.iteratorForEach.mjs +7 -0
  88. package/dist/iter-fest.iteratorForEach.mjs.map +1 -0
  89. package/dist/iter-fest.iteratorFrom.d.mts +12 -0
  90. package/dist/iter-fest.iteratorFrom.d.ts +12 -0
  91. package/dist/iter-fest.iteratorFrom.js +44 -0
  92. package/dist/iter-fest.iteratorFrom.js.map +1 -0
  93. package/dist/iter-fest.iteratorFrom.mjs +7 -0
  94. package/dist/iter-fest.iteratorFrom.mjs.map +1 -0
  95. package/dist/iter-fest.iteratorMap.d.mts +10 -0
  96. package/dist/iter-fest.iteratorMap.d.ts +10 -0
  97. package/dist/iter-fest.iteratorMap.js +44 -0
  98. package/dist/iter-fest.iteratorMap.js.map +1 -0
  99. package/dist/iter-fest.iteratorMap.mjs +7 -0
  100. package/dist/iter-fest.iteratorMap.mjs.map +1 -0
  101. package/dist/{iter-fest.iterableReduce.d.mts → iter-fest.iteratorReduce.d.mts} +13 -9
  102. package/dist/{iter-fest.iterableReduce.d.ts → iter-fest.iteratorReduce.d.ts} +13 -9
  103. package/dist/iter-fest.iteratorReduce.js +44 -0
  104. package/dist/iter-fest.iteratorReduce.js.map +1 -0
  105. package/dist/iter-fest.iteratorReduce.mjs +7 -0
  106. package/dist/iter-fest.iteratorReduce.mjs.map +1 -0
  107. package/dist/iter-fest.iteratorSome.d.mts +10 -0
  108. package/dist/iter-fest.iteratorSome.d.ts +10 -0
  109. package/dist/iter-fest.iteratorSome.js +44 -0
  110. package/dist/iter-fest.iteratorSome.js.map +1 -0
  111. package/dist/iter-fest.iteratorSome.mjs +7 -0
  112. package/dist/iter-fest.iteratorSome.mjs.map +1 -0
  113. package/dist/iter-fest.iteratorTake.d.mts +12 -0
  114. package/dist/iter-fest.iteratorTake.d.ts +12 -0
  115. package/dist/iter-fest.iteratorTake.js +44 -0
  116. package/dist/iter-fest.iteratorTake.js.map +1 -0
  117. package/dist/iter-fest.iteratorTake.mjs +7 -0
  118. package/dist/iter-fest.iteratorTake.mjs.map +1 -0
  119. package/dist/iter-fest.iteratorToArray.d.mts +13 -0
  120. package/dist/iter-fest.iteratorToArray.d.ts +13 -0
  121. package/dist/iter-fest.iteratorToArray.js +44 -0
  122. package/dist/iter-fest.iteratorToArray.js.map +1 -0
  123. package/dist/iter-fest.iteratorToArray.mjs +7 -0
  124. package/dist/iter-fest.iteratorToArray.mjs.map +1 -0
  125. package/dist/iter-fest.js +239 -164
  126. package/dist/iter-fest.js.map +1 -1
  127. package/dist/iter-fest.mjs +70 -38
  128. package/dist/iter-fest.readableStreamFrom.d.mts +3 -0
  129. package/dist/iter-fest.readableStreamFrom.d.ts +3 -0
  130. package/dist/{iter-fest.iterableGetReadable.js → iter-fest.readableStreamFrom.js} +9 -9
  131. package/dist/iter-fest.readableStreamFrom.js.map +1 -0
  132. package/dist/iter-fest.readableStreamFrom.mjs +7 -0
  133. package/dist/iter-fest.readableStreamFrom.mjs.map +1 -0
  134. package/package.json +167 -87
  135. package/dist/chunk-5CRMPYKD.mjs +0 -19
  136. package/dist/chunk-5CRMPYKD.mjs.map +0 -1
  137. package/dist/chunk-6C3P4TNK.mjs +0 -19
  138. package/dist/chunk-6C3P4TNK.mjs.map +0 -1
  139. package/dist/chunk-EZC33HE6.mjs +0 -15
  140. package/dist/chunk-EZC33HE6.mjs.map +0 -1
  141. package/dist/chunk-JU353VSE.mjs +0 -16
  142. package/dist/chunk-JU353VSE.mjs.map +0 -1
  143. package/dist/chunk-MNLOWKTC.mjs +0 -19
  144. package/dist/chunk-MNLOWKTC.mjs.map +0 -1
  145. package/dist/chunk-MOBXUTO5.mjs.map +0 -1
  146. package/dist/chunk-O5SQJUKB.mjs +0 -37
  147. package/dist/chunk-O5SQJUKB.mjs.map +0 -1
  148. package/dist/chunk-XW34KZRY.mjs +0 -17
  149. package/dist/chunk-XW34KZRY.mjs.map +0 -1
  150. package/dist/chunk-ZUBHGSCW.mjs +0 -18
  151. package/dist/chunk-ZUBHGSCW.mjs.map +0 -1
  152. package/dist/iter-fest.iterableEvery.d.mts +0 -24
  153. package/dist/iter-fest.iterableEvery.d.ts +0 -24
  154. package/dist/iter-fest.iterableEvery.js +0 -43
  155. package/dist/iter-fest.iterableEvery.js.map +0 -1
  156. package/dist/iter-fest.iterableEvery.mjs +0 -7
  157. package/dist/iter-fest.iterableFilter.d.mts +0 -16
  158. package/dist/iter-fest.iterableFilter.d.ts +0 -16
  159. package/dist/iter-fest.iterableFilter.js +0 -42
  160. package/dist/iter-fest.iterableFilter.js.map +0 -1
  161. package/dist/iter-fest.iterableFilter.mjs +0 -7
  162. package/dist/iter-fest.iterableFind.d.mts +0 -15
  163. package/dist/iter-fest.iterableFind.d.ts +0 -15
  164. package/dist/iter-fest.iterableFind.js +0 -43
  165. package/dist/iter-fest.iterableFind.js.map +0 -1
  166. package/dist/iter-fest.iterableFind.mjs +0 -7
  167. package/dist/iter-fest.iterableForEach.d.mts +0 -10
  168. package/dist/iter-fest.iterableForEach.d.ts +0 -10
  169. package/dist/iter-fest.iterableForEach.js.map +0 -1
  170. package/dist/iter-fest.iterableForEach.mjs +0 -7
  171. package/dist/iter-fest.iterableGetReadable.d.mts +0 -3
  172. package/dist/iter-fest.iterableGetReadable.d.ts +0 -3
  173. package/dist/iter-fest.iterableGetReadable.js.map +0 -1
  174. package/dist/iter-fest.iterableGetReadable.mjs +0 -7
  175. package/dist/iter-fest.iterableMap.d.mts +0 -8
  176. package/dist/iter-fest.iterableMap.d.ts +0 -8
  177. package/dist/iter-fest.iterableMap.js +0 -39
  178. package/dist/iter-fest.iterableMap.js.map +0 -1
  179. package/dist/iter-fest.iterableMap.mjs +0 -7
  180. package/dist/iter-fest.iterableReduce.js +0 -41
  181. package/dist/iter-fest.iterableReduce.js.map +0 -1
  182. package/dist/iter-fest.iterableReduce.mjs +0 -7
  183. package/dist/iter-fest.iterableSome.d.mts +0 -12
  184. package/dist/iter-fest.iterableSome.d.ts +0 -12
  185. package/dist/iter-fest.iterableSome.js +0 -43
  186. package/dist/iter-fest.iterableSome.js.map +0 -1
  187. package/dist/iter-fest.iterableSome.mjs +0 -7
  188. package/dist/iter-fest.pushAsyncIterableIterator.d.mts +0 -9
  189. package/dist/iter-fest.pushAsyncIterableIterator.d.ts +0 -9
  190. package/dist/iter-fest.pushAsyncIterableIterator.js.map +0 -1
  191. package/dist/iter-fest.pushAsyncIterableIterator.mjs +0 -7
  192. /package/dist/{iter-fest.iterableEvery.mjs.map → iter-fest.asyncGeneratorWithLastValue.mjs.map} +0 -0
  193. /package/dist/{iter-fest.iterableFilter.mjs.map → iter-fest.asyncIteratorToAsyncIterable.mjs.map} +0 -0
  194. /package/dist/{iter-fest.iterableFind.mjs.map → iter-fest.generatorWithLastValue.mjs.map} +0 -0
  195. /package/dist/{iter-fest.iterableForEach.mjs.map → iter-fest.iterableWritableStream.mjs.map} +0 -0
  196. /package/dist/{iter-fest.iterableGetReadable.mjs.map → iter-fest.iteratorDrop.mjs.map} +0 -0
  197. /package/dist/{iter-fest.iterableMap.mjs.map → iter-fest.iteratorEvery.mjs.map} +0 -0
  198. /package/dist/{iter-fest.iterableReduce.mjs.map → iter-fest.iteratorFilter.mjs.map} +0 -0
  199. /package/dist/{iter-fest.iterableSome.mjs.map → iter-fest.iteratorFind.mjs.map} +0 -0
  200. /package/dist/{iter-fest.pushAsyncIterableIterator.mjs.map → iter-fest.iteratorFlatMap.mjs.map} +0 -0
package/dist/iter-fest.js CHANGED
@@ -9,11 +9,11 @@ var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
12
+ var __copyProps = (to, from2, except, desc) => {
13
+ if (from2 && typeof from2 === "object" || typeof from2 === "function") {
14
+ for (let key of __getOwnPropNames(from2))
15
15
  if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
17
17
  }
18
18
  return to;
19
19
  };
@@ -30,33 +30,41 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ IterableWritableStream: () => IterableWritableStream,
33
34
  Observable: () => Observable,
34
- PushAsyncIterableIterator: () => PushAsyncIterableIterator,
35
35
  SymbolObservable: () => SymbolObservable,
36
+ asyncGeneratorWithLastValue: () => asyncGeneratorWithLastValue,
37
+ asyncIteratorToAsyncIterable: () => asyncIteratorToAsyncIterable,
38
+ generatorWithLastValue: () => generatorWithLastValue,
36
39
  iterableAt: () => iterableAt,
37
40
  iterableConcat: () => iterableConcat,
38
41
  iterableEntries: () => iterableEntries,
39
- iterableEvery: () => iterableEvery,
40
- iterableFilter: () => iterableFilter,
41
- iterableFind: () => iterableFind,
42
42
  iterableFindIndex: () => iterableFindIndex,
43
43
  iterableFindLast: () => iterableFindLast,
44
44
  iterableFindLastIndex: () => iterableFindLastIndex,
45
- iterableForEach: () => iterableForEach,
46
- iterableGetReadable: () => iterableGetReadable,
47
45
  iterableIncludes: () => iterableIncludes,
48
46
  iterableIndexOf: () => iterableIndexOf,
49
47
  iterableJoin: () => iterableJoin,
50
48
  iterableKeys: () => iterableKeys,
51
- iterableMap: () => iterableMap,
52
- iterableReduce: () => iterableReduce,
53
49
  iterableSlice: () => iterableSlice,
54
- iterableSome: () => iterableSome,
55
50
  iterableToSpliced: () => iterableToSpliced,
56
51
  iterableToString: () => iterableToString,
52
+ iteratorDrop: () => iteratorDrop,
53
+ iteratorEvery: () => iteratorEvery,
54
+ iteratorFilter: () => iteratorFilter,
55
+ iteratorFind: () => iteratorFind,
56
+ iteratorFlatMap: () => iteratorFlatMap,
57
+ iteratorForEach: () => iteratorForEach,
58
+ iteratorFrom: () => iteratorFrom,
59
+ iteratorMap: () => iteratorMap,
60
+ iteratorReduce: () => iteratorReduce,
61
+ iteratorSome: () => iteratorSome,
62
+ iteratorTake: () => iteratorTake,
63
+ iteratorToArray: () => iteratorToArray,
57
64
  iteratorToIterable: () => iteratorToIterable,
58
65
  observableFromAsync: () => observableFromAsync,
59
66
  observableSubscribeAsReadable: () => observableSubscribeAsReadable,
67
+ readableStreamFrom: () => readableStreamFrom,
60
68
  readerValues: () => readerValues
61
69
  });
62
70
  module.exports = __toCommonJS(src_exports);
@@ -89,38 +97,78 @@ var Observable = class extends import_observable2.default {
89
97
  }
90
98
  };
91
99
 
92
- // src/private/withResolvers.ts
93
- var import_with_resolvers = __toESM(require("core-js-pure/full/promise/with-resolvers"));
94
- function withResolvers() {
95
- return (0, import_with_resolvers.default)();
100
+ // src/asyncGeneratorWithLastValue.ts
101
+ var STILL_ITERATING = Symbol();
102
+ function asyncGeneratorWithLastValue(generator) {
103
+ let lastValue = STILL_ITERATING;
104
+ const asyncGeneratorWithLastValue2 = {
105
+ [Symbol.asyncIterator]() {
106
+ return asyncGeneratorWithLastValue2;
107
+ },
108
+ lastValue() {
109
+ if (lastValue === STILL_ITERATING) {
110
+ throw new Error("Iteration has not complete yet, cannot get last value.");
111
+ }
112
+ return lastValue;
113
+ },
114
+ async next(next) {
115
+ const result = await generator.next(next);
116
+ if (result.done) {
117
+ lastValue = result.value;
118
+ }
119
+ return result;
120
+ },
121
+ return(value) {
122
+ return generator.return(value);
123
+ },
124
+ throw(error) {
125
+ return generator.throw(error);
126
+ }
127
+ };
128
+ return asyncGeneratorWithLastValue2;
96
129
  }
97
130
 
98
- // src/PushAsyncIterableIterator.ts
99
- var CLOSE = Symbol("close");
100
- var PushAsyncIterableIterator = class {
101
- #closed = false;
102
- #pushResolvers = withResolvers();
103
- [Symbol.asyncIterator]() {
104
- return this;
105
- }
106
- close() {
107
- this.#closed = true;
108
- this.#pushResolvers.resolve(CLOSE);
109
- }
110
- async next() {
111
- const value = await this.#pushResolvers.promise;
112
- if (value === CLOSE) {
113
- return { done: true, value: void 0 };
114
- }
115
- return { done: false, value };
116
- }
117
- push(value) {
118
- if (!this.#closed) {
119
- this.#pushResolvers.resolve(value);
120
- this.#pushResolvers = withResolvers();
131
+ // src/asyncIteratorToAsyncIterable.ts
132
+ function asyncIteratorToAsyncIterable(asyncIterator) {
133
+ const asyncIterableIterator = {
134
+ [Symbol.asyncIterator]: () => asyncIterableIterator,
135
+ next: asyncIterator.next.bind(asyncIterator),
136
+ ...asyncIterator.return ? { return: asyncIterator.return.bind(asyncIterator) } : {},
137
+ ...asyncIterator.throw ? { throw: asyncIterator.throw.bind(asyncIterator) } : {}
138
+ };
139
+ return asyncIterableIterator;
140
+ }
141
+
142
+ // src/generatorWithLastValue.ts
143
+ var STILL_ITERATING2 = Symbol();
144
+ function generatorWithLastValue(generator) {
145
+ let lastValue = STILL_ITERATING2;
146
+ const generatorWithLastValue2 = {
147
+ [Symbol.iterator]() {
148
+ return generatorWithLastValue2;
149
+ },
150
+ lastValue() {
151
+ if (lastValue === STILL_ITERATING2) {
152
+ throw new Error("Iteration has not complete yet, cannot get last value.");
153
+ }
154
+ return lastValue;
155
+ },
156
+ next(next) {
157
+ const result = generator.next(next);
158
+ if (result.done) {
159
+ lastValue = result.value;
160
+ }
161
+ return result;
162
+ },
163
+ return(value) {
164
+ return generator.return(value);
165
+ },
166
+ throw(error) {
167
+ return generator.throw(error);
121
168
  }
122
- }
123
- };
169
+ };
170
+ return generatorWithLastValue2;
171
+ }
124
172
 
125
173
  // src/private/toIntegerOrInfinity.ts
126
174
  function toIntegerOrInfinity(value) {
@@ -168,50 +216,6 @@ function* iterableEntries(iterable) {
168
216
  }
169
217
  }
170
218
 
171
- // src/iterableEvery.ts
172
- function iterableEvery(iterable, predicate, thisArg = void 0) {
173
- let index = 0;
174
- if (typeof predicate !== "function") {
175
- throw new TypeError(`${predicate} is not a function`);
176
- }
177
- const boundPredicate = predicate.bind(thisArg);
178
- for (const value of iterable) {
179
- if (!boundPredicate(value, index++, iterable)) {
180
- return false;
181
- }
182
- }
183
- return true;
184
- }
185
-
186
- // src/iterableFilter.ts
187
- function* iterableFilter(iterable, predicate, thisArg) {
188
- let index = 0;
189
- if (typeof predicate !== "function") {
190
- throw new TypeError(`${predicate} is not a function`);
191
- }
192
- const boundPredicate = predicate.bind(thisArg);
193
- for (const value of iterable) {
194
- if (boundPredicate(value, index++, iterable)) {
195
- yield value;
196
- }
197
- }
198
- }
199
-
200
- // src/iterableFind.ts
201
- function iterableFind(iterable, predicate, thisArg) {
202
- let index = 0;
203
- if (typeof predicate !== "function") {
204
- throw new TypeError(`${predicate} is not a function`);
205
- }
206
- const boundPredicate = predicate.bind(thisArg);
207
- for (const value of iterable) {
208
- if (boundPredicate(value, index++, iterable)) {
209
- return value;
210
- }
211
- }
212
- return void 0;
213
- }
214
-
215
219
  // src/iterableFindIndex.ts
216
220
  function iterableFindIndex(iterable, predicate, thisArg) {
217
221
  let index = 0;
@@ -261,36 +265,6 @@ function iterableFindLastIndex(iterable, predicate, thisArg) {
261
265
  return lastIndex;
262
266
  }
263
267
 
264
- // src/iterableForEach.ts
265
- function iterableForEach(iterable, callbackfn, thisArg) {
266
- let index = 0;
267
- if (typeof callbackfn !== "function") {
268
- throw new TypeError(`${callbackfn} is not a function`);
269
- }
270
- const boundCallbackfn = callbackfn.bind(thisArg);
271
- for (const value of iterable) {
272
- boundCallbackfn(value, index++, iterable);
273
- }
274
- }
275
-
276
- // src/iterableGetReadable.ts
277
- function isIterable(iterable) {
278
- return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
279
- }
280
- function iterableGetReadable(iterable) {
281
- const iterator = isIterable(iterable) ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
282
- return new ReadableStream({
283
- async pull(controller) {
284
- const result = await iterator.next();
285
- if (result.done) {
286
- controller.close();
287
- } else {
288
- controller.enqueue(result.value);
289
- }
290
- }
291
- });
292
- }
293
-
294
268
  // src/iterableIncludes.ts
295
269
  function iterableIncludes(iterable, searchElement, fromIndex = 0) {
296
270
  let index = 0;
@@ -352,30 +326,6 @@ function* iterableKeys(iterable) {
352
326
  }
353
327
  }
354
328
 
355
- // src/iterableMap.ts
356
- function* iterableMap(iterable, callbackfn, thisArg) {
357
- let index = 0;
358
- if (typeof callbackfn !== "function") {
359
- throw new TypeError(`${callbackfn} is not a function`);
360
- }
361
- for (const value of iterable) {
362
- yield callbackfn.call(thisArg, value, index++, iterable);
363
- }
364
- }
365
-
366
- // src/iterableReduce.ts
367
- function iterableReduce(iterable, callbackfn, initialValue) {
368
- let index = 0;
369
- let previousValue = initialValue;
370
- if (typeof callbackfn !== "function") {
371
- throw new TypeError(`${callbackfn} is not a function`);
372
- }
373
- for (const currentValue of iterable) {
374
- previousValue = callbackfn(previousValue, currentValue, index++, iterable);
375
- }
376
- return previousValue;
377
- }
378
-
379
329
  // src/iterableSlice.ts
380
330
  function* iterableSlice(iterable, start = 0, end = Infinity) {
381
331
  let index = 0;
@@ -403,21 +353,6 @@ function* iterableSlice(iterable, start = 0, end = Infinity) {
403
353
  }
404
354
  }
405
355
 
406
- // src/iterableSome.ts
407
- function iterableSome(iterable, predicate, thisArg = void 0) {
408
- let index = 0;
409
- if (typeof predicate !== "function") {
410
- throw new TypeError(`${predicate} is not a function`);
411
- }
412
- const boundPredicate = predicate.bind(thisArg);
413
- for (const value of iterable) {
414
- if (boundPredicate(value, index++, iterable)) {
415
- return true;
416
- }
417
- }
418
- return false;
419
- }
420
-
421
356
  // src/iterableToSpliced.ts
422
357
  function* iterableToSpliced(iterable, start = 0, deleteCount = 0, ...items) {
423
358
  let index = 0;
@@ -447,6 +382,120 @@ function iterableToString(iterable) {
447
382
  return iterableJoin(iterable);
448
383
  }
449
384
 
385
+ // src/private/withResolvers.ts
386
+ var import_with_resolvers = __toESM(require("core-js-pure/full/promise/with-resolvers"));
387
+ function withResolvers() {
388
+ return (0, import_with_resolvers.default)();
389
+ }
390
+
391
+ // src/iterableWritableStream.ts
392
+ var CLOSE = Symbol();
393
+ var IterableWritableStream = class extends WritableStream {
394
+ constructor() {
395
+ super({
396
+ close: () => {
397
+ this.#buffer.push(CLOSE);
398
+ this.#writeResolvers.resolve();
399
+ },
400
+ write: (chunk) => {
401
+ this.#buffer.push(chunk);
402
+ this.#writeResolvers.resolve();
403
+ this.#writeResolvers = withResolvers();
404
+ }
405
+ });
406
+ }
407
+ #buffer = [];
408
+ #writeResolvers = withResolvers();
409
+ [Symbol.asyncIterator]() {
410
+ return {
411
+ next: async () => {
412
+ while (!this.#buffer.length) {
413
+ await this.#writeResolvers.promise;
414
+ }
415
+ const value = this.#buffer[0];
416
+ if (value === CLOSE) {
417
+ return { done: true, value: void 0 };
418
+ }
419
+ this.#buffer.shift();
420
+ await void 0;
421
+ return { done: false, value };
422
+ }
423
+ };
424
+ }
425
+ };
426
+
427
+ // src/iteratorDrop.ts
428
+ var import_drop = __toESM(require("core-js-pure/full/iterator/drop"));
429
+ function iteratorDrop(iterator, limit) {
430
+ return (0, import_drop.default)(iterator, limit);
431
+ }
432
+
433
+ // src/iteratorEvery.ts
434
+ var import_every = __toESM(require("core-js-pure/full/iterator/every"));
435
+ function iteratorEvery(iterator, predicate) {
436
+ return (0, import_every.default)(iterator, predicate);
437
+ }
438
+
439
+ // src/iteratorFilter.ts
440
+ var import_filter = __toESM(require("core-js-pure/full/iterator/filter"));
441
+ function iteratorFilter(iterator, predicate) {
442
+ return (0, import_filter.default)(iterator, predicate);
443
+ }
444
+
445
+ // src/iteratorFind.ts
446
+ var import_find = __toESM(require("core-js-pure/full/iterator/find"));
447
+ function iteratorFind(iterator, predicate) {
448
+ return (0, import_find.default)(iterator, predicate);
449
+ }
450
+
451
+ // src/iteratorFlatMap.ts
452
+ var import_flat_map = __toESM(require("core-js-pure/full/iterator/flat-map"));
453
+ function iteratorFlatMap(iterable, mapperFn) {
454
+ return (0, import_flat_map.default)(iterable, mapperFn);
455
+ }
456
+
457
+ // src/iteratorForEach.ts
458
+ var import_for_each = __toESM(require("core-js-pure/full/iterator/for-each"));
459
+ function iteratorForEach(iterator, callbackfn) {
460
+ (0, import_for_each.default)(iterator, callbackfn);
461
+ }
462
+
463
+ // src/iteratorFrom.ts
464
+ var import_from = __toESM(require("core-js-pure/full/iterator/from"));
465
+ function iteratorFrom(iteratorLike) {
466
+ return (0, import_from.default)(iteratorLike);
467
+ }
468
+
469
+ // src/iteratorMap.ts
470
+ var import_map = __toESM(require("core-js-pure/full/iterator/map"));
471
+ function iteratorMap(iterator, callbackfn) {
472
+ return (0, import_map.default)(iterator, callbackfn);
473
+ }
474
+
475
+ // src/iteratorReduce.ts
476
+ var import_reduce = __toESM(require("core-js-pure/full/iterator/reduce"));
477
+ function iteratorReduce(iterator, callbackfn, initialValue) {
478
+ return (0, import_reduce.default)(iterator, callbackfn, initialValue);
479
+ }
480
+
481
+ // src/iteratorSome.ts
482
+ var import_some = __toESM(require("core-js-pure/full/iterator/some"));
483
+ function iteratorSome(iterator, predicate) {
484
+ return (0, import_some.default)(iterator, predicate);
485
+ }
486
+
487
+ // src/iteratorTake.ts
488
+ var import_take = __toESM(require("core-js-pure/full/iterator/take"));
489
+ function iteratorTake(iterator, limit) {
490
+ return (0, import_take.default)(iterator, limit);
491
+ }
492
+
493
+ // src/iteratorToArray.ts
494
+ var import_to_array = __toESM(require("core-js-pure/full/iterator/to-array"));
495
+ function iteratorToArray(iteratorLike) {
496
+ return (0, import_to_array.default)(iteratorLike);
497
+ }
498
+
450
499
  // src/iteratorToIterable.ts
451
500
  function iteratorToIterable(iterator) {
452
501
  const iterableIterator = {
@@ -504,6 +553,24 @@ function observableSubscribeAsReadable(observable) {
504
553
  });
505
554
  }
506
555
 
556
+ // src/readableStreamFrom.ts
557
+ function isIterable(iterable) {
558
+ return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
559
+ }
560
+ function readableStreamFrom(anyIterable) {
561
+ const iterator = isIterable(anyIterable) ? anyIterable[Symbol.iterator]() : anyIterable[Symbol.asyncIterator]();
562
+ return new ReadableStream({
563
+ async pull(controller) {
564
+ const result = await iterator.next();
565
+ if (result.done) {
566
+ controller.close();
567
+ } else {
568
+ controller.enqueue(result.value);
569
+ }
570
+ }
571
+ });
572
+ }
573
+
507
574
  // src/readerValues.ts
508
575
  function readerValues(reader) {
509
576
  const iterable = {
@@ -526,33 +593,41 @@ function readerValues(reader) {
526
593
  }
527
594
  // Annotate the CommonJS export names for ESM import in node:
528
595
  0 && (module.exports = {
596
+ IterableWritableStream,
529
597
  Observable,
530
- PushAsyncIterableIterator,
531
598
  SymbolObservable,
599
+ asyncGeneratorWithLastValue,
600
+ asyncIteratorToAsyncIterable,
601
+ generatorWithLastValue,
532
602
  iterableAt,
533
603
  iterableConcat,
534
604
  iterableEntries,
535
- iterableEvery,
536
- iterableFilter,
537
- iterableFind,
538
605
  iterableFindIndex,
539
606
  iterableFindLast,
540
607
  iterableFindLastIndex,
541
- iterableForEach,
542
- iterableGetReadable,
543
608
  iterableIncludes,
544
609
  iterableIndexOf,
545
610
  iterableJoin,
546
611
  iterableKeys,
547
- iterableMap,
548
- iterableReduce,
549
612
  iterableSlice,
550
- iterableSome,
551
613
  iterableToSpliced,
552
614
  iterableToString,
615
+ iteratorDrop,
616
+ iteratorEvery,
617
+ iteratorFilter,
618
+ iteratorFind,
619
+ iteratorFlatMap,
620
+ iteratorForEach,
621
+ iteratorFrom,
622
+ iteratorMap,
623
+ iteratorReduce,
624
+ iteratorSome,
625
+ iteratorTake,
626
+ iteratorToArray,
553
627
  iteratorToIterable,
554
628
  observableFromAsync,
555
629
  observableSubscribeAsReadable,
630
+ readableStreamFrom,
556
631
  readerValues
557
632
  });
558
633
  //# sourceMappingURL=iter-fest.js.map