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.
- package/README.md +43 -18
- package/dist/chunk-3S6LCGE6.mjs +10 -0
- package/dist/chunk-3S6LCGE6.mjs.map +1 -0
- package/dist/chunk-BWMXKULC.mjs +46 -0
- package/dist/chunk-BWMXKULC.mjs.map +1 -0
- package/dist/chunk-FBST4AUL.mjs +10 -0
- package/dist/chunk-FBST4AUL.mjs.map +1 -0
- package/dist/chunk-FMIHIL6A.mjs +10 -0
- package/dist/chunk-FMIHIL6A.mjs.map +1 -0
- package/dist/chunk-KYMTQJIJ.mjs +10 -0
- package/dist/chunk-KYMTQJIJ.mjs.map +1 -0
- package/dist/chunk-LIMQXDFK.mjs +10 -0
- package/dist/chunk-LIMQXDFK.mjs.map +1 -0
- package/dist/chunk-OWUGLCQB.mjs +10 -0
- package/dist/chunk-OWUGLCQB.mjs.map +1 -0
- package/dist/chunk-QX6EMOSQ.mjs +10 -0
- package/dist/chunk-QX6EMOSQ.mjs.map +1 -0
- package/dist/chunk-R6SXIXMH.mjs +10 -0
- package/dist/chunk-R6SXIXMH.mjs.map +1 -0
- package/dist/chunk-TDHR35S7.mjs +10 -0
- package/dist/chunk-TDHR35S7.mjs.map +1 -0
- package/dist/chunk-VCKLUCOT.mjs +10 -0
- package/dist/chunk-VCKLUCOT.mjs.map +1 -0
- package/dist/chunk-XQDGXAAF.mjs +10 -0
- package/dist/chunk-XQDGXAAF.mjs.map +1 -0
- package/dist/{chunk-MOBXUTO5.mjs → chunk-YJSIVBF7.mjs} +5 -5
- package/dist/chunk-YJSIVBF7.mjs.map +1 -0
- package/dist/chunk-YLERARWI.mjs +10 -0
- package/dist/chunk-YLERARWI.mjs.map +1 -0
- package/dist/iter-fest.d.mts +14 -9
- package/dist/iter-fest.d.ts +14 -9
- package/dist/iter-fest.iterableWritableStream.d.mts +7 -0
- package/dist/iter-fest.iterableWritableStream.d.ts +7 -0
- package/dist/{iter-fest.pushAsyncIterableIterator.js → iter-fest.iterableWritableStream.js} +39 -30
- package/dist/iter-fest.iterableWritableStream.js.map +1 -0
- package/dist/iter-fest.iterableWritableStream.mjs +7 -0
- package/dist/iter-fest.iteratorDrop.d.mts +12 -0
- package/dist/iter-fest.iteratorDrop.d.ts +12 -0
- package/dist/iter-fest.iteratorDrop.js +44 -0
- package/dist/iter-fest.iteratorDrop.js.map +1 -0
- package/dist/iter-fest.iteratorDrop.mjs +7 -0
- package/dist/iter-fest.iteratorEvery.d.mts +25 -0
- package/dist/iter-fest.iteratorEvery.d.ts +25 -0
- package/dist/iter-fest.iteratorEvery.js +44 -0
- package/dist/iter-fest.iteratorEvery.js.map +1 -0
- package/dist/iter-fest.iteratorEvery.mjs +7 -0
- package/dist/iter-fest.iteratorFilter.d.mts +18 -0
- package/dist/iter-fest.iteratorFilter.d.ts +18 -0
- package/dist/iter-fest.iteratorFilter.js +44 -0
- package/dist/iter-fest.iteratorFilter.js.map +1 -0
- package/dist/iter-fest.iteratorFilter.mjs +7 -0
- package/dist/iter-fest.iteratorFind.d.mts +14 -0
- package/dist/iter-fest.iteratorFind.d.ts +14 -0
- package/dist/iter-fest.iteratorFind.js +44 -0
- package/dist/iter-fest.iteratorFind.js.map +1 -0
- package/dist/iter-fest.iteratorFind.mjs +7 -0
- package/dist/iter-fest.iteratorFlatMap.d.mts +12 -0
- package/dist/iter-fest.iteratorFlatMap.d.ts +12 -0
- package/dist/iter-fest.iteratorFlatMap.js +44 -0
- package/dist/iter-fest.iteratorFlatMap.js.map +1 -0
- package/dist/iter-fest.iteratorFlatMap.mjs +7 -0
- package/dist/iter-fest.iteratorForEach.d.mts +10 -0
- package/dist/iter-fest.iteratorForEach.d.ts +10 -0
- package/dist/iter-fest.iteratorForEach.js +44 -0
- package/dist/iter-fest.iteratorForEach.js.map +1 -0
- package/dist/iter-fest.iteratorForEach.mjs +7 -0
- package/dist/iter-fest.iteratorFrom.d.mts +12 -0
- package/dist/iter-fest.iteratorFrom.d.ts +12 -0
- package/dist/iter-fest.iteratorFrom.js +44 -0
- package/dist/iter-fest.iteratorFrom.js.map +1 -0
- package/dist/iter-fest.iteratorFrom.mjs +7 -0
- package/dist/iter-fest.iteratorMap.d.mts +10 -0
- package/dist/iter-fest.iteratorMap.d.ts +10 -0
- package/dist/iter-fest.iteratorMap.js +44 -0
- package/dist/iter-fest.iteratorMap.js.map +1 -0
- package/dist/iter-fest.iteratorMap.mjs +7 -0
- package/dist/{iter-fest.iterableReduce.d.mts → iter-fest.iteratorReduce.d.mts} +13 -9
- package/dist/{iter-fest.iterableReduce.d.ts → iter-fest.iteratorReduce.d.ts} +13 -9
- package/dist/iter-fest.iteratorReduce.js +44 -0
- package/dist/iter-fest.iteratorReduce.js.map +1 -0
- package/dist/iter-fest.iteratorReduce.mjs +7 -0
- package/dist/iter-fest.iteratorReduce.mjs.map +1 -0
- package/dist/iter-fest.iteratorSome.d.mts +10 -0
- package/dist/iter-fest.iteratorSome.d.ts +10 -0
- package/dist/iter-fest.iteratorSome.js +44 -0
- package/dist/iter-fest.iteratorSome.js.map +1 -0
- package/dist/iter-fest.iteratorSome.mjs +7 -0
- package/dist/iter-fest.iteratorSome.mjs.map +1 -0
- package/dist/iter-fest.iteratorTake.d.mts +12 -0
- package/dist/iter-fest.iteratorTake.d.ts +12 -0
- package/dist/iter-fest.iteratorTake.js +44 -0
- package/dist/iter-fest.iteratorTake.js.map +1 -0
- package/dist/iter-fest.iteratorTake.mjs +7 -0
- package/dist/iter-fest.iteratorTake.mjs.map +1 -0
- package/dist/iter-fest.iteratorToArray.d.mts +13 -0
- package/dist/iter-fest.iteratorToArray.d.ts +13 -0
- package/dist/iter-fest.iteratorToArray.js +44 -0
- package/dist/iter-fest.iteratorToArray.js.map +1 -0
- package/dist/iter-fest.iteratorToArray.mjs +7 -0
- package/dist/iter-fest.iteratorToArray.mjs.map +1 -0
- package/dist/iter-fest.js +164 -168
- package/dist/iter-fest.js.map +1 -1
- package/dist/iter-fest.mjs +72 -52
- package/dist/iter-fest.readableStreamFrom.d.mts +3 -0
- package/dist/iter-fest.readableStreamFrom.d.ts +3 -0
- package/dist/{iter-fest.iterableGetReadable.js → iter-fest.readableStreamFrom.js} +9 -9
- package/dist/iter-fest.readableStreamFrom.js.map +1 -0
- package/dist/iter-fest.readableStreamFrom.mjs +7 -0
- package/dist/iter-fest.readableStreamFrom.mjs.map +1 -0
- package/package.json +137 -87
- package/dist/chunk-5CRMPYKD.mjs +0 -19
- package/dist/chunk-5CRMPYKD.mjs.map +0 -1
- package/dist/chunk-6C3P4TNK.mjs +0 -19
- package/dist/chunk-6C3P4TNK.mjs.map +0 -1
- package/dist/chunk-EZC33HE6.mjs +0 -15
- package/dist/chunk-EZC33HE6.mjs.map +0 -1
- package/dist/chunk-JU353VSE.mjs +0 -16
- package/dist/chunk-JU353VSE.mjs.map +0 -1
- package/dist/chunk-MNLOWKTC.mjs +0 -19
- package/dist/chunk-MNLOWKTC.mjs.map +0 -1
- package/dist/chunk-MOBXUTO5.mjs.map +0 -1
- package/dist/chunk-O5SQJUKB.mjs +0 -37
- package/dist/chunk-O5SQJUKB.mjs.map +0 -1
- package/dist/chunk-XW34KZRY.mjs +0 -17
- package/dist/chunk-XW34KZRY.mjs.map +0 -1
- package/dist/chunk-ZUBHGSCW.mjs +0 -18
- package/dist/chunk-ZUBHGSCW.mjs.map +0 -1
- package/dist/iter-fest.iterableEvery.d.mts +0 -24
- package/dist/iter-fest.iterableEvery.d.ts +0 -24
- package/dist/iter-fest.iterableEvery.js +0 -43
- package/dist/iter-fest.iterableEvery.js.map +0 -1
- package/dist/iter-fest.iterableEvery.mjs +0 -7
- package/dist/iter-fest.iterableFilter.d.mts +0 -16
- package/dist/iter-fest.iterableFilter.d.ts +0 -16
- package/dist/iter-fest.iterableFilter.js +0 -42
- package/dist/iter-fest.iterableFilter.js.map +0 -1
- package/dist/iter-fest.iterableFilter.mjs +0 -7
- package/dist/iter-fest.iterableFind.d.mts +0 -15
- package/dist/iter-fest.iterableFind.d.ts +0 -15
- package/dist/iter-fest.iterableFind.js +0 -43
- package/dist/iter-fest.iterableFind.js.map +0 -1
- package/dist/iter-fest.iterableFind.mjs +0 -7
- package/dist/iter-fest.iterableForEach.d.mts +0 -10
- package/dist/iter-fest.iterableForEach.d.ts +0 -10
- package/dist/iter-fest.iterableForEach.js +0 -40
- package/dist/iter-fest.iterableForEach.js.map +0 -1
- package/dist/iter-fest.iterableForEach.mjs +0 -7
- package/dist/iter-fest.iterableGetReadable.d.mts +0 -3
- package/dist/iter-fest.iterableGetReadable.d.ts +0 -3
- package/dist/iter-fest.iterableGetReadable.js.map +0 -1
- package/dist/iter-fest.iterableGetReadable.mjs +0 -7
- package/dist/iter-fest.iterableMap.d.mts +0 -8
- package/dist/iter-fest.iterableMap.d.ts +0 -8
- package/dist/iter-fest.iterableMap.js +0 -39
- package/dist/iter-fest.iterableMap.js.map +0 -1
- package/dist/iter-fest.iterableMap.mjs +0 -7
- package/dist/iter-fest.iterableReduce.js +0 -41
- package/dist/iter-fest.iterableReduce.js.map +0 -1
- package/dist/iter-fest.iterableReduce.mjs +0 -7
- package/dist/iter-fest.iterableSome.d.mts +0 -12
- package/dist/iter-fest.iterableSome.d.ts +0 -12
- package/dist/iter-fest.iterableSome.js +0 -43
- package/dist/iter-fest.iterableSome.js.map +0 -1
- package/dist/iter-fest.iterableSome.mjs +0 -7
- package/dist/iter-fest.pushAsyncIterableIterator.d.mts +0 -9
- package/dist/iter-fest.pushAsyncIterableIterator.d.ts +0 -9
- package/dist/iter-fest.pushAsyncIterableIterator.js.map +0 -1
- package/dist/iter-fest.pushAsyncIterableIterator.mjs +0 -7
- /package/dist/{iter-fest.iterableEvery.mjs.map → iter-fest.iterableWritableStream.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableFilter.mjs.map → iter-fest.iteratorDrop.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableFind.mjs.map → iter-fest.iteratorEvery.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableForEach.mjs.map → iter-fest.iteratorFilter.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableGetReadable.mjs.map → iter-fest.iteratorFind.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableMap.mjs.map → iter-fest.iteratorFlatMap.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableReduce.mjs.map → iter-fest.iteratorForEach.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableSome.mjs.map → iter-fest.iteratorFrom.mjs.map} +0 -0
- /package/dist/{iter-fest.pushAsyncIterableIterator.mjs.map → iter-fest.iteratorMap.mjs.map} +0 -0
package/dist/iter-fest.mjs
CHANGED
|
@@ -1,75 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
iterableToString
|
|
3
|
-
} from "./chunk-Y5M2C7NQ.mjs";
|
|
4
|
-
import {
|
|
5
|
-
iteratorToIterable
|
|
6
|
-
} from "./chunk-MNDAEMYM.mjs";
|
|
7
1
|
import {
|
|
8
2
|
observableFromAsync
|
|
9
3
|
} from "./chunk-FEOLYD5R.mjs";
|
|
10
|
-
import {
|
|
11
|
-
Observable
|
|
12
|
-
} from "./chunk-VLF6DI2U.mjs";
|
|
13
4
|
import {
|
|
14
5
|
observableSubscribeAsReadable
|
|
15
6
|
} from "./chunk-EIIP7YWB.mjs";
|
|
16
7
|
import {
|
|
17
|
-
|
|
18
|
-
} from "./chunk-
|
|
8
|
+
readableStreamFrom
|
|
9
|
+
} from "./chunk-YJSIVBF7.mjs";
|
|
19
10
|
import {
|
|
20
11
|
readerValues
|
|
21
12
|
} from "./chunk-EUVK4YM7.mjs";
|
|
22
13
|
import {
|
|
23
|
-
|
|
24
|
-
} from "./chunk-
|
|
14
|
+
iteratorFrom
|
|
15
|
+
} from "./chunk-KYMTQJIJ.mjs";
|
|
25
16
|
import {
|
|
26
|
-
|
|
27
|
-
} from "./chunk-
|
|
17
|
+
iteratorMap
|
|
18
|
+
} from "./chunk-XQDGXAAF.mjs";
|
|
28
19
|
import {
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
20
|
+
iteratorReduce
|
|
21
|
+
} from "./chunk-LIMQXDFK.mjs";
|
|
31
22
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
23
|
+
iteratorSome
|
|
24
|
+
} from "./chunk-3S6LCGE6.mjs";
|
|
34
25
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
26
|
+
iteratorTake
|
|
27
|
+
} from "./chunk-VCKLUCOT.mjs";
|
|
37
28
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./chunk-
|
|
29
|
+
iteratorToArray
|
|
30
|
+
} from "./chunk-YLERARWI.mjs";
|
|
40
31
|
import {
|
|
41
|
-
|
|
42
|
-
} from "./chunk-
|
|
32
|
+
iteratorToIterable
|
|
33
|
+
} from "./chunk-MNDAEMYM.mjs";
|
|
43
34
|
import {
|
|
44
|
-
|
|
45
|
-
} from "./chunk-
|
|
35
|
+
Observable
|
|
36
|
+
} from "./chunk-VLF6DI2U.mjs";
|
|
46
37
|
import {
|
|
47
|
-
|
|
48
|
-
} from "./chunk-
|
|
38
|
+
SymbolObservable
|
|
39
|
+
} from "./chunk-OJMT4K3R.mjs";
|
|
49
40
|
import {
|
|
50
|
-
|
|
51
|
-
} from "./chunk-
|
|
41
|
+
iterableToString
|
|
42
|
+
} from "./chunk-Y5M2C7NQ.mjs";
|
|
52
43
|
import {
|
|
53
|
-
|
|
54
|
-
} from "./chunk-
|
|
44
|
+
IterableWritableStream
|
|
45
|
+
} from "./chunk-BWMXKULC.mjs";
|
|
55
46
|
import {
|
|
56
|
-
|
|
57
|
-
} from "./chunk-
|
|
47
|
+
iteratorDrop
|
|
48
|
+
} from "./chunk-R6SXIXMH.mjs";
|
|
49
|
+
import {
|
|
50
|
+
iteratorEvery
|
|
51
|
+
} from "./chunk-OWUGLCQB.mjs";
|
|
52
|
+
import {
|
|
53
|
+
iteratorFilter
|
|
54
|
+
} from "./chunk-TDHR35S7.mjs";
|
|
55
|
+
import {
|
|
56
|
+
iteratorFind
|
|
57
|
+
} from "./chunk-FBST4AUL.mjs";
|
|
58
|
+
import {
|
|
59
|
+
iteratorFlatMap
|
|
60
|
+
} from "./chunk-QX6EMOSQ.mjs";
|
|
61
|
+
import {
|
|
62
|
+
iteratorForEach
|
|
63
|
+
} from "./chunk-FMIHIL6A.mjs";
|
|
58
64
|
import {
|
|
59
65
|
iterableFindLast
|
|
60
66
|
} from "./chunk-V6OWQQ3Q.mjs";
|
|
61
67
|
import {
|
|
62
68
|
iterableFindLastIndex
|
|
63
69
|
} from "./chunk-TEI3K6GT.mjs";
|
|
64
|
-
import {
|
|
65
|
-
iterableForEach
|
|
66
|
-
} from "./chunk-JU353VSE.mjs";
|
|
67
|
-
import {
|
|
68
|
-
iterableGetReadable
|
|
69
|
-
} from "./chunk-MOBXUTO5.mjs";
|
|
70
70
|
import {
|
|
71
71
|
iterableIncludes
|
|
72
72
|
} from "./chunk-27NJVC7K.mjs";
|
|
73
|
+
import {
|
|
74
|
+
iterableIndexOf
|
|
75
|
+
} from "./chunk-UIEKIMLW.mjs";
|
|
76
|
+
import {
|
|
77
|
+
iterableJoin
|
|
78
|
+
} from "./chunk-5CHMNKXJ.mjs";
|
|
79
|
+
import {
|
|
80
|
+
iterableKeys
|
|
81
|
+
} from "./chunk-XKBVB2JN.mjs";
|
|
82
|
+
import {
|
|
83
|
+
iterableSlice
|
|
84
|
+
} from "./chunk-KONB7TV6.mjs";
|
|
85
|
+
import {
|
|
86
|
+
iterableToSpliced
|
|
87
|
+
} from "./chunk-WKIRSZXX.mjs";
|
|
73
88
|
import {
|
|
74
89
|
asyncGeneratorWithLastValue
|
|
75
90
|
} from "./chunk-ANRVAYLW.mjs";
|
|
@@ -90,11 +105,11 @@ import {
|
|
|
90
105
|
iterableEntries
|
|
91
106
|
} from "./chunk-44W7OTNE.mjs";
|
|
92
107
|
import {
|
|
93
|
-
|
|
94
|
-
} from "./chunk-
|
|
108
|
+
iterableFindIndex
|
|
109
|
+
} from "./chunk-HYU4EN7J.mjs";
|
|
95
110
|
export {
|
|
111
|
+
IterableWritableStream,
|
|
96
112
|
Observable,
|
|
97
|
-
PushAsyncIterableIterator,
|
|
98
113
|
SymbolObservable,
|
|
99
114
|
asyncGeneratorWithLastValue,
|
|
100
115
|
asyncIteratorToAsyncIterable,
|
|
@@ -102,27 +117,32 @@ export {
|
|
|
102
117
|
iterableAt,
|
|
103
118
|
iterableConcat,
|
|
104
119
|
iterableEntries,
|
|
105
|
-
iterableEvery,
|
|
106
|
-
iterableFilter,
|
|
107
|
-
iterableFind,
|
|
108
120
|
iterableFindIndex,
|
|
109
121
|
iterableFindLast,
|
|
110
122
|
iterableFindLastIndex,
|
|
111
|
-
iterableForEach,
|
|
112
|
-
iterableGetReadable,
|
|
113
123
|
iterableIncludes,
|
|
114
124
|
iterableIndexOf,
|
|
115
125
|
iterableJoin,
|
|
116
126
|
iterableKeys,
|
|
117
|
-
iterableMap,
|
|
118
|
-
iterableReduce,
|
|
119
127
|
iterableSlice,
|
|
120
|
-
iterableSome,
|
|
121
128
|
iterableToSpliced,
|
|
122
129
|
iterableToString,
|
|
130
|
+
iteratorDrop,
|
|
131
|
+
iteratorEvery,
|
|
132
|
+
iteratorFilter,
|
|
133
|
+
iteratorFind,
|
|
134
|
+
iteratorFlatMap,
|
|
135
|
+
iteratorForEach,
|
|
136
|
+
iteratorFrom,
|
|
137
|
+
iteratorMap,
|
|
138
|
+
iteratorReduce,
|
|
139
|
+
iteratorSome,
|
|
140
|
+
iteratorTake,
|
|
141
|
+
iteratorToArray,
|
|
123
142
|
iteratorToIterable,
|
|
124
143
|
observableFromAsync,
|
|
125
144
|
observableSubscribeAsReadable,
|
|
145
|
+
readableStreamFrom,
|
|
126
146
|
readerValues
|
|
127
147
|
};
|
|
128
148
|
//# sourceMappingURL=iter-fest.mjs.map
|
|
@@ -17,17 +17,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
20
|
+
// src/readableStreamFrom.ts
|
|
21
|
+
var readableStreamFrom_exports = {};
|
|
22
|
+
__export(readableStreamFrom_exports, {
|
|
23
|
+
readableStreamFrom: () => readableStreamFrom
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(readableStreamFrom_exports);
|
|
26
26
|
function isIterable(iterable) {
|
|
27
27
|
return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const iterator = isIterable(
|
|
29
|
+
function readableStreamFrom(anyIterable) {
|
|
30
|
+
const iterator = isIterable(anyIterable) ? anyIterable[Symbol.iterator]() : anyIterable[Symbol.asyncIterator]();
|
|
31
31
|
return new ReadableStream({
|
|
32
32
|
async pull(controller) {
|
|
33
33
|
const result = await iterator.next();
|
|
@@ -41,6 +41,6 @@ function iterableGetReadable(iterable) {
|
|
|
41
41
|
}
|
|
42
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
43
43
|
0 && (module.exports = {
|
|
44
|
-
|
|
44
|
+
readableStreamFrom
|
|
45
45
|
});
|
|
46
|
-
//# sourceMappingURL=iter-fest.
|
|
46
|
+
//# sourceMappingURL=iter-fest.readableStreamFrom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/readableStreamFrom.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,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;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iter-fest",
|
|
3
|
-
"version": "0.1.1-main.
|
|
3
|
+
"version": "0.1.1-main.dd552c2",
|
|
4
4
|
"description": "A collection of utilities for iterations.",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist/"
|
|
@@ -66,36 +66,6 @@
|
|
|
66
66
|
"default": "./dist/iter-fest.iterableEntries.js"
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
"./iterableEvery": {
|
|
70
|
-
"import": {
|
|
71
|
-
"types": "./dist/iter-fest.iterableEvery.d.mts",
|
|
72
|
-
"default": "./dist/iter-fest.iterableEvery.mjs"
|
|
73
|
-
},
|
|
74
|
-
"require": {
|
|
75
|
-
"types": "./dist/iter-fest.iterableEvery.d.ts",
|
|
76
|
-
"default": "./dist/iter-fest.iterableEvery.js"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"./iterableFilter": {
|
|
80
|
-
"import": {
|
|
81
|
-
"types": "./dist/iter-fest.iterableFilter.d.mts",
|
|
82
|
-
"default": "./dist/iter-fest.iterableFilter.mjs"
|
|
83
|
-
},
|
|
84
|
-
"require": {
|
|
85
|
-
"types": "./dist/iter-fest.iterableFilter.d.ts",
|
|
86
|
-
"default": "./dist/iter-fest.iterableFilter.js"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"./iterableFind": {
|
|
90
|
-
"import": {
|
|
91
|
-
"types": "./dist/iter-fest.iterableFind.d.mts",
|
|
92
|
-
"default": "./dist/iter-fest.iterableFind.mjs"
|
|
93
|
-
},
|
|
94
|
-
"require": {
|
|
95
|
-
"types": "./dist/iter-fest.iterableFind.d.ts",
|
|
96
|
-
"default": "./dist/iter-fest.iterableFind.js"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
69
|
"./iterableFindIndex": {
|
|
100
70
|
"import": {
|
|
101
71
|
"types": "./dist/iter-fest.iterableFindIndex.d.mts",
|
|
@@ -126,26 +96,6 @@
|
|
|
126
96
|
"default": "./dist/iter-fest.iterableFindLastIndex.js"
|
|
127
97
|
}
|
|
128
98
|
},
|
|
129
|
-
"./iterableForEach": {
|
|
130
|
-
"import": {
|
|
131
|
-
"types": "./dist/iter-fest.iterableForEach.d.mts",
|
|
132
|
-
"default": "./dist/iter-fest.iterableForEach.mjs"
|
|
133
|
-
},
|
|
134
|
-
"require": {
|
|
135
|
-
"types": "./dist/iter-fest.iterableForEach.d.ts",
|
|
136
|
-
"default": "./dist/iter-fest.iterableForEach.js"
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"./iterableGetReadable": {
|
|
140
|
-
"import": {
|
|
141
|
-
"types": "./dist/iter-fest.iterableGetReadable.d.mts",
|
|
142
|
-
"default": "./dist/iter-fest.iterableGetReadable.mjs"
|
|
143
|
-
},
|
|
144
|
-
"require": {
|
|
145
|
-
"types": "./dist/iter-fest.iterableGetReadable.d.ts",
|
|
146
|
-
"default": "./dist/iter-fest.iterableGetReadable.js"
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
99
|
"./iterableIncludes": {
|
|
150
100
|
"import": {
|
|
151
101
|
"types": "./dist/iter-fest.iterableIncludes.d.mts",
|
|
@@ -186,26 +136,6 @@
|
|
|
186
136
|
"default": "./dist/iter-fest.iterableJoin.js"
|
|
187
137
|
}
|
|
188
138
|
},
|
|
189
|
-
"./iterableMap": {
|
|
190
|
-
"import": {
|
|
191
|
-
"types": "./dist/iter-fest.iterableMap.d.mts",
|
|
192
|
-
"default": "./dist/iter-fest.iterableMap.mjs"
|
|
193
|
-
},
|
|
194
|
-
"require": {
|
|
195
|
-
"types": "./dist/iter-fest.iterableMap.d.ts",
|
|
196
|
-
"default": "./dist/iter-fest.iterableMap.js"
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
"./iterableReduce": {
|
|
200
|
-
"import": {
|
|
201
|
-
"types": "./dist/iter-fest.iterableReduce.d.mts",
|
|
202
|
-
"default": "./dist/iter-fest.iterableReduce.mjs"
|
|
203
|
-
},
|
|
204
|
-
"require": {
|
|
205
|
-
"types": "./dist/iter-fest.iterableReduce.d.ts",
|
|
206
|
-
"default": "./dist/iter-fest.iterableReduce.js"
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
139
|
"./iterableSlice": {
|
|
210
140
|
"import": {
|
|
211
141
|
"types": "./dist/iter-fest.iterableSlice.d.mts",
|
|
@@ -216,16 +146,6 @@
|
|
|
216
146
|
"default": "./dist/iter-fest.iterableSlice.js"
|
|
217
147
|
}
|
|
218
148
|
},
|
|
219
|
-
"./iterableSome": {
|
|
220
|
-
"import": {
|
|
221
|
-
"types": "./dist/iter-fest.iterableSome.d.mts",
|
|
222
|
-
"default": "./dist/iter-fest.iterableSome.mjs"
|
|
223
|
-
},
|
|
224
|
-
"require": {
|
|
225
|
-
"types": "./dist/iter-fest.iterableSome.d.ts",
|
|
226
|
-
"default": "./dist/iter-fest.iterableSome.js"
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
149
|
"./iterableToSpliced": {
|
|
230
150
|
"import": {
|
|
231
151
|
"types": "./dist/iter-fest.iterableToSpliced.d.mts",
|
|
@@ -246,6 +166,136 @@
|
|
|
246
166
|
"default": "./dist/iter-fest.iterableToString.js"
|
|
247
167
|
}
|
|
248
168
|
},
|
|
169
|
+
"./iterableWritableStream": {
|
|
170
|
+
"import": {
|
|
171
|
+
"types": "./dist/iter-fest.iterableWritableStream.d.mts",
|
|
172
|
+
"default": "./dist/iter-fest.iterableWritableStream.mjs"
|
|
173
|
+
},
|
|
174
|
+
"require": {
|
|
175
|
+
"types": "./dist/iter-fest.iterableWritableStream.d.ts",
|
|
176
|
+
"default": "./dist/iter-fest.iterableWritableStream.js"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"./iteratorDrop": {
|
|
180
|
+
"import": {
|
|
181
|
+
"types": "./dist/iter-fest.iteratorDrop.d.mts",
|
|
182
|
+
"default": "./dist/iter-fest.iteratorDrop.mjs"
|
|
183
|
+
},
|
|
184
|
+
"require": {
|
|
185
|
+
"types": "./dist/iter-fest.iteratorDrop.d.ts",
|
|
186
|
+
"default": "./dist/iter-fest.iteratorDrop.js"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"./iteratorEvery": {
|
|
190
|
+
"import": {
|
|
191
|
+
"types": "./dist/iter-fest.iteratorEvery.d.mts",
|
|
192
|
+
"default": "./dist/iter-fest.iteratorEvery.mjs"
|
|
193
|
+
},
|
|
194
|
+
"require": {
|
|
195
|
+
"types": "./dist/iter-fest.iteratorEvery.d.ts",
|
|
196
|
+
"default": "./dist/iter-fest.iteratorEvery.js"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"./iteratorFilter": {
|
|
200
|
+
"import": {
|
|
201
|
+
"types": "./dist/iter-fest.iteratorFilter.d.mts",
|
|
202
|
+
"default": "./dist/iter-fest.iteratorFilter.mjs"
|
|
203
|
+
},
|
|
204
|
+
"require": {
|
|
205
|
+
"types": "./dist/iter-fest.iteratorFilter.d.ts",
|
|
206
|
+
"default": "./dist/iter-fest.iteratorFilter.js"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"./iteratorFind": {
|
|
210
|
+
"import": {
|
|
211
|
+
"types": "./dist/iter-fest.iteratorFind.d.mts",
|
|
212
|
+
"default": "./dist/iter-fest.iteratorFind.mjs"
|
|
213
|
+
},
|
|
214
|
+
"require": {
|
|
215
|
+
"types": "./dist/iter-fest.iteratorFind.d.ts",
|
|
216
|
+
"default": "./dist/iter-fest.iteratorFind.js"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"./iteratorFlatMap": {
|
|
220
|
+
"import": {
|
|
221
|
+
"types": "./dist/iter-fest.iteratorFlatMap.d.mts",
|
|
222
|
+
"default": "./dist/iter-fest.iteratorFlatMap.mjs"
|
|
223
|
+
},
|
|
224
|
+
"require": {
|
|
225
|
+
"types": "./dist/iter-fest.iteratorFlatMap.d.ts",
|
|
226
|
+
"default": "./dist/iter-fest.iteratorFlatMap.js"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"./iteratorForEach": {
|
|
230
|
+
"import": {
|
|
231
|
+
"types": "./dist/iter-fest.iteratorForEach.d.mts",
|
|
232
|
+
"default": "./dist/iter-fest.iteratorForEach.mjs"
|
|
233
|
+
},
|
|
234
|
+
"require": {
|
|
235
|
+
"types": "./dist/iter-fest.iteratorForEach.d.ts",
|
|
236
|
+
"default": "./dist/iter-fest.iteratorForEach.js"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"./iteratorFrom": {
|
|
240
|
+
"import": {
|
|
241
|
+
"types": "./dist/iter-fest.iteratorFrom.d.mts",
|
|
242
|
+
"default": "./dist/iter-fest.iteratorFrom.mjs"
|
|
243
|
+
},
|
|
244
|
+
"require": {
|
|
245
|
+
"types": "./dist/iter-fest.iteratorFrom.d.ts",
|
|
246
|
+
"default": "./dist/iter-fest.iteratorFrom.js"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"./iteratorMap": {
|
|
250
|
+
"import": {
|
|
251
|
+
"types": "./dist/iter-fest.iteratorMap.d.mts",
|
|
252
|
+
"default": "./dist/iter-fest.iteratorMap.mjs"
|
|
253
|
+
},
|
|
254
|
+
"require": {
|
|
255
|
+
"types": "./dist/iter-fest.iteratorMap.d.ts",
|
|
256
|
+
"default": "./dist/iter-fest.iteratorMap.js"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"./iteratorReduce": {
|
|
260
|
+
"import": {
|
|
261
|
+
"types": "./dist/iter-fest.iteratorReduce.d.mts",
|
|
262
|
+
"default": "./dist/iter-fest.iteratorReduce.mjs"
|
|
263
|
+
},
|
|
264
|
+
"require": {
|
|
265
|
+
"types": "./dist/iter-fest.iteratorReduce.d.ts",
|
|
266
|
+
"default": "./dist/iter-fest.iteratorReduce.js"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"./iteratorSome": {
|
|
270
|
+
"import": {
|
|
271
|
+
"types": "./dist/iter-fest.iteratorSome.d.mts",
|
|
272
|
+
"default": "./dist/iter-fest.iteratorSome.mjs"
|
|
273
|
+
},
|
|
274
|
+
"require": {
|
|
275
|
+
"types": "./dist/iter-fest.iteratorSome.d.ts",
|
|
276
|
+
"default": "./dist/iter-fest.iteratorSome.js"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"./iteratorTake": {
|
|
280
|
+
"import": {
|
|
281
|
+
"types": "./dist/iter-fest.iteratorTake.d.mts",
|
|
282
|
+
"default": "./dist/iter-fest.iteratorTake.mjs"
|
|
283
|
+
},
|
|
284
|
+
"require": {
|
|
285
|
+
"types": "./dist/iter-fest.iteratorTake.d.ts",
|
|
286
|
+
"default": "./dist/iter-fest.iteratorTake.js"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"./iteratorToArray": {
|
|
290
|
+
"import": {
|
|
291
|
+
"types": "./dist/iter-fest.iteratorToArray.d.mts",
|
|
292
|
+
"default": "./dist/iter-fest.iteratorToArray.mjs"
|
|
293
|
+
},
|
|
294
|
+
"require": {
|
|
295
|
+
"types": "./dist/iter-fest.iteratorToArray.d.ts",
|
|
296
|
+
"default": "./dist/iter-fest.iteratorToArray.js"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
249
299
|
"./iteratorToIterable": {
|
|
250
300
|
"import": {
|
|
251
301
|
"types": "./dist/iter-fest.iteratorToIterable.d.mts",
|
|
@@ -286,14 +336,14 @@
|
|
|
286
336
|
"default": "./dist/iter-fest.observableSubscribeAsReadable.js"
|
|
287
337
|
}
|
|
288
338
|
},
|
|
289
|
-
"./
|
|
339
|
+
"./readableStreamFrom": {
|
|
290
340
|
"import": {
|
|
291
|
-
"types": "./dist/iter-fest.
|
|
292
|
-
"default": "./dist/iter-fest.
|
|
341
|
+
"types": "./dist/iter-fest.readableStreamFrom.d.mts",
|
|
342
|
+
"default": "./dist/iter-fest.readableStreamFrom.mjs"
|
|
293
343
|
},
|
|
294
344
|
"require": {
|
|
295
|
-
"types": "./dist/iter-fest.
|
|
296
|
-
"default": "./dist/iter-fest.
|
|
345
|
+
"types": "./dist/iter-fest.readableStreamFrom.d.ts",
|
|
346
|
+
"default": "./dist/iter-fest.readableStreamFrom.js"
|
|
297
347
|
}
|
|
298
348
|
},
|
|
299
349
|
"./readerValues": {
|
|
@@ -378,6 +428,6 @@
|
|
|
378
428
|
"typescript": "^5.4.5"
|
|
379
429
|
},
|
|
380
430
|
"dependencies": {
|
|
381
|
-
"iter-fest": "^0.1.1-main.
|
|
431
|
+
"iter-fest": "^0.1.1-main.dd552c2"
|
|
382
432
|
}
|
|
383
433
|
}
|
package/dist/chunk-5CRMPYKD.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/iterableEvery.ts
|
|
2
|
-
function iterableEvery(iterable, predicate, thisArg = void 0) {
|
|
3
|
-
let index = 0;
|
|
4
|
-
if (typeof predicate !== "function") {
|
|
5
|
-
throw new TypeError(`${predicate} is not a function`);
|
|
6
|
-
}
|
|
7
|
-
const boundPredicate = predicate.bind(thisArg);
|
|
8
|
-
for (const value of iterable) {
|
|
9
|
-
if (!boundPredicate(value, index++, iterable)) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
iterableEvery
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=chunk-5CRMPYKD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/iterableEvery.ts"],"sourcesContent":["/**\n * Determines whether all the members of an iterable satisfy the specified test.\n *\n * @param predicate A function that accepts up to three arguments. The every method calls\n * the predicate function for each element in the iterable until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the iterable.\n *\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableEvery<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => value is S,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): iterable is S[];\n\n/**\n * Determines whether all the members of an iterable satisfy the specified test.\n *\n * @param predicate A function that accepts up to three arguments. The every method calls\n * the predicate function for each element in the iterable until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the iterable.\n *\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableEvery<T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): boolean;\n\nexport function iterableEvery<T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, iterable: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg: any = undefined\n): boolean {\n let index = 0;\n\n if (typeof predicate !== 'function') {\n throw new TypeError(`${predicate} is not a function`);\n }\n\n const boundPredicate = predicate.bind(thisArg);\n\n for (const value of iterable) {\n if (!boundPredicate(value, index++, iterable)) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";AAkCO,SAAS,cACd,UACA,WAEA,UAAe,QACN;AACT,MAAI,QAAQ;AAEZ,MAAI,OAAO,cAAc,YAAY;AACnC,UAAM,IAAI,UAAU,GAAG,SAAS,oBAAoB;AAAA,EACtD;AAEA,QAAM,iBAAiB,UAAU,KAAK,OAAO;AAE7C,aAAW,SAAS,UAAU;AAC5B,QAAI,CAAC,eAAe,OAAO,SAAS,QAAQ,GAAG;AAC7C,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-6C3P4TNK.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/iterableSome.ts
|
|
2
|
-
function iterableSome(iterable, predicate, thisArg = void 0) {
|
|
3
|
-
let index = 0;
|
|
4
|
-
if (typeof predicate !== "function") {
|
|
5
|
-
throw new TypeError(`${predicate} is not a function`);
|
|
6
|
-
}
|
|
7
|
-
const boundPredicate = predicate.bind(thisArg);
|
|
8
|
-
for (const value of iterable) {
|
|
9
|
-
if (boundPredicate(value, index++, iterable)) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
iterableSome
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=chunk-6C3P4TNK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/iterableSome.ts"],"sourcesContent":["/**\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"],"mappings":";AASO,SAAS,aACd,UACA,WAEA,UAAe,QACN;AACT,MAAI,QAAQ;AAEZ,MAAI,OAAO,cAAc,YAAY;AACnC,UAAM,IAAI,UAAU,GAAG,SAAS,oBAAoB;AAAA,EACtD;AAEA,QAAM,iBAAiB,UAAU,KAAK,OAAO;AAE7C,aAAW,SAAS,UAAU;AAC5B,QAAI,eAAe,OAAO,SAAS,QAAQ,GAAG;AAC5C,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-EZC33HE6.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// src/iterableMap.ts
|
|
2
|
-
function* iterableMap(iterable, callbackfn, thisArg) {
|
|
3
|
-
let index = 0;
|
|
4
|
-
if (typeof callbackfn !== "function") {
|
|
5
|
-
throw new TypeError(`${callbackfn} is not a function`);
|
|
6
|
-
}
|
|
7
|
-
for (const value of iterable) {
|
|
8
|
-
yield callbackfn.call(thisArg, value, index++, iterable);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
iterableMap
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-EZC33HE6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/iterableMap.ts"],"sourcesContent":["/**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\nexport function* iterableMap<T, U>(\n iterable: Iterable<T>,\n callbackfn: (value: T, index: number, array: Iterable<T>) => U,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): IterableIterator<U> {\n let index = 0;\n\n if (typeof callbackfn !== 'function') {\n throw new TypeError(`${callbackfn} is not a function`);\n }\n\n for (const value of iterable) {\n yield callbackfn.call(thisArg, value, index++, iterable);\n }\n}\n"],"mappings":";AAKO,UAAU,YACf,UACA,YAEA,SACqB;AACrB,MAAI,QAAQ;AAEZ,MAAI,OAAO,eAAe,YAAY;AACpC,UAAM,IAAI,UAAU,GAAG,UAAU,oBAAoB;AAAA,EACvD;AAEA,aAAW,SAAS,UAAU;AAC5B,UAAM,WAAW,KAAK,SAAS,OAAO,SAAS,QAAQ;AAAA,EACzD;AACF;","names":[]}
|
package/dist/chunk-JU353VSE.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/iterableForEach.ts
|
|
2
|
-
function iterableForEach(iterable, callbackfn, thisArg) {
|
|
3
|
-
let index = 0;
|
|
4
|
-
if (typeof callbackfn !== "function") {
|
|
5
|
-
throw new TypeError(`${callbackfn} is not a function`);
|
|
6
|
-
}
|
|
7
|
-
const boundCallbackfn = callbackfn.bind(thisArg);
|
|
8
|
-
for (const value of iterable) {
|
|
9
|
-
boundCallbackfn(value, index++, iterable);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
iterableForEach
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-JU353VSE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/iterableForEach.ts"],"sourcesContent":["/**\n * Performs the specified action for each element in an iterable.\n *\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the iterable.\n *\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\nexport function iterableForEach<T>(\n iterable: Iterable<T>,\n callbackfn: (value: T, index: number, iterable: Iterable<T>) => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): void {\n let index = 0;\n\n if (typeof callbackfn !== 'function') {\n throw new TypeError(`${callbackfn} is not a function`);\n }\n\n const boundCallbackfn = callbackfn.bind(thisArg);\n\n for (const value of iterable) {\n boundCallbackfn(value, index++, iterable);\n }\n}\n"],"mappings":";AAOO,SAAS,gBACd,UACA,YAEA,SACM;AACN,MAAI,QAAQ;AAEZ,MAAI,OAAO,eAAe,YAAY;AACpC,UAAM,IAAI,UAAU,GAAG,UAAU,oBAAoB;AAAA,EACvD;AAEA,QAAM,kBAAkB,WAAW,KAAK,OAAO;AAE/C,aAAW,SAAS,UAAU;AAC5B,oBAAgB,OAAO,SAAS,QAAQ;AAAA,EAC1C;AACF;","names":[]}
|
package/dist/chunk-MNLOWKTC.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/iterableFind.ts
|
|
2
|
-
function iterableFind(iterable, predicate, thisArg) {
|
|
3
|
-
let index = 0;
|
|
4
|
-
if (typeof predicate !== "function") {
|
|
5
|
-
throw new TypeError(`${predicate} is not a function`);
|
|
6
|
-
}
|
|
7
|
-
const boundPredicate = predicate.bind(thisArg);
|
|
8
|
-
for (const value of iterable) {
|
|
9
|
-
if (boundPredicate(value, index++, iterable)) {
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return void 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
iterableFind
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=chunk-MNLOWKTC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/iterableFind.ts"],"sourcesContent":["/**\n * Returns the value of the first element in the iterable where predicate is true, and undefined\n * otherwise.\n *\n * @param predicate find calls predicate once for each element of the iterable, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n *\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\nexport function iterableFind<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, obj: Iterable<T>) => value is S,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): S | undefined;\n\nexport function iterableFind<T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, obj: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): T | undefined;\n\nexport function iterableFind<T, S extends T>(\n iterable: Iterable<T>,\n predicate: (value: T, index: number, obj: Iterable<T>) => unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n thisArg?: any\n): S | undefined {\n let index = 0;\n\n if (typeof predicate !== 'function') {\n throw new TypeError(`${predicate} is not a function`);\n }\n\n const boundPredicate = predicate.bind(thisArg);\n\n for (const value of iterable) {\n if (boundPredicate(value, index++, iterable)) {\n return value as S;\n }\n }\n\n return undefined;\n}\n"],"mappings":";AAyBO,SAAS,aACd,UACA,WAEA,SACe;AACf,MAAI,QAAQ;AAEZ,MAAI,OAAO,cAAc,YAAY;AACnC,UAAM,IAAI,UAAU,GAAG,SAAS,oBAAoB;AAAA,EACtD;AAEA,QAAM,iBAAiB,UAAU,KAAK,OAAO;AAE7C,aAAW,SAAS,UAAU;AAC5B,QAAI,eAAe,OAAO,SAAS,QAAQ,GAAG;AAC5C,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/iterableGetReadable.ts"],"sourcesContent":["function isIterable(iterable: unknown): iterable is Iterable<unknown> {\n return !!(iterable && typeof iterable === 'object' && Symbol.iterator in iterable);\n}\n\nexport function iterableGetReadable<T>(iterable: AsyncIterable<T> | Iterable<T>): ReadableStream<T> {\n const iterator = isIterable(iterable) ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n return new ReadableStream({\n async pull(controller) {\n const result = await iterator.next();\n\n if (result.done) {\n controller.close();\n } else {\n controller.enqueue(result.value);\n }\n }\n });\n}\n"],"mappings":";AAAA,SAAS,WAAW,UAAkD;AACpE,SAAO,CAAC,EAAE,YAAY,OAAO,aAAa,YAAY,OAAO,YAAY;AAC3E;AAEO,SAAS,oBAAuB,UAA6D;AAClG,QAAM,WAAW,WAAW,QAAQ,IAAI,SAAS,OAAO,QAAQ,EAAE,IAAI,SAAS,OAAO,aAAa,EAAE;AAErG,SAAO,IAAI,eAAe;AAAA,IACxB,MAAM,KAAK,YAAY;AACrB,YAAM,SAAS,MAAM,SAAS,KAAK;AAEnC,UAAI,OAAO,MAAM;AACf,mBAAW,MAAM;AAAA,MACnB,OAAO;AACL,mBAAW,QAAQ,OAAO,KAAK;AAAA,MACjC;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":[]}
|