iter-fest 0.1.1-main.d88474c → 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 (177) hide show
  1. package/README.md +43 -18
  2. package/dist/chunk-3S6LCGE6.mjs +10 -0
  3. package/dist/chunk-3S6LCGE6.mjs.map +1 -0
  4. package/dist/chunk-BWMXKULC.mjs +46 -0
  5. package/dist/chunk-BWMXKULC.mjs.map +1 -0
  6. package/dist/chunk-FBST4AUL.mjs +10 -0
  7. package/dist/chunk-FBST4AUL.mjs.map +1 -0
  8. package/dist/chunk-FMIHIL6A.mjs +10 -0
  9. package/dist/chunk-FMIHIL6A.mjs.map +1 -0
  10. package/dist/chunk-KYMTQJIJ.mjs +10 -0
  11. package/dist/chunk-KYMTQJIJ.mjs.map +1 -0
  12. package/dist/chunk-LIMQXDFK.mjs +10 -0
  13. package/dist/chunk-LIMQXDFK.mjs.map +1 -0
  14. package/dist/chunk-OWUGLCQB.mjs +10 -0
  15. package/dist/chunk-OWUGLCQB.mjs.map +1 -0
  16. package/dist/chunk-QX6EMOSQ.mjs +10 -0
  17. package/dist/chunk-QX6EMOSQ.mjs.map +1 -0
  18. package/dist/chunk-R6SXIXMH.mjs +10 -0
  19. package/dist/chunk-R6SXIXMH.mjs.map +1 -0
  20. package/dist/chunk-TDHR35S7.mjs +10 -0
  21. package/dist/chunk-TDHR35S7.mjs.map +1 -0
  22. package/dist/chunk-VCKLUCOT.mjs +10 -0
  23. package/dist/chunk-VCKLUCOT.mjs.map +1 -0
  24. package/dist/chunk-XQDGXAAF.mjs +10 -0
  25. package/dist/chunk-XQDGXAAF.mjs.map +1 -0
  26. package/dist/{chunk-MOBXUTO5.mjs → chunk-YJSIVBF7.mjs} +5 -5
  27. package/dist/chunk-YJSIVBF7.mjs.map +1 -0
  28. package/dist/chunk-YLERARWI.mjs +10 -0
  29. package/dist/chunk-YLERARWI.mjs.map +1 -0
  30. package/dist/iter-fest.d.mts +14 -9
  31. package/dist/iter-fest.d.ts +14 -9
  32. package/dist/iter-fest.iterableWritableStream.d.mts +7 -0
  33. package/dist/iter-fest.iterableWritableStream.d.ts +7 -0
  34. package/dist/{iter-fest.pushAsyncIterableIterator.js → iter-fest.iterableWritableStream.js} +39 -30
  35. package/dist/iter-fest.iterableWritableStream.js.map +1 -0
  36. package/dist/iter-fest.iterableWritableStream.mjs +7 -0
  37. package/dist/iter-fest.iteratorDrop.d.mts +12 -0
  38. package/dist/iter-fest.iteratorDrop.d.ts +12 -0
  39. package/dist/iter-fest.iteratorDrop.js +44 -0
  40. package/dist/iter-fest.iteratorDrop.js.map +1 -0
  41. package/dist/iter-fest.iteratorDrop.mjs +7 -0
  42. package/dist/iter-fest.iteratorEvery.d.mts +25 -0
  43. package/dist/iter-fest.iteratorEvery.d.ts +25 -0
  44. package/dist/iter-fest.iteratorEvery.js +44 -0
  45. package/dist/iter-fest.iteratorEvery.js.map +1 -0
  46. package/dist/iter-fest.iteratorEvery.mjs +7 -0
  47. package/dist/iter-fest.iteratorFilter.d.mts +18 -0
  48. package/dist/iter-fest.iteratorFilter.d.ts +18 -0
  49. package/dist/iter-fest.iteratorFilter.js +44 -0
  50. package/dist/iter-fest.iteratorFilter.js.map +1 -0
  51. package/dist/iter-fest.iteratorFilter.mjs +7 -0
  52. package/dist/iter-fest.iteratorFind.d.mts +14 -0
  53. package/dist/iter-fest.iteratorFind.d.ts +14 -0
  54. package/dist/iter-fest.iteratorFind.js +44 -0
  55. package/dist/iter-fest.iteratorFind.js.map +1 -0
  56. package/dist/iter-fest.iteratorFind.mjs +7 -0
  57. package/dist/iter-fest.iteratorFlatMap.d.mts +12 -0
  58. package/dist/iter-fest.iteratorFlatMap.d.ts +12 -0
  59. package/dist/iter-fest.iteratorFlatMap.js +44 -0
  60. package/dist/iter-fest.iteratorFlatMap.js.map +1 -0
  61. package/dist/iter-fest.iteratorFlatMap.mjs +7 -0
  62. package/dist/iter-fest.iteratorForEach.d.mts +10 -0
  63. package/dist/iter-fest.iteratorForEach.d.ts +10 -0
  64. package/dist/iter-fest.iteratorForEach.js +44 -0
  65. package/dist/iter-fest.iteratorForEach.js.map +1 -0
  66. package/dist/iter-fest.iteratorForEach.mjs +7 -0
  67. package/dist/iter-fest.iteratorFrom.d.mts +12 -0
  68. package/dist/iter-fest.iteratorFrom.d.ts +12 -0
  69. package/dist/iter-fest.iteratorFrom.js +44 -0
  70. package/dist/iter-fest.iteratorFrom.js.map +1 -0
  71. package/dist/iter-fest.iteratorFrom.mjs +7 -0
  72. package/dist/iter-fest.iteratorMap.d.mts +10 -0
  73. package/dist/iter-fest.iteratorMap.d.ts +10 -0
  74. package/dist/iter-fest.iteratorMap.js +44 -0
  75. package/dist/iter-fest.iteratorMap.js.map +1 -0
  76. package/dist/iter-fest.iteratorMap.mjs +7 -0
  77. package/dist/{iter-fest.iterableReduce.d.mts → iter-fest.iteratorReduce.d.mts} +13 -9
  78. package/dist/{iter-fest.iterableReduce.d.ts → iter-fest.iteratorReduce.d.ts} +13 -9
  79. package/dist/iter-fest.iteratorReduce.js +44 -0
  80. package/dist/iter-fest.iteratorReduce.js.map +1 -0
  81. package/dist/iter-fest.iteratorReduce.mjs +7 -0
  82. package/dist/iter-fest.iteratorReduce.mjs.map +1 -0
  83. package/dist/iter-fest.iteratorSome.d.mts +10 -0
  84. package/dist/iter-fest.iteratorSome.d.ts +10 -0
  85. package/dist/iter-fest.iteratorSome.js +44 -0
  86. package/dist/iter-fest.iteratorSome.js.map +1 -0
  87. package/dist/iter-fest.iteratorSome.mjs +7 -0
  88. package/dist/iter-fest.iteratorSome.mjs.map +1 -0
  89. package/dist/iter-fest.iteratorTake.d.mts +12 -0
  90. package/dist/iter-fest.iteratorTake.d.ts +12 -0
  91. package/dist/iter-fest.iteratorTake.js +44 -0
  92. package/dist/iter-fest.iteratorTake.js.map +1 -0
  93. package/dist/iter-fest.iteratorTake.mjs +7 -0
  94. package/dist/iter-fest.iteratorTake.mjs.map +1 -0
  95. package/dist/iter-fest.iteratorToArray.d.mts +13 -0
  96. package/dist/iter-fest.iteratorToArray.d.ts +13 -0
  97. package/dist/iter-fest.iteratorToArray.js +44 -0
  98. package/dist/iter-fest.iteratorToArray.js.map +1 -0
  99. package/dist/iter-fest.iteratorToArray.mjs +7 -0
  100. package/dist/iter-fest.iteratorToArray.mjs.map +1 -0
  101. package/dist/iter-fest.js +164 -168
  102. package/dist/iter-fest.js.map +1 -1
  103. package/dist/iter-fest.mjs +72 -52
  104. package/dist/iter-fest.readableStreamFrom.d.mts +3 -0
  105. package/dist/iter-fest.readableStreamFrom.d.ts +3 -0
  106. package/dist/{iter-fest.iterableGetReadable.js → iter-fest.readableStreamFrom.js} +9 -9
  107. package/dist/iter-fest.readableStreamFrom.js.map +1 -0
  108. package/dist/iter-fest.readableStreamFrom.mjs +7 -0
  109. package/dist/iter-fest.readableStreamFrom.mjs.map +1 -0
  110. package/package.json +137 -87
  111. package/dist/chunk-5CRMPYKD.mjs +0 -19
  112. package/dist/chunk-5CRMPYKD.mjs.map +0 -1
  113. package/dist/chunk-6C3P4TNK.mjs +0 -19
  114. package/dist/chunk-6C3P4TNK.mjs.map +0 -1
  115. package/dist/chunk-EZC33HE6.mjs +0 -15
  116. package/dist/chunk-EZC33HE6.mjs.map +0 -1
  117. package/dist/chunk-JU353VSE.mjs +0 -16
  118. package/dist/chunk-JU353VSE.mjs.map +0 -1
  119. package/dist/chunk-MNLOWKTC.mjs +0 -19
  120. package/dist/chunk-MNLOWKTC.mjs.map +0 -1
  121. package/dist/chunk-MOBXUTO5.mjs.map +0 -1
  122. package/dist/chunk-O5SQJUKB.mjs +0 -37
  123. package/dist/chunk-O5SQJUKB.mjs.map +0 -1
  124. package/dist/chunk-XW34KZRY.mjs +0 -17
  125. package/dist/chunk-XW34KZRY.mjs.map +0 -1
  126. package/dist/chunk-ZUBHGSCW.mjs +0 -18
  127. package/dist/chunk-ZUBHGSCW.mjs.map +0 -1
  128. package/dist/iter-fest.iterableEvery.d.mts +0 -24
  129. package/dist/iter-fest.iterableEvery.d.ts +0 -24
  130. package/dist/iter-fest.iterableEvery.js +0 -43
  131. package/dist/iter-fest.iterableEvery.js.map +0 -1
  132. package/dist/iter-fest.iterableEvery.mjs +0 -7
  133. package/dist/iter-fest.iterableFilter.d.mts +0 -16
  134. package/dist/iter-fest.iterableFilter.d.ts +0 -16
  135. package/dist/iter-fest.iterableFilter.js +0 -42
  136. package/dist/iter-fest.iterableFilter.js.map +0 -1
  137. package/dist/iter-fest.iterableFilter.mjs +0 -7
  138. package/dist/iter-fest.iterableFind.d.mts +0 -15
  139. package/dist/iter-fest.iterableFind.d.ts +0 -15
  140. package/dist/iter-fest.iterableFind.js +0 -43
  141. package/dist/iter-fest.iterableFind.js.map +0 -1
  142. package/dist/iter-fest.iterableFind.mjs +0 -7
  143. package/dist/iter-fest.iterableForEach.d.mts +0 -10
  144. package/dist/iter-fest.iterableForEach.d.ts +0 -10
  145. package/dist/iter-fest.iterableForEach.js +0 -40
  146. package/dist/iter-fest.iterableForEach.js.map +0 -1
  147. package/dist/iter-fest.iterableForEach.mjs +0 -7
  148. package/dist/iter-fest.iterableGetReadable.d.mts +0 -3
  149. package/dist/iter-fest.iterableGetReadable.d.ts +0 -3
  150. package/dist/iter-fest.iterableGetReadable.js.map +0 -1
  151. package/dist/iter-fest.iterableGetReadable.mjs +0 -7
  152. package/dist/iter-fest.iterableMap.d.mts +0 -8
  153. package/dist/iter-fest.iterableMap.d.ts +0 -8
  154. package/dist/iter-fest.iterableMap.js +0 -39
  155. package/dist/iter-fest.iterableMap.js.map +0 -1
  156. package/dist/iter-fest.iterableMap.mjs +0 -7
  157. package/dist/iter-fest.iterableReduce.js +0 -41
  158. package/dist/iter-fest.iterableReduce.js.map +0 -1
  159. package/dist/iter-fest.iterableReduce.mjs +0 -7
  160. package/dist/iter-fest.iterableSome.d.mts +0 -12
  161. package/dist/iter-fest.iterableSome.d.ts +0 -12
  162. package/dist/iter-fest.iterableSome.js +0 -43
  163. package/dist/iter-fest.iterableSome.js.map +0 -1
  164. package/dist/iter-fest.iterableSome.mjs +0 -7
  165. package/dist/iter-fest.pushAsyncIterableIterator.d.mts +0 -9
  166. package/dist/iter-fest.pushAsyncIterableIterator.d.ts +0 -9
  167. package/dist/iter-fest.pushAsyncIterableIterator.js.map +0 -1
  168. package/dist/iter-fest.pushAsyncIterableIterator.mjs +0 -7
  169. /package/dist/{iter-fest.iterableEvery.mjs.map → iter-fest.iterableWritableStream.mjs.map} +0 -0
  170. /package/dist/{iter-fest.iterableFilter.mjs.map → iter-fest.iteratorDrop.mjs.map} +0 -0
  171. /package/dist/{iter-fest.iterableFind.mjs.map → iter-fest.iteratorEvery.mjs.map} +0 -0
  172. /package/dist/{iter-fest.iterableForEach.mjs.map → iter-fest.iteratorFilter.mjs.map} +0 -0
  173. /package/dist/{iter-fest.iterableGetReadable.mjs.map → iter-fest.iteratorFind.mjs.map} +0 -0
  174. /package/dist/{iter-fest.iterableMap.mjs.map → iter-fest.iteratorFlatMap.mjs.map} +0 -0
  175. /package/dist/{iter-fest.iterableReduce.mjs.map → iter-fest.iteratorForEach.mjs.map} +0 -0
  176. /package/dist/{iter-fest.iterableSome.mjs.map → iter-fest.iteratorFrom.mjs.map} +0 -0
  177. /package/dist/{iter-fest.pushAsyncIterableIterator.mjs.map → iter-fest.iteratorMap.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,8 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ IterableWritableStream: () => IterableWritableStream,
33
34
  Observable: () => Observable,
34
- PushAsyncIterableIterator: () => PushAsyncIterableIterator,
35
35
  SymbolObservable: () => SymbolObservable,
36
36
  asyncGeneratorWithLastValue: () => asyncGeneratorWithLastValue,
37
37
  asyncIteratorToAsyncIterable: () => asyncIteratorToAsyncIterable,
@@ -39,27 +39,32 @@ __export(src_exports, {
39
39
  iterableAt: () => iterableAt,
40
40
  iterableConcat: () => iterableConcat,
41
41
  iterableEntries: () => iterableEntries,
42
- iterableEvery: () => iterableEvery,
43
- iterableFilter: () => iterableFilter,
44
- iterableFind: () => iterableFind,
45
42
  iterableFindIndex: () => iterableFindIndex,
46
43
  iterableFindLast: () => iterableFindLast,
47
44
  iterableFindLastIndex: () => iterableFindLastIndex,
48
- iterableForEach: () => iterableForEach,
49
- iterableGetReadable: () => iterableGetReadable,
50
45
  iterableIncludes: () => iterableIncludes,
51
46
  iterableIndexOf: () => iterableIndexOf,
52
47
  iterableJoin: () => iterableJoin,
53
48
  iterableKeys: () => iterableKeys,
54
- iterableMap: () => iterableMap,
55
- iterableReduce: () => iterableReduce,
56
49
  iterableSlice: () => iterableSlice,
57
- iterableSome: () => iterableSome,
58
50
  iterableToSpliced: () => iterableToSpliced,
59
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,
60
64
  iteratorToIterable: () => iteratorToIterable,
61
65
  observableFromAsync: () => observableFromAsync,
62
66
  observableSubscribeAsReadable: () => observableSubscribeAsReadable,
67
+ readableStreamFrom: () => readableStreamFrom,
63
68
  readerValues: () => readerValues
64
69
  });
65
70
  module.exports = __toCommonJS(src_exports);
@@ -92,39 +97,6 @@ var Observable = class extends import_observable2.default {
92
97
  }
93
98
  };
94
99
 
95
- // src/private/withResolvers.ts
96
- var import_with_resolvers = __toESM(require("core-js-pure/full/promise/with-resolvers"));
97
- function withResolvers() {
98
- return (0, import_with_resolvers.default)();
99
- }
100
-
101
- // src/PushAsyncIterableIterator.ts
102
- var CLOSE = Symbol("close");
103
- var PushAsyncIterableIterator = class {
104
- #closed = false;
105
- #pushResolvers = withResolvers();
106
- [Symbol.asyncIterator]() {
107
- return this;
108
- }
109
- close() {
110
- this.#closed = true;
111
- this.#pushResolvers.resolve(CLOSE);
112
- }
113
- async next() {
114
- const value = await this.#pushResolvers.promise;
115
- if (value === CLOSE) {
116
- return { done: true, value: void 0 };
117
- }
118
- return { done: false, value };
119
- }
120
- push(value) {
121
- if (!this.#closed) {
122
- this.#pushResolvers.resolve(value);
123
- this.#pushResolvers = withResolvers();
124
- }
125
- }
126
- };
127
-
128
100
  // src/asyncGeneratorWithLastValue.ts
129
101
  var STILL_ITERATING = Symbol();
130
102
  function asyncGeneratorWithLastValue(generator) {
@@ -244,50 +216,6 @@ function* iterableEntries(iterable) {
244
216
  }
245
217
  }
246
218
 
247
- // src/iterableEvery.ts
248
- function iterableEvery(iterable, predicate, thisArg = void 0) {
249
- let index = 0;
250
- if (typeof predicate !== "function") {
251
- throw new TypeError(`${predicate} is not a function`);
252
- }
253
- const boundPredicate = predicate.bind(thisArg);
254
- for (const value of iterable) {
255
- if (!boundPredicate(value, index++, iterable)) {
256
- return false;
257
- }
258
- }
259
- return true;
260
- }
261
-
262
- // src/iterableFilter.ts
263
- function* iterableFilter(iterable, predicate, thisArg) {
264
- let index = 0;
265
- if (typeof predicate !== "function") {
266
- throw new TypeError(`${predicate} is not a function`);
267
- }
268
- const boundPredicate = predicate.bind(thisArg);
269
- for (const value of iterable) {
270
- if (boundPredicate(value, index++, iterable)) {
271
- yield value;
272
- }
273
- }
274
- }
275
-
276
- // src/iterableFind.ts
277
- function iterableFind(iterable, predicate, thisArg) {
278
- let index = 0;
279
- if (typeof predicate !== "function") {
280
- throw new TypeError(`${predicate} is not a function`);
281
- }
282
- const boundPredicate = predicate.bind(thisArg);
283
- for (const value of iterable) {
284
- if (boundPredicate(value, index++, iterable)) {
285
- return value;
286
- }
287
- }
288
- return void 0;
289
- }
290
-
291
219
  // src/iterableFindIndex.ts
292
220
  function iterableFindIndex(iterable, predicate, thisArg) {
293
221
  let index = 0;
@@ -337,36 +265,6 @@ function iterableFindLastIndex(iterable, predicate, thisArg) {
337
265
  return lastIndex;
338
266
  }
339
267
 
340
- // src/iterableForEach.ts
341
- function iterableForEach(iterable, callbackfn, thisArg) {
342
- let index = 0;
343
- if (typeof callbackfn !== "function") {
344
- throw new TypeError(`${callbackfn} is not a function`);
345
- }
346
- const boundCallbackfn = callbackfn.bind(thisArg);
347
- for (const value of iterable) {
348
- boundCallbackfn(value, index++, iterable);
349
- }
350
- }
351
-
352
- // src/iterableGetReadable.ts
353
- function isIterable(iterable) {
354
- return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
355
- }
356
- function iterableGetReadable(iterable) {
357
- const iterator = isIterable(iterable) ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
358
- return new ReadableStream({
359
- async pull(controller) {
360
- const result = await iterator.next();
361
- if (result.done) {
362
- controller.close();
363
- } else {
364
- controller.enqueue(result.value);
365
- }
366
- }
367
- });
368
- }
369
-
370
268
  // src/iterableIncludes.ts
371
269
  function iterableIncludes(iterable, searchElement, fromIndex = 0) {
372
270
  let index = 0;
@@ -428,30 +326,6 @@ function* iterableKeys(iterable) {
428
326
  }
429
327
  }
430
328
 
431
- // src/iterableMap.ts
432
- function* iterableMap(iterable, callbackfn, thisArg) {
433
- let index = 0;
434
- if (typeof callbackfn !== "function") {
435
- throw new TypeError(`${callbackfn} is not a function`);
436
- }
437
- for (const value of iterable) {
438
- yield callbackfn.call(thisArg, value, index++, iterable);
439
- }
440
- }
441
-
442
- // src/iterableReduce.ts
443
- function iterableReduce(iterable, callbackfn, initialValue) {
444
- let index = 0;
445
- let previousValue = initialValue;
446
- if (typeof callbackfn !== "function") {
447
- throw new TypeError(`${callbackfn} is not a function`);
448
- }
449
- for (const currentValue of iterable) {
450
- previousValue = callbackfn(previousValue, currentValue, index++, iterable);
451
- }
452
- return previousValue;
453
- }
454
-
455
329
  // src/iterableSlice.ts
456
330
  function* iterableSlice(iterable, start = 0, end = Infinity) {
457
331
  let index = 0;
@@ -479,21 +353,6 @@ function* iterableSlice(iterable, start = 0, end = Infinity) {
479
353
  }
480
354
  }
481
355
 
482
- // src/iterableSome.ts
483
- function iterableSome(iterable, predicate, thisArg = void 0) {
484
- let index = 0;
485
- if (typeof predicate !== "function") {
486
- throw new TypeError(`${predicate} is not a function`);
487
- }
488
- const boundPredicate = predicate.bind(thisArg);
489
- for (const value of iterable) {
490
- if (boundPredicate(value, index++, iterable)) {
491
- return true;
492
- }
493
- }
494
- return false;
495
- }
496
-
497
356
  // src/iterableToSpliced.ts
498
357
  function* iterableToSpliced(iterable, start = 0, deleteCount = 0, ...items) {
499
358
  let index = 0;
@@ -523,6 +382,120 @@ function iterableToString(iterable) {
523
382
  return iterableJoin(iterable);
524
383
  }
525
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
+
526
499
  // src/iteratorToIterable.ts
527
500
  function iteratorToIterable(iterator) {
528
501
  const iterableIterator = {
@@ -580,6 +553,24 @@ function observableSubscribeAsReadable(observable) {
580
553
  });
581
554
  }
582
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
+
583
574
  // src/readerValues.ts
584
575
  function readerValues(reader) {
585
576
  const iterable = {
@@ -602,8 +593,8 @@ function readerValues(reader) {
602
593
  }
603
594
  // Annotate the CommonJS export names for ESM import in node:
604
595
  0 && (module.exports = {
596
+ IterableWritableStream,
605
597
  Observable,
606
- PushAsyncIterableIterator,
607
598
  SymbolObservable,
608
599
  asyncGeneratorWithLastValue,
609
600
  asyncIteratorToAsyncIterable,
@@ -611,27 +602,32 @@ function readerValues(reader) {
611
602
  iterableAt,
612
603
  iterableConcat,
613
604
  iterableEntries,
614
- iterableEvery,
615
- iterableFilter,
616
- iterableFind,
617
605
  iterableFindIndex,
618
606
  iterableFindLast,
619
607
  iterableFindLastIndex,
620
- iterableForEach,
621
- iterableGetReadable,
622
608
  iterableIncludes,
623
609
  iterableIndexOf,
624
610
  iterableJoin,
625
611
  iterableKeys,
626
- iterableMap,
627
- iterableReduce,
628
612
  iterableSlice,
629
- iterableSome,
630
613
  iterableToSpliced,
631
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,
632
627
  iteratorToIterable,
633
628
  observableFromAsync,
634
629
  observableSubscribeAsReadable,
630
+ readableStreamFrom,
635
631
  readerValues
636
632
  });
637
633
  //# sourceMappingURL=iter-fest.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/Observable.ts","../src/SymbolObservable.ts","../src/private/withResolvers.ts","../src/PushAsyncIterableIterator.ts","../src/asyncGeneratorWithLastValue.ts","../src/asyncIteratorToAsyncIterable.ts","../src/generatorWithLastValue.ts","../src/private/toIntegerOrInfinity.ts","../src/iterableAt.ts","../src/iterableConcat.ts","../src/iterableEntries.ts","../src/iterableEvery.ts","../src/iterableFilter.ts","../src/iterableFind.ts","../src/iterableFindIndex.ts","../src/iterableFindLast.ts","../src/iterableFindLastIndex.ts","../src/iterableForEach.ts","../src/iterableGetReadable.ts","../src/iterableIncludes.ts","../src/iterableIndexOf.ts","../src/iterableJoin.ts","../src/iterableKeys.ts","../src/iterableMap.ts","../src/iterableReduce.ts","../src/iterableSlice.ts","../src/iterableSome.ts","../src/iterableToSpliced.ts","../src/iterableToString.ts","../src/iteratorToIterable.ts","../src/observableFromAsync.ts","../src/observableSubscribeAsReadable.ts","../src/readerValues.ts"],"sourcesContent":["export * from './Observable';\nexport * from './PushAsyncIterableIterator';\nexport * from './SymbolObservable';\nexport * from './asyncGeneratorWithLastValue';\nexport * from './asyncIteratorToAsyncIterable';\nexport * from './generatorWithLastValue';\nexport * from './iterableAt';\nexport * from './iterableConcat';\nexport * from './iterableEntries';\nexport * from './iterableEvery';\nexport * from './iterableFilter';\nexport * from './iterableFind';\nexport * from './iterableFindIndex';\nexport * from './iterableFindLast';\nexport * from './iterableFindLastIndex';\nexport * from './iterableForEach';\nexport * from './iterableGetReadable';\nexport * from './iterableIncludes';\nexport * from './iterableIndexOf';\nexport * from './iterableJoin';\nexport * from './iterableKeys';\nexport * from './iterableMap';\nexport * from './iterableReduce';\nexport * from './iterableSlice';\nexport * from './iterableSome';\nexport * from './iterableToSpliced';\nexport * from './iterableToString';\nexport * from './iteratorToIterable';\nexport * from './observableFromAsync';\nexport * from './observableSubscribeAsReadable';\nexport * from './readerValues';\n","// @ts-expect-error core-js is not typed.\nimport CoreJSObservable from 'core-js-pure/full/observable';\n\nimport { SymbolObservable } from './SymbolObservable';\n\nexport interface SubscriptionObserver<T> {\n /** Sends the next value in the sequence */\n next(value: T): void;\n\n /** Sends the sequence error */\n error(errorValue: unknown): void;\n\n /** Sends the completion notification */\n complete(): void;\n\n /** A boolean value indicating whether the subscription is closed */\n get closed(): boolean;\n}\n\nexport interface Subscription {\n /** Cancels the subscription */\n unsubscribe(): void;\n\n /** A boolean value indicating whether the subscription is closed */\n get closed(): boolean;\n}\n\nexport type SubscriberFunction<T> = (observer: SubscriptionObserver<T>) => (() => void) | Subscription | void;\n\nexport type CompleteFunction = () => void;\nexport type ErrorFunction = (errorValue: unknown) => void;\nexport type NextFunction<T> = (value: T) => void;\nexport type StartFunction = (subscription: Subscription) => void;\n\nexport interface Observer<T> {\n /** Receives a completion notification */\n complete?(): void;\n\n /** Receives the sequence error */\n error?(errorValue: unknown): void;\n\n /** Receives the next value in the sequence */\n next?(value: T): void;\n\n /** Receives the subscription object when `subscribe` is called */\n start?(subscription: Subscription): void;\n}\n\nexport class Observable<T> extends CoreJSObservable {\n constructor(subscriber: SubscriberFunction<T>) {\n super(subscriber);\n }\n\n /** Subscribes to the sequence with an observer */\n subscribe(observer: Observer<T>): Subscription;\n\n /** Subscribes to the sequence with callbacks */\n subscribe(\n onNext: NextFunction<T>,\n onError?: ErrorFunction | undefined,\n onComplete?: CompleteFunction | undefined\n ): Subscription;\n\n subscribe(\n observerOrOnNext: Observer<T> | NextFunction<T>,\n onError?: ErrorFunction | undefined,\n onComplete?: CompleteFunction | undefined\n ): Subscription {\n return super.subscribe(observerOrOnNext, onError, onComplete);\n }\n\n /** Returns itself */\n [SymbolObservable](): Observable<T> {\n return this;\n }\n\n /** Converts items to an Observable */\n static of<T>(...items: T[]): Observable<T> {\n return CoreJSObservable.of(...items);\n }\n\n /** Converts an iterable to an Observable */\n static from<T>(iterable: Iterable<T>): Observable<T>;\n\n /** Converts an observable to an Observable */\n static from<T>(observable: Observable<T>): Observable<T>;\n\n static from<T>(iterableOrObservable: Iterable<T> | Observable<T>): Observable<T> {\n return CoreJSObservable.from(iterableOrObservable);\n }\n}\n","// @ts-expect-error core-js is not typed.\nimport CoreJSSymbolObservable from 'core-js-pure/features/symbol/observable';\n\nconst SymbolObservable: unique symbol = CoreJSSymbolObservable;\n\nexport { SymbolObservable };\n","// @ts-expect-error \"core-js\" is not typed.\nimport coreJSPromiseWithResolvers from 'core-js-pure/full/promise/with-resolvers';\n\nexport default function withResolvers<T>(): PromiseWithResolvers<T> {\n return coreJSPromiseWithResolvers();\n}\n","import withResolvers from './private/withResolvers';\n\nconst CLOSE = Symbol('close');\n\nexport class PushAsyncIterableIterator<T> implements AsyncIterableIterator<T> {\n #closed: boolean = false;\n #pushResolvers: PromiseWithResolvers<T | typeof CLOSE> = withResolvers();\n\n [Symbol.asyncIterator]() {\n return this;\n }\n\n close() {\n this.#closed = true;\n this.#pushResolvers.resolve(CLOSE);\n }\n\n async next(): Promise<IteratorResult<T>> {\n const value = await this.#pushResolvers.promise;\n\n if (value === CLOSE) {\n return { done: true, value: undefined };\n }\n\n return { done: false, value };\n }\n\n push(value: T) {\n if (!this.#closed) {\n this.#pushResolvers.resolve(value);\n this.#pushResolvers = withResolvers();\n }\n }\n}\n","const STILL_ITERATING = Symbol();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AsyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = AsyncGenerator<\n T,\n TReturn,\n TNext\n> & {\n lastValue(): TReturn;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function asyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(\n generator: AsyncGenerator<T, TReturn, TNext>\n): AsyncGeneratorWithLastValue<T, TReturn, TNext> {\n let lastValue: typeof STILL_ITERATING | TReturn = STILL_ITERATING;\n\n const asyncGeneratorWithLastValue = {\n [Symbol.asyncIterator]() {\n return asyncGeneratorWithLastValue;\n },\n lastValue(): TReturn {\n if (lastValue === STILL_ITERATING) {\n throw new Error('Iteration has not complete yet, cannot get last value.');\n }\n\n return lastValue;\n },\n async next(next: TNext) {\n const result = await generator.next(next);\n\n if (result.done) {\n lastValue = result.value;\n }\n\n return result;\n },\n return(value: TReturn) {\n return generator.return(value);\n },\n throw(error: unknown) {\n return generator.throw(error);\n }\n };\n\n return asyncGeneratorWithLastValue;\n}\n","export function asyncIteratorToAsyncIterable<T>(asyncIterator: AsyncIterator<T>): AsyncIterableIterator<T> {\n const asyncIterableIterator: AsyncIterableIterator<T> = {\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n next: asyncIterator.next.bind(asyncIterator),\n ...(asyncIterator.return ? { return: asyncIterator.return.bind(asyncIterator) } : {}),\n ...(asyncIterator.throw ? { throw: asyncIterator.throw.bind(asyncIterator) } : {})\n };\n\n return asyncIterableIterator;\n}\n","const STILL_ITERATING = Symbol();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type GeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = Generator<T, TReturn, TNext> & {\n lastValue(): TReturn;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function generatorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(\n generator: Generator<T, TReturn, TNext>\n): GeneratorWithLastValue<T, TReturn, TNext> {\n let lastValue: typeof STILL_ITERATING | TReturn = STILL_ITERATING;\n\n const generatorWithLastValue = {\n [Symbol.iterator]() {\n return generatorWithLastValue;\n },\n lastValue(): TReturn {\n if (lastValue === STILL_ITERATING) {\n throw new Error('Iteration has not complete yet, cannot get last value.');\n }\n\n return lastValue;\n },\n next(next: TNext) {\n const result = generator.next(next);\n\n if (result.done) {\n lastValue = result.value;\n }\n\n return result;\n },\n return(value: TReturn) {\n return generator.return(value);\n },\n throw(error: unknown) {\n return generator.throw(error);\n }\n };\n\n return generatorWithLastValue;\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","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns the item located at the specified index.\n *\n * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.\n */\nexport function iterableAt<T>(iterable: Iterable<T>, index: number): T | undefined {\n let currentIndex = 0;\n\n index = toIntegerOrInfinity(index);\n\n if (!isFinite(index)) {\n return;\n }\n\n if (index < 0) {\n throw new TypeError('index cannot be a negative finite number');\n }\n\n for (const value of iterable) {\n if (currentIndex++ === index) {\n return value;\n }\n }\n\n return undefined;\n}\n","/**\n * Combines two or more iterables.\n * This method returns a new iterable without modifying any existing iterables.\n *\n * @param items Additional iterables and/or items to add to the end of the iterable.\n */\nexport function iterableConcat<T>(iterable: Iterable<T>, ...items: Iterable<T>[]): IterableIterator<T>;\n\n/**\n * Combines two or more iterables.\n * This method returns a new iterable without modifying any existing iterables.\n *\n * @param items Additional iterables and/or items to add to the end of the iterable.\n */\nexport function iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T>;\n\nexport function* iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T> {\n yield* iterable;\n\n for (const item of items) {\n if (item && typeof item === 'object' && Symbol.iterator in item) {\n yield* item;\n } else {\n yield item;\n }\n }\n}\n","/**\n * Returns an iterable of key, value pairs for every entry in the iterable\n */\nexport function* iterableEntries<T>(iterable: Iterable<T>): IterableIterator<[number, T]> {\n let index = 0;\n\n for (const value of iterable) {\n yield [index++, value];\n }\n}\n","/**\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","/**\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","/**\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","/**\n * Returns the index of the first element in the iterable where predicate is true, and -1\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,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\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 iterableFindIndex<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): number {\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 index;\n }\n\n index++;\n }\n\n return -1;\n}\n","/**\n * Returns the value of the last element in the iterable where predicate is true, and undefined\n * otherwise.\n *\n * @param predicate findLast calls predicate once for each element of the iterable, in descending\n * order, until it finds one where predicate returns true. If such an element is found, findLast\n * immediately returns that element value. Otherwise, findLast 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 iterableFindLast<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): S | undefined;\n\nexport function iterableFindLast<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): T | undefined;\n\nexport function iterableFindLast<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?: any\n): S | undefined {\n let index = 0;\n let last: S | undefined;\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 last = value as S;\n }\n }\n\n return last;\n}\n","/**\n * Returns the index of the last element in the iterable where predicate is true, and -1\n * otherwise.\n *\n * @param predicate findLastIndex calls predicate once for each element of the iterable, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\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 iterableFindLastIndex<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): number {\n let index = 0;\n let lastIndex: number = -1;\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 lastIndex = index;\n }\n\n index++;\n }\n\n return lastIndex;\n}\n","/**\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","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","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Determines whether an iterable includes a certain element, returning true or false as appropriate.\n *\n * @param searchElement The element to search for.\n * @param fromIndex The position in this iterable at which to begin searching for searchElement.\n */\nexport function iterableIncludes<T>(iterable: Iterable<T>, searchElement: T, fromIndex: number = 0): boolean {\n let index = 0;\n\n fromIndex = toIntegerOrInfinity(fromIndex);\n\n if (fromIndex !== Infinity) {\n fromIndex = fromIndex === -Infinity ? 0 : fromIndex;\n\n if (fromIndex < 0) {\n // TODO: Support negative fromIndex.\n throw new TypeError('fromIndex cannot be a negative finite number');\n }\n\n for (const item of iterable) {\n if (index++ >= fromIndex && Object.is(item, searchElement)) {\n return true;\n }\n }\n }\n\n return false;\n}\n","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns the index of the first occurrence of a value in an iterable, or -1 if it is not present.\n *\n * @param searchElement The value to locate in the iterable.\n * @param fromIndex The iterable index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\nexport function iterableIndexOf<T>(iterable: Iterable<T>, searchElement: T, fromIndex: number = 0): number {\n let index = 0;\n\n fromIndex = toIntegerOrInfinity(fromIndex);\n\n if (fromIndex !== Infinity) {\n fromIndex = fromIndex === -Infinity ? 0 : fromIndex;\n\n if (fromIndex < 0) {\n // TODO: Support negative fromIndex.\n throw new TypeError('fromIndex cannot be a negative finite number');\n }\n\n for (const item of iterable) {\n if (index >= fromIndex && Object.is(item, searchElement)) {\n return index;\n }\n\n index++;\n }\n }\n\n return -1;\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","/**\n * Returns an iterable of keys in the iterable\n */\nexport function* iterableKeys<T>(iterable: Iterable<T>): IterableIterator<number> {\n let index = 0;\n\n for (const _ of iterable) {\n yield index++;\n }\n}\n","/**\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","/**\n * Calls the specified callback function for all the elements in an iterable. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n *\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterable.\n *\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an iterable value.\n */\nexport function iterableReduce<T>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T\n): T;\n\nexport function iterableReduce<T>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable<T>) => T,\n initialValue: T\n): T;\n\n/**\n * Calls the specified callback function for all the elements in an iterable. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n *\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterable.\n *\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n\nexport function iterableReduce<T, U>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: U, currentValue: T, currentIndex: number, iterable: Iterable<T>) => U,\n initialValue: U\n): U;\n\nexport function iterableReduce<T, U = undefined>(\n iterable: Iterable<T>,\n callbackfn: (previousValue: U | undefined, currentValue: T, currentIndex: number, iterable: Iterable<T>) => U,\n initialValue?: U\n): U | undefined {\n let index = 0;\n let previousValue: U | undefined = initialValue;\n\n if (typeof callbackfn !== 'function') {\n throw new TypeError(`${callbackfn} is not a function`);\n }\n\n for (const currentValue of iterable) {\n previousValue = callbackfn(previousValue, currentValue, index++, iterable);\n }\n\n return previousValue;\n}\n","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns a copy of a section of an iterable.\n * For both start and end, a negative index can be used to indicate an offset from the end of the iterable.\n * For example, -2 refers to the second to last element of the iterable.\n *\n * @param start The beginning index of the specified portion of the iterable.\n * If start is undefined, then the slice begins at index 0.\n *\n * @param end The end index of the specified portion of the iterable. This is exclusive of the element at the index 'end'.\n * If end is undefined, then the slice extends to the end of the iterable.\n */\nexport function* iterableSlice<T>(iterable: Iterable<T>, start: number = 0, end: number = Infinity): Iterable<T> {\n let index = 0;\n\n start = toIntegerOrInfinity(start);\n start = start === -Infinity ? 0 : start;\n end = toIntegerOrInfinity(end);\n end = end === -Infinity ? 0 : end;\n\n if (start < 0) {\n throw new TypeError('start cannot be a negative finite number');\n }\n\n if (end < 0) {\n throw new TypeError('end cannot be a negative finite number');\n }\n\n if (start === Infinity) {\n return;\n }\n\n for (const item of iterable) {\n if (index >= start && index < end) {\n yield item;\n }\n\n index++;\n\n if (index > end) {\n break;\n }\n }\n}\n","/**\n * Determines whether the specified callback function returns true for any element of an iterable.\n *\n * @param predicate\n * A function that accepts up to three arguments. The some method calls the predicate function for each element in the iterable until the predicate returns a value which is coercible to the Boolean value true, or until the end of the iterable.\n *\n * @param thisArg\n * An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableSome<T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg: any = undefined\n): boolean {\n let index = 0;\n\n if (typeof predicate !== 'function') {\n throw new TypeError(`${predicate} is not a function`);\n }\n\n const boundPredicate = predicate.bind(thisArg);\n\n for (const value of iterable) {\n if (boundPredicate(value, index++, iterable)) {\n return true;\n }\n }\n\n return false;\n}\n","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","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","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","import { Observable } from './Observable';\n\nexport function observableFromAsync<T>(iterable: AsyncIterable<T>): Observable<T> {\n return new Observable(subscriber => {\n let closed = false;\n\n (async function () {\n try {\n for await (const value of iterable) {\n if (closed) {\n break;\n }\n\n subscriber.next(value);\n }\n\n subscriber.complete();\n } catch (error) {\n subscriber.error(error);\n }\n })();\n\n return () => {\n closed = true;\n };\n });\n}\n","import type { Observable, Subscription } from './Observable';\n\nexport function observableSubscribeAsReadable<T>(observable: Observable<T>): ReadableStream<T> {\n let subscription: Subscription;\n\n return new ReadableStream<T>({\n cancel() {\n subscription.unsubscribe();\n },\n start(controller) {\n subscription = observable.subscribe({\n complete() {\n controller.close();\n },\n error(err: unknown) {\n controller.error(err);\n },\n next(value) {\n controller.enqueue(value);\n }\n });\n }\n });\n}\n","export function readerValues<T>(reader: ReadableStreamDefaultReader<T>): AsyncIterableIterator<T> {\n const iterable: AsyncIterableIterator<T> = {\n [Symbol.asyncIterator]() {\n return iterable;\n },\n async next(): Promise<IteratorResult<T>> {\n const result = await Promise.race([reader.read(), reader.closed]);\n\n if (!result || result.done) {\n return { done: true, value: undefined };\n }\n\n return { value: result.value };\n },\n async return() {\n // Throw inside for-loop is return().\n reader.cancel();\n\n return { done: true, value: undefined };\n }\n };\n\n return iterable;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,qBAA6B;;;ACA7B,wBAAmC;AAEnC,IAAM,mBAAkC,kBAAAC;;;AD6CjC,IAAM,aAAN,cAA4B,mBAAAC,QAAiB;AAAA,EAClD,YAAY,YAAmC;AAC7C,UAAM,UAAU;AAAA,EACl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BO,SAAS,aAAgB,QAAkE;AAChG,QAAM,WAAqC;AAAA,IACzC,CAAC,OAAO,aAAa,IAAI;AACvB,aAAO;AAAA,IACT;AAAA,IACA,MAAM,OAAmC;AACvC,YAAM,SAAS,MAAM,QAAQ,KAAK,CAAC,OAAO,KAAK,GAAG,OAAO,MAAM,CAAC;AAEhE,UAAI,CAAC,UAAU,OAAO,MAAM;AAC1B,eAAO,EAAE,MAAM,MAAM,OAAO,OAAU;AAAA,MACxC;AAEA,aAAO,EAAE,OAAO,OAAO,MAAM;AAAA,IAC/B;AAAA,IACA,MAAM,SAAS;AAEb,aAAO,OAAO;AAEd,aAAO,EAAE,MAAM,MAAM,OAAO,OAAU;AAAA,IACxC;AAAA,EACF;AAEA,SAAO;AACT;","names":["import_observable","CoreJSSymbolObservable","CoreJSObservable","coreJSPromiseWithResolvers","asyncGeneratorWithLastValue","STILL_ITERATING","generatorWithLastValue"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/Observable.ts","../src/SymbolObservable.ts","../src/asyncGeneratorWithLastValue.ts","../src/asyncIteratorToAsyncIterable.ts","../src/generatorWithLastValue.ts","../src/private/toIntegerOrInfinity.ts","../src/iterableAt.ts","../src/iterableConcat.ts","../src/iterableEntries.ts","../src/iterableFindIndex.ts","../src/iterableFindLast.ts","../src/iterableFindLastIndex.ts","../src/iterableIncludes.ts","../src/iterableIndexOf.ts","../src/iterableJoin.ts","../src/iterableKeys.ts","../src/iterableSlice.ts","../src/iterableToSpliced.ts","../src/iterableToString.ts","../src/private/withResolvers.ts","../src/iterableWritableStream.ts","../src/iteratorDrop.ts","../src/iteratorEvery.ts","../src/iteratorFilter.ts","../src/iteratorFind.ts","../src/iteratorFlatMap.ts","../src/iteratorForEach.ts","../src/iteratorFrom.ts","../src/iteratorMap.ts","../src/iteratorReduce.ts","../src/iteratorSome.ts","../src/iteratorTake.ts","../src/iteratorToArray.ts","../src/iteratorToIterable.ts","../src/observableFromAsync.ts","../src/observableSubscribeAsReadable.ts","../src/readableStreamFrom.ts","../src/readerValues.ts"],"sourcesContent":["export * from './Observable';\nexport * from './SymbolObservable';\nexport * from './asyncGeneratorWithLastValue';\nexport * from './asyncIteratorToAsyncIterable';\nexport * from './generatorWithLastValue';\nexport * from './iterableAt';\nexport * from './iterableConcat';\nexport * from './iterableEntries';\nexport * from './iterableFindIndex';\nexport * from './iterableFindLast';\nexport * from './iterableFindLastIndex';\nexport * from './iterableIncludes';\nexport * from './iterableIndexOf';\nexport * from './iterableJoin';\nexport * from './iterableKeys';\nexport * from './iterableSlice';\nexport * from './iterableToSpliced';\nexport * from './iterableToString';\nexport * from './iterableWritableStream';\nexport * from './iteratorDrop';\nexport * from './iteratorEvery';\nexport * from './iteratorFilter';\nexport * from './iteratorFind';\nexport * from './iteratorFlatMap';\nexport * from './iteratorForEach';\nexport * from './iteratorFrom';\nexport * from './iteratorMap';\nexport * from './iteratorReduce';\nexport * from './iteratorSome';\nexport * from './iteratorTake';\nexport * from './iteratorToArray';\nexport * from './iteratorToIterable';\nexport * from './observableFromAsync';\nexport * from './observableSubscribeAsReadable';\nexport * from './readableStreamFrom';\nexport * from './readerValues';\n","// @ts-expect-error core-js is not typed.\nimport CoreJSObservable from 'core-js-pure/full/observable';\n\nimport { SymbolObservable } from './SymbolObservable';\n\nexport interface SubscriptionObserver<T> {\n /** Sends the next value in the sequence */\n next(value: T): void;\n\n /** Sends the sequence error */\n error(errorValue: unknown): void;\n\n /** Sends the completion notification */\n complete(): void;\n\n /** A boolean value indicating whether the subscription is closed */\n get closed(): boolean;\n}\n\nexport interface Subscription {\n /** Cancels the subscription */\n unsubscribe(): void;\n\n /** A boolean value indicating whether the subscription is closed */\n get closed(): boolean;\n}\n\nexport type SubscriberFunction<T> = (observer: SubscriptionObserver<T>) => (() => void) | Subscription | void;\n\nexport type CompleteFunction = () => void;\nexport type ErrorFunction = (errorValue: unknown) => void;\nexport type NextFunction<T> = (value: T) => void;\nexport type StartFunction = (subscription: Subscription) => void;\n\nexport interface Observer<T> {\n /** Receives a completion notification */\n complete?(): void;\n\n /** Receives the sequence error */\n error?(errorValue: unknown): void;\n\n /** Receives the next value in the sequence */\n next?(value: T): void;\n\n /** Receives the subscription object when `subscribe` is called */\n start?(subscription: Subscription): void;\n}\n\nexport class Observable<T> extends CoreJSObservable {\n constructor(subscriber: SubscriberFunction<T>) {\n super(subscriber);\n }\n\n /** Subscribes to the sequence with an observer */\n subscribe(observer: Observer<T>): Subscription;\n\n /** Subscribes to the sequence with callbacks */\n subscribe(\n onNext: NextFunction<T>,\n onError?: ErrorFunction | undefined,\n onComplete?: CompleteFunction | undefined\n ): Subscription;\n\n subscribe(\n observerOrOnNext: Observer<T> | NextFunction<T>,\n onError?: ErrorFunction | undefined,\n onComplete?: CompleteFunction | undefined\n ): Subscription {\n return super.subscribe(observerOrOnNext, onError, onComplete);\n }\n\n /** Returns itself */\n [SymbolObservable](): Observable<T> {\n return this;\n }\n\n /** Converts items to an Observable */\n static of<T>(...items: T[]): Observable<T> {\n return CoreJSObservable.of(...items);\n }\n\n /** Converts an iterable to an Observable */\n static from<T>(iterable: Iterable<T>): Observable<T>;\n\n /** Converts an observable to an Observable */\n static from<T>(observable: Observable<T>): Observable<T>;\n\n static from<T>(iterableOrObservable: Iterable<T> | Observable<T>): Observable<T> {\n return CoreJSObservable.from(iterableOrObservable);\n }\n}\n","// @ts-expect-error core-js is not typed.\nimport CoreJSSymbolObservable from 'core-js-pure/features/symbol/observable';\n\nconst SymbolObservable: unique symbol = CoreJSSymbolObservable;\n\nexport { SymbolObservable };\n","const STILL_ITERATING = Symbol();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AsyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = AsyncGenerator<\n T,\n TReturn,\n TNext\n> & {\n lastValue(): TReturn;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function asyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(\n generator: AsyncGenerator<T, TReturn, TNext>\n): AsyncGeneratorWithLastValue<T, TReturn, TNext> {\n let lastValue: typeof STILL_ITERATING | TReturn = STILL_ITERATING;\n\n const asyncGeneratorWithLastValue = {\n [Symbol.asyncIterator]() {\n return asyncGeneratorWithLastValue;\n },\n lastValue(): TReturn {\n if (lastValue === STILL_ITERATING) {\n throw new Error('Iteration has not complete yet, cannot get last value.');\n }\n\n return lastValue;\n },\n async next(next: TNext) {\n const result = await generator.next(next);\n\n if (result.done) {\n lastValue = result.value;\n }\n\n return result;\n },\n return(value: TReturn) {\n return generator.return(value);\n },\n throw(error: unknown) {\n return generator.throw(error);\n }\n };\n\n return asyncGeneratorWithLastValue;\n}\n","export function asyncIteratorToAsyncIterable<T>(asyncIterator: AsyncIterator<T>): AsyncIterableIterator<T> {\n const asyncIterableIterator: AsyncIterableIterator<T> = {\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n next: asyncIterator.next.bind(asyncIterator),\n ...(asyncIterator.return ? { return: asyncIterator.return.bind(asyncIterator) } : {}),\n ...(asyncIterator.throw ? { throw: asyncIterator.throw.bind(asyncIterator) } : {})\n };\n\n return asyncIterableIterator;\n}\n","const STILL_ITERATING = Symbol();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type GeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = Generator<T, TReturn, TNext> & {\n lastValue(): TReturn;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function generatorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(\n generator: Generator<T, TReturn, TNext>\n): GeneratorWithLastValue<T, TReturn, TNext> {\n let lastValue: typeof STILL_ITERATING | TReturn = STILL_ITERATING;\n\n const generatorWithLastValue = {\n [Symbol.iterator]() {\n return generatorWithLastValue;\n },\n lastValue(): TReturn {\n if (lastValue === STILL_ITERATING) {\n throw new Error('Iteration has not complete yet, cannot get last value.');\n }\n\n return lastValue;\n },\n next(next: TNext) {\n const result = generator.next(next);\n\n if (result.done) {\n lastValue = result.value;\n }\n\n return result;\n },\n return(value: TReturn) {\n return generator.return(value);\n },\n throw(error: unknown) {\n return generator.throw(error);\n }\n };\n\n return generatorWithLastValue;\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","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns the item located at the specified index.\n *\n * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.\n */\nexport function iterableAt<T>(iterable: Iterable<T>, index: number): T | undefined {\n let currentIndex = 0;\n\n index = toIntegerOrInfinity(index);\n\n if (!isFinite(index)) {\n return;\n }\n\n if (index < 0) {\n throw new TypeError('index cannot be a negative finite number');\n }\n\n for (const value of iterable) {\n if (currentIndex++ === index) {\n return value;\n }\n }\n\n return undefined;\n}\n","/**\n * Combines two or more iterables.\n * This method returns a new iterable without modifying any existing iterables.\n *\n * @param items Additional iterables and/or items to add to the end of the iterable.\n */\nexport function iterableConcat<T>(iterable: Iterable<T>, ...items: Iterable<T>[]): IterableIterator<T>;\n\n/**\n * Combines two or more iterables.\n * This method returns a new iterable without modifying any existing iterables.\n *\n * @param items Additional iterables and/or items to add to the end of the iterable.\n */\nexport function iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T>;\n\nexport function* iterableConcat<T>(iterable: Iterable<T>, ...items: (T | Iterable<T>)[]): IterableIterator<T> {\n yield* iterable;\n\n for (const item of items) {\n if (item && typeof item === 'object' && Symbol.iterator in item) {\n yield* item;\n } else {\n yield item;\n }\n }\n}\n","/**\n * Returns an iterable of key, value pairs for every entry in the iterable\n */\nexport function* iterableEntries<T>(iterable: Iterable<T>): IterableIterator<[number, T]> {\n let index = 0;\n\n for (const value of iterable) {\n yield [index++, value];\n }\n}\n","/**\n * Returns the index of the first element in the iterable where predicate is true, and -1\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,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\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 iterableFindIndex<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): number {\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 index;\n }\n\n index++;\n }\n\n return -1;\n}\n","/**\n * Returns the value of the last element in the iterable where predicate is true, and undefined\n * otherwise.\n *\n * @param predicate findLast calls predicate once for each element of the iterable, in descending\n * order, until it finds one where predicate returns true. If such an element is found, findLast\n * immediately returns that element value. Otherwise, findLast 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 iterableFindLast<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): S | undefined;\n\nexport function iterableFindLast<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): T | undefined;\n\nexport function iterableFindLast<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?: any\n): S | undefined {\n let index = 0;\n let last: S | undefined;\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 last = value as S;\n }\n }\n\n return last;\n}\n","/**\n * Returns the index of the last element in the iterable where predicate is true, and -1\n * otherwise.\n *\n * @param predicate findLastIndex calls predicate once for each element of the iterable, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\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 iterableFindLastIndex<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): number {\n let index = 0;\n let lastIndex: number = -1;\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 lastIndex = index;\n }\n\n index++;\n }\n\n return lastIndex;\n}\n","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Determines whether an iterable includes a certain element, returning true or false as appropriate.\n *\n * @param searchElement The element to search for.\n * @param fromIndex The position in this iterable at which to begin searching for searchElement.\n */\nexport function iterableIncludes<T>(iterable: Iterable<T>, searchElement: T, fromIndex: number = 0): boolean {\n let index = 0;\n\n fromIndex = toIntegerOrInfinity(fromIndex);\n\n if (fromIndex !== Infinity) {\n fromIndex = fromIndex === -Infinity ? 0 : fromIndex;\n\n if (fromIndex < 0) {\n // TODO: Support negative fromIndex.\n throw new TypeError('fromIndex cannot be a negative finite number');\n }\n\n for (const item of iterable) {\n if (index++ >= fromIndex && Object.is(item, searchElement)) {\n return true;\n }\n }\n }\n\n return false;\n}\n","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns the index of the first occurrence of a value in an iterable, or -1 if it is not present.\n *\n * @param searchElement The value to locate in the iterable.\n * @param fromIndex The iterable index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\nexport function iterableIndexOf<T>(iterable: Iterable<T>, searchElement: T, fromIndex: number = 0): number {\n let index = 0;\n\n fromIndex = toIntegerOrInfinity(fromIndex);\n\n if (fromIndex !== Infinity) {\n fromIndex = fromIndex === -Infinity ? 0 : fromIndex;\n\n if (fromIndex < 0) {\n // TODO: Support negative fromIndex.\n throw new TypeError('fromIndex cannot be a negative finite number');\n }\n\n for (const item of iterable) {\n if (index >= fromIndex && Object.is(item, searchElement)) {\n return index;\n }\n\n index++;\n }\n }\n\n return -1;\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","/**\n * Returns an iterable of keys in the iterable\n */\nexport function* iterableKeys<T>(iterable: Iterable<T>): IterableIterator<number> {\n let index = 0;\n\n for (const _ of iterable) {\n yield index++;\n }\n}\n","import toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns a copy of a section of an iterable.\n * For both start and end, a negative index can be used to indicate an offset from the end of the iterable.\n * For example, -2 refers to the second to last element of the iterable.\n *\n * @param start The beginning index of the specified portion of the iterable.\n * If start is undefined, then the slice begins at index 0.\n *\n * @param end The end index of the specified portion of the iterable. This is exclusive of the element at the index 'end'.\n * If end is undefined, then the slice extends to the end of the iterable.\n */\nexport function* iterableSlice<T>(iterable: Iterable<T>, start: number = 0, end: number = Infinity): Iterable<T> {\n let index = 0;\n\n start = toIntegerOrInfinity(start);\n start = start === -Infinity ? 0 : start;\n end = toIntegerOrInfinity(end);\n end = end === -Infinity ? 0 : end;\n\n if (start < 0) {\n throw new TypeError('start cannot be a negative finite number');\n }\n\n if (end < 0) {\n throw new TypeError('end cannot be a negative finite number');\n }\n\n if (start === Infinity) {\n return;\n }\n\n for (const item of iterable) {\n if (index >= start && index < end) {\n yield item;\n }\n\n index++;\n\n if (index > end) {\n break;\n }\n }\n}\n","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","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","// @ts-expect-error \"core-js\" is not typed.\nimport coreJSPromiseWithResolvers from 'core-js-pure/full/promise/with-resolvers';\n\nexport default function withResolvers<T>(): PromiseWithResolvers<T> {\n return coreJSPromiseWithResolvers();\n}\n","import withResolvers from './private/withResolvers';\n\nconst CLOSE = Symbol();\n\nexport class IterableWritableStream<T> extends WritableStream<T> {\n constructor() {\n super({\n close: () => {\n this.#buffer.push(CLOSE);\n this.#writeResolvers.resolve();\n },\n write: (chunk: T) => {\n this.#buffer.push(chunk);\n this.#writeResolvers.resolve();\n this.#writeResolvers = withResolvers();\n }\n });\n }\n\n #buffer: (T | typeof CLOSE)[] = [];\n #writeResolvers: PromiseWithResolvers<void> = withResolvers();\n\n [Symbol.asyncIterator](): AsyncIterator<T> {\n return {\n next: async () => {\n while (!this.#buffer.length) {\n await this.#writeResolvers.promise;\n }\n\n const value = this.#buffer[0] as T | typeof CLOSE;\n\n if (value === CLOSE) {\n return { done: true, value: undefined };\n }\n\n // If it is not CLOSE, remove it from the queue.\n this.#buffer.shift();\n\n // Idle here so concurrent iteration has a chance to pick up the next value in a round robin fashion.\n await undefined;\n\n return { done: false, value };\n }\n };\n }\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport drop from 'core-js-pure/full/iterator/drop';\n\n/**\n * `drop` takes an integer as an argument. It skips the given number of elements produced by the underlying iterator before itself producing any remaining elements.\n *\n * @param limit\n *\n * @return Returns an iterator of items after the limit.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorDrop<T>(iterator: Iterator<T>, limit: number): Iterator<T> {\n return drop(iterator, limit);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport every from 'core-js-pure/full/iterator/every';\n\n/**\n * Determines whether all the members of an iterator 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 iterator until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the iterator.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorEvery<T, S extends T>(\n iterator: Iterator<T>,\n predicate: (value: T, index: number) => value is S\n): iterator is Iterator<S>;\n\n/**\n * Determines whether all the members of an iterator 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 iterator until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the iterator.\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 *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorEvery<T>(iterator: Iterator<T>, predicate: (value: T, index: number) => unknown): boolean;\n\nexport function iteratorEvery<T>(iterator: Iterator<T>, predicate: (value: T, index: number) => unknown): boolean {\n return every(iterator, predicate);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport filter from 'core-js-pure/full/iterator/filter';\n\n/**\n * Returns the elements of an iterator 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 iterator.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorFilter<T, S extends T>(\n iterator: Iterator<T>,\n predicate: (value: T, index: number) => value is S\n): IterableIterator<S>;\n\n/**\n * Returns the elements of an iterator 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 iterator.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorFilter<T>(\n iterator: Iterator<T>,\n predicate: (value: T, index: number) => unknown\n): IterableIterator<T>;\n\nexport function iteratorFilter<T, S extends T>(\n iterator: Iterator<T>,\n predicate: (value: T, index: number) => unknown\n): IterableIterator<S> {\n return filter(iterator, predicate);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport find from 'core-js-pure/full/iterator/find';\n\n/**\n * Returns the value of the first element in the iterator where predicate is true, and undefined\n * otherwise.\n *\n * @param predicate find calls predicate once for each element of the iterator, 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 * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorFind<T, S extends T>(\n iterator: Iterator<T>,\n predicate: (value: T, index: number) => value is S\n): S | undefined;\n\nexport function iteratorFind<T>(iterator: Iterator<T>, predicate: (value: T, index: number) => unknown): T | undefined;\n\nexport function iteratorFind<T, S extends T>(\n iterator: Iterator<T>,\n predicate: (value: T, index: number) => unknown\n): S | undefined {\n return find(iterator, predicate);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport flatMap from 'core-js-pure/full/iterator/flat-map';\n\n/**\n * `.flatMap` takes a mapping function as an argument. It returns an iterator that produces all elements of the iterators produced by applying the mapping function to the elements produced by the underlying iterator.\n *\n * @param mapperFn\n *\n * @return Returns an iterator of flat values.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorFlatMap<T, U>(iterable: Iterable<T>, mapperFn: (value: T, index: number) => U): Iterator<T> {\n return flatMap(iterable, mapperFn);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport forEach from 'core-js-pure/full/iterator/for-each';\n\n/**\n * Performs the specified action for each element in an iterator.\n *\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the iterator.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorForEach<T>(iterator: Iterator<T>, callbackfn: (value: T, index: number) => void): void {\n forEach(iterator, callbackfn);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport from from 'core-js-pure/full/iterator/from';\n\n/**\n * `.from` is a static method (unlike the others listed above) which takes an object as an argument. This method allows wrapping \"iterator-like\" objects with an iterator.\n *\n * @param limit\n *\n * @return Returns the object if it is already an iterator, returns a wrapping iterator if the passed object implements a callable @@iterator property.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorFrom<T>(iteratorLike: Iterator<T>): Iterator<T> {\n return from(iteratorLike);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport map from 'core-js-pure/full/iterator/map';\n\n/**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n *\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 *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorMap<T, U>(\n iterator: Iterator<T>,\n callbackfn: (value: T, index: number) => U\n): IterableIterator<U> {\n return map(iterator, callbackfn);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport reduce from 'core-js-pure/full/iterator/reduce';\n\n/**\n * 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.\n *\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterator.\n *\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an iterator value.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorReduce<T>(\n iterator: Iterator<T>,\n callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T\n): T;\n\nexport function iteratorReduce<T>(\n iterator: Iterator<T>,\n callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T,\n initialValue: T\n): T;\n\n/**\n * 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.\n *\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the iterator.\n *\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorReduce<T, U>(\n iterator: Iterator<T>,\n callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U,\n initialValue: U\n): U;\n\nexport function iteratorReduce<T, U = undefined>(\n iterator: Iterator<T>,\n callbackfn: (previousValue: U | undefined, currentValue: T, currentIndex: number) => U,\n initialValue?: U\n): U | undefined {\n return reduce(iterator, callbackfn, initialValue);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport some from 'core-js-pure/full/iterator/some';\n\n/**\n * Determines whether the specified callback function returns true for any element of an iterable.\n *\n * @param predicate A function that accepts up to three arguments. The some method calls the predicate function for each element in the iterable until the predicate returns a value which is coercible to the Boolean value true, or until the end of the iterable.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorSome<T>(iterator: Iterator<T>, predicate: (value: T, index: number) => unknown): boolean {\n return some(iterator, predicate);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport take from 'core-js-pure/full/iterator/take';\n\n/**\n * `take` takes an integer as an argument. It returns an iterator that produces, at most, the given number of elements produced by the underlying iterator.\n *\n * @param limit\n *\n * @return Returns an iterator with items from the original iterator from 0 until the limit.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorTake<T>(iterator: Iterator<T>, limit: number): Iterator<T> {\n return take(iterator, limit);\n}\n","// @ts-expect-error core-js-pure is not typed.\nimport toArray from 'core-js-pure/full/iterator/to-array';\n\ntype IteratorLike<T> = Pick<Iterator<T>, 'next'>;\n\n/**\n * When you have a non-infinite iterator which you wish to transform into an array, you can do so with the builtin toArray method.\n *\n * @param limit\n *\n * @return Returns an Array containing the values from the iterator.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorToArray<T>(iteratorLike: IteratorLike<T>): T[] {\n return toArray(iteratorLike);\n}\n","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","import { Observable } from './Observable';\n\nexport function observableFromAsync<T>(iterable: AsyncIterable<T>): Observable<T> {\n return new Observable(subscriber => {\n let closed = false;\n\n (async function () {\n try {\n for await (const value of iterable) {\n if (closed) {\n break;\n }\n\n subscriber.next(value);\n }\n\n subscriber.complete();\n } catch (error) {\n subscriber.error(error);\n }\n })();\n\n return () => {\n closed = true;\n };\n });\n}\n","import type { Observable, Subscription } from './Observable';\n\nexport function observableSubscribeAsReadable<T>(observable: Observable<T>): ReadableStream<T> {\n let subscription: Subscription;\n\n return new ReadableStream<T>({\n cancel() {\n subscription.unsubscribe();\n },\n start(controller) {\n subscription = observable.subscribe({\n complete() {\n controller.close();\n },\n error(err: unknown) {\n controller.error(err);\n },\n next(value) {\n controller.enqueue(value);\n }\n });\n }\n });\n}\n","function isIterable(iterable: unknown): iterable is Iterable<unknown> {\n return !!(iterable && typeof iterable === 'object' && Symbol.iterator in iterable);\n}\n\nexport function readableStreamFrom<T>(anyIterable: AsyncIterable<T> | Iterable<T>): ReadableStream<T> {\n const iterator = isIterable(anyIterable) ? anyIterable[Symbol.iterator]() : anyIterable[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","export function readerValues<T>(reader: ReadableStreamDefaultReader<T>): AsyncIterableIterator<T> {\n const iterable: AsyncIterableIterator<T> = {\n [Symbol.asyncIterator]() {\n return iterable;\n },\n async next(): Promise<IteratorResult<T>> {\n const result = await Promise.race([reader.read(), reader.closed]);\n\n if (!result || result.done) {\n return { done: true, value: undefined };\n }\n\n return { value: result.value };\n },\n async return() {\n // Throw inside for-loop is return().\n reader.cancel();\n\n return { done: true, value: undefined };\n }\n };\n\n return iterable;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,qBAA6B;;;ACA7B,wBAAmC;AAEnC,IAAM,mBAAkC,kBAAAC;;;AD6CjC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,WAAW;AACT,qBAAW,MAAM;AAAA,QACnB;AAAA,QACA,MAAM,KAAc;AAClB,qBAAW,MAAM,GAAG;AAAA,QACtB;AAAA,QACA,KAAK,OAAO;AACV,qBAAW,QAAQ,KAAK;AAAA,QAC1B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;;;ACvBA,SAAS,WAAW,UAAkD;AACpE,SAAO,CAAC,EAAE,YAAY,OAAO,aAAa,YAAY,OAAO,YAAY;AAC3E;AAEO,SAAS,mBAAsB,aAAgE;AACpG,QAAM,WAAW,WAAW,WAAW,IAAI,YAAY,OAAO,QAAQ,EAAE,IAAI,YAAY,OAAO,aAAa,EAAE;AAE9G,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;;;AClBO,SAAS,aAAgB,QAAkE;AAChG,QAAM,WAAqC;AAAA,IACzC,CAAC,OAAO,aAAa,IAAI;AACvB,aAAO;AAAA,IACT;AAAA,IACA,MAAM,OAAmC;AACvC,YAAM,SAAS,MAAM,QAAQ,KAAK,CAAC,OAAO,KAAK,GAAG,OAAO,MAAM,CAAC;AAEhE,UAAI,CAAC,UAAU,OAAO,MAAM;AAC1B,eAAO,EAAE,MAAM,MAAM,OAAO,OAAU;AAAA,MACxC;AAEA,aAAO,EAAE,OAAO,OAAO,MAAM;AAAA,IAC/B;AAAA,IACA,MAAM,SAAS;AAEb,aAAO,OAAO;AAEd,aAAO,EAAE,MAAM,MAAM,OAAO,OAAU;AAAA,IACxC;AAAA,EACF;AAEA,SAAO;AACT;","names":["import_observable","CoreJSSymbolObservable","CoreJSObservable","asyncGeneratorWithLastValue","STILL_ITERATING","generatorWithLastValue","coreJSPromiseWithResolvers","drop","every","filter","find","flatMap","forEach","from","map","reduce","some","take","toArray"]}