@cspell/cspell-pipe 6.26.3 → 6.27.0
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/dist/cjs/helpers/distribute.js +37 -0
- package/dist/cjs/helpers/index.js +17 -0
- package/dist/cjs/helpers/interleave.js +22 -0
- package/dist/cjs/helpers/iteratorToIterable.js +18 -0
- package/dist/cjs/helpers/toArray.js +21 -0
- package/dist/cjs/helpers/toAsyncIterable.js +19 -0
- package/dist/cjs/helpers/util.js +15 -0
- package/dist/cjs/index.js +60 -0
- package/dist/cjs/internalTypes.js +3 -0
- package/dist/cjs/operators/{append.cjs → append.js} +8 -10
- package/dist/cjs/operators/await.js +13 -0
- package/dist/cjs/operators/{combine.cjs → combine.js} +5 -4
- package/dist/cjs/operators/{concatMap.cjs → concatMap.js} +8 -16
- package/dist/cjs/operators/{filter.cjs → filter.js} +8 -10
- package/dist/cjs/operators/{first.cjs → first.js} +8 -10
- package/dist/cjs/operators/{flatten.cjs → flatten.js} +8 -16
- package/dist/cjs/operators/index.js +60 -0
- package/dist/cjs/operators/joinStrings.js +28 -0
- package/dist/cjs/operators/{last.cjs → last.js} +8 -10
- package/dist/cjs/operators/{map.cjs → map.js} +8 -16
- package/dist/cjs/operators/{reduce.cjs → reduce.js} +9 -20
- package/dist/cjs/operators/{skip.cjs → skip.js} +8 -16
- package/dist/cjs/operators/{take.cjs → take.js} +8 -16
- package/dist/cjs/operators/{tap.cjs → tap.js} +8 -16
- package/dist/cjs/operators/types.js +3 -0
- package/dist/cjs/operators/{unique.cjs → unique.js} +8 -16
- package/dist/cjs/pipe.js +15 -0
- package/dist/cjs/reduce.js +27 -0
- package/dist/cjs/sync/index.js +26 -0
- package/dist/{cjs/operators/helpers/distribute.d.ts → esm/helpers/distribute.d.mts} +1 -1
- package/dist/esm/helpers/distribute.mjs +33 -0
- package/dist/esm/helpers/index.d.mts +7 -0
- package/dist/esm/helpers/index.mjs +7 -0
- package/dist/{cjs/operators/helpers/interleave.d.ts → esm/helpers/interleave.d.mts} +1 -1
- package/dist/esm/helpers/interleave.mjs +18 -0
- package/dist/{cjs/operators/helpers/iteratorToIterable.d.ts → esm/helpers/iteratorToIterable.d.mts} +1 -1
- package/dist/esm/helpers/iteratorToIterable.mjs +13 -0
- package/dist/{cjs/operators/helpers/toArray.d.ts → esm/helpers/toArray.d.mts} +1 -1
- package/dist/esm/helpers/toArray.mjs +15 -0
- package/dist/{cjs/sync/helpers/toAsyncIterable.d.ts → esm/helpers/toAsyncIterable.d.mts} +2 -2
- package/dist/esm/helpers/toAsyncIterable.mjs +15 -0
- package/dist/{cjs/operators/helpers/util.d.ts → esm/helpers/util.d.mts} +2 -2
- package/dist/esm/helpers/util.mjs +10 -0
- package/dist/esm/index.d.mts +9 -0
- package/dist/esm/index.mjs +11 -0
- package/dist/{cjs/operators/internalTypes.d.ts → esm/internalTypes.d.mts} +1 -1
- package/dist/esm/internalTypes.mjs +2 -0
- package/dist/{cjs/sync/operators/append.d.ts → esm/operators/append.d.mts} +2 -2
- package/dist/esm/operators/append.mjs +36 -0
- package/dist/{cjs/operators/operators/await.d.ts → esm/operators/await.d.mts} +1 -1
- package/dist/{cjs/operators/await.cjs → esm/operators/await.mjs} +2 -5
- package/dist/{cjs/operators/operators/combine.d.ts → esm/operators/combine.d.mts} +3 -3
- package/dist/esm/operators/combine.mjs +19 -0
- package/dist/{cjs/operators/operators/concatMap.d.ts → esm/operators/concatMap.d.mts} +1 -1
- package/dist/esm/operators/concatMap.mjs +19 -0
- package/dist/{cjs/operators/operators/filter.d.ts → esm/operators/filter.d.mts} +2 -2
- package/dist/esm/operators/filter.mjs +30 -0
- package/dist/{cjs/operators/operators/first.d.ts → esm/operators/first.d.mts} +2 -2
- package/dist/esm/operators/first.mjs +34 -0
- package/dist/{cjs/operators/operators/flatten.d.ts → esm/operators/flatten.d.mts} +1 -1
- package/dist/esm/operators/flatten.mjs +19 -0
- package/dist/esm/operators/index.d.mts +17 -0
- package/dist/esm/operators/index.mjs +16 -0
- package/dist/{cjs/operators/operators/joinStrings.d.ts → esm/operators/joinStrings.d.mts} +1 -1
- package/dist/esm/operators/joinStrings.mjs +22 -0
- package/dist/{cjs/operators/operators/last.d.ts → esm/operators/last.d.mts} +2 -2
- package/dist/esm/operators/last.mjs +39 -0
- package/dist/{cjs/operators/operators/map.d.ts → esm/operators/map.d.mts} +1 -1
- package/dist/esm/operators/map.mjs +19 -0
- package/dist/{cjs/operators/operators/reduce.d.ts → esm/operators/reduce.d.mts} +1 -1
- package/dist/esm/operators/reduce.mjs +49 -0
- package/dist/{cjs/operators/operators/skip.d.ts → esm/operators/skip.d.mts} +1 -1
- package/dist/esm/operators/skip.mjs +27 -0
- package/dist/{operators/take.d.ts → esm/operators/take.d.mts} +1 -1
- package/dist/esm/operators/take.mjs +31 -0
- package/dist/{cjs/sync/operators/tap.d.ts → esm/operators/tap.d.mts} +1 -1
- package/dist/esm/operators/tap.mjs +36 -0
- package/dist/{cjs/operators/operators/types.d.ts → esm/operators/types.d.mts} +1 -1
- package/dist/esm/operators/types.mjs +2 -0
- package/dist/{operators/unique.d.ts → esm/operators/unique.d.mts} +1 -1
- package/dist/esm/operators/unique.mjs +53 -0
- package/dist/{cjs/operators/pipe.d.ts → esm/pipe.d.mts} +2 -2
- package/dist/esm/pipe.mjs +10 -0
- package/dist/{cjs/sync/reduce.d.ts → esm/reduce.d.mts} +2 -2
- package/dist/esm/reduce.mjs +21 -0
- package/dist/{cjs/operators/sync/index.d.ts → esm/sync/index.d.mts} +6 -6
- package/dist/{cjs/sync/sync/index.d.ts → esm/sync/index.mjs} +5 -6
- package/package.json +41 -57
- package/dist/cjs/index.cjs +0 -644
- package/dist/cjs/operators/helpers/index.d.ts +0 -7
- package/dist/cjs/operators/helpers/toAsyncIterable.d.ts +0 -11
- package/dist/cjs/operators/index.cjs +0 -508
- package/dist/cjs/operators/joinStrings.cjs +0 -49
- package/dist/cjs/operators/operators/append.d.ts +0 -15
- package/dist/cjs/operators/operators/index.d.ts +0 -17
- package/dist/cjs/operators/operators/take.d.ts +0 -8
- package/dist/cjs/operators/operators/tap.d.ts +0 -19
- package/dist/cjs/operators/operators/unique.d.ts +0 -4
- package/dist/cjs/operators/types.cjs +0 -2
- package/dist/cjs/sync/helpers/distribute.d.ts +0 -13
- package/dist/cjs/sync/helpers/index.d.ts +0 -7
- package/dist/cjs/sync/helpers/interleave.d.ts +0 -2
- package/dist/cjs/sync/helpers/iteratorToIterable.d.ts +0 -3
- package/dist/cjs/sync/helpers/toArray.d.ts +0 -6
- package/dist/cjs/sync/helpers/util.d.ts +0 -4
- package/dist/cjs/sync/index.cjs +0 -245
- package/dist/cjs/sync/internalTypes.d.ts +0 -17
- package/dist/cjs/sync/operators/await.d.ts +0 -2
- package/dist/cjs/sync/operators/combine.d.ts +0 -23
- package/dist/cjs/sync/operators/concatMap.d.ts +0 -4
- package/dist/cjs/sync/operators/filter.d.ts +0 -10
- package/dist/cjs/sync/operators/first.d.ts +0 -10
- package/dist/cjs/sync/operators/flatten.d.ts +0 -4
- package/dist/cjs/sync/operators/index.d.ts +0 -17
- package/dist/cjs/sync/operators/joinStrings.d.ts +0 -4
- package/dist/cjs/sync/operators/last.d.ts +0 -10
- package/dist/cjs/sync/operators/map.d.ts +0 -4
- package/dist/cjs/sync/operators/reduce.d.ts +0 -7
- package/dist/cjs/sync/operators/skip.d.ts +0 -4
- package/dist/cjs/sync/operators/take.d.ts +0 -8
- package/dist/cjs/sync/operators/types.d.ts +0 -4
- package/dist/cjs/sync/operators/unique.d.ts +0 -4
- package/dist/cjs/sync/pipe.d.ts +0 -20
- package/dist/helpers/distribute.d.ts +0 -13
- package/dist/helpers/index.d.ts +0 -7
- package/dist/helpers/interleave.d.ts +0 -2
- package/dist/helpers/iteratorToIterable.d.ts +0 -3
- package/dist/helpers/toArray.d.ts +0 -6
- package/dist/helpers/toAsyncIterable.d.ts +0 -11
- package/dist/helpers/util.d.ts +0 -4
- package/dist/index.d.ts +0 -9
- package/dist/internalTypes.d.ts +0 -17
- package/dist/operators/append.d.ts +0 -15
- package/dist/operators/await.d.ts +0 -2
- package/dist/operators/combine.d.ts +0 -23
- package/dist/operators/concatMap.d.ts +0 -4
- package/dist/operators/filter.d.ts +0 -10
- package/dist/operators/first.d.ts +0 -10
- package/dist/operators/flatten.d.ts +0 -4
- package/dist/operators/index.d.ts +0 -17
- package/dist/operators/joinStrings.d.ts +0 -4
- package/dist/operators/last.d.ts +0 -10
- package/dist/operators/map.d.ts +0 -4
- package/dist/operators/reduce.d.ts +0 -7
- package/dist/operators/skip.d.ts +0 -4
- package/dist/operators/tap.d.ts +0 -19
- package/dist/operators/types.d.ts +0 -4
- package/dist/pipe.d.ts +0 -20
- package/dist/reduce.d.ts +0 -16
- package/dist/sync/index.d.ts +0 -6
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
while (!(n = iterator.next()).done) {
|
|
6
|
-
yield n.value;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
async function* asyncIteratorToAsyncIterable(iterator) {
|
|
10
|
-
let n;
|
|
11
|
-
while (!(n = await iterator.next()).done) {
|
|
12
|
-
yield n.value;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opReduceSync = exports.opReduceAsync = void 0;
|
|
4
|
+
const index_js_1 = require("../helpers/index.js");
|
|
16
5
|
function opReduceAsync(reduceFn, initialValue) {
|
|
17
6
|
async function* reduce(head, tail) {
|
|
18
7
|
for await (const v of tail) {
|
|
@@ -28,6 +17,7 @@ function opReduceAsync(reduceFn, initialValue) {
|
|
|
28
17
|
}
|
|
29
18
|
return fn;
|
|
30
19
|
}
|
|
20
|
+
exports.opReduceAsync = opReduceAsync;
|
|
31
21
|
function opReduceSync(reduceFn, initialValue) {
|
|
32
22
|
function* reduce(head, tail) {
|
|
33
23
|
for (const v of tail) {
|
|
@@ -43,23 +33,22 @@ function opReduceSync(reduceFn, initialValue) {
|
|
|
43
33
|
}
|
|
44
34
|
return fn;
|
|
45
35
|
}
|
|
36
|
+
exports.opReduceSync = opReduceSync;
|
|
46
37
|
function headTail(iter) {
|
|
47
38
|
const iterator = iter[Symbol.iterator]();
|
|
48
39
|
const first = iterator.next();
|
|
49
40
|
if (first.done)
|
|
50
41
|
return undefined;
|
|
51
|
-
return { head: first.value, tail: iteratorToIterable(iterator) };
|
|
42
|
+
return { head: first.value, tail: (0, index_js_1.iteratorToIterable)(iterator) };
|
|
52
43
|
}
|
|
53
44
|
async function headTailAsync(iter) {
|
|
54
45
|
const iterator = isIterable(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator]();
|
|
55
46
|
const first = await iterator.next();
|
|
56
47
|
if (first.done)
|
|
57
48
|
return undefined;
|
|
58
|
-
return { head: first.value, tail: asyncIteratorToAsyncIterable(iterator) };
|
|
49
|
+
return { head: first.value, tail: (0, index_js_1.asyncIteratorToAsyncIterable)(iterator) };
|
|
59
50
|
}
|
|
60
51
|
function isIterable(i) {
|
|
61
52
|
return typeof i[Symbol.iterator] === 'function';
|
|
62
53
|
}
|
|
63
|
-
|
|
64
|
-
exports.opReduceAsync = opReduceAsync;
|
|
65
|
-
exports.opReduceSync = opReduceSync;
|
|
54
|
+
//# sourceMappingURL=reduce.js.map
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return isAsyncIterable(i) ? asyncFn(i) : syncFn(i);
|
|
6
|
-
}
|
|
7
|
-
return _;
|
|
8
|
-
}
|
|
9
|
-
function isAsyncIterable(i) {
|
|
10
|
-
return typeof i[Symbol.asyncIterator] === 'function';
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opSkip = exports.opSkipSync = exports.opSkipAsync = void 0;
|
|
4
|
+
const util_js_1 = require("../helpers/util.js");
|
|
13
5
|
function opSkipAsync(count) {
|
|
14
6
|
async function* fn(iter) {
|
|
15
7
|
for await (const v of iter) {
|
|
@@ -22,6 +14,7 @@ function opSkipAsync(count) {
|
|
|
22
14
|
}
|
|
23
15
|
return fn;
|
|
24
16
|
}
|
|
17
|
+
exports.opSkipAsync = opSkipAsync;
|
|
25
18
|
function opSkipSync(count) {
|
|
26
19
|
function* fn(iter) {
|
|
27
20
|
for (const v of iter) {
|
|
@@ -34,8 +27,7 @@ function opSkipSync(count) {
|
|
|
34
27
|
}
|
|
35
28
|
return fn;
|
|
36
29
|
}
|
|
37
|
-
const opSkip = (count) => toPipeFn(opSkipSync(count), opSkipAsync(count));
|
|
38
|
-
|
|
39
|
-
exports.opSkip = opSkip;
|
|
40
|
-
exports.opSkipAsync = opSkipAsync;
|
|
41
30
|
exports.opSkipSync = opSkipSync;
|
|
31
|
+
const opSkip = (count) => (0, util_js_1.toPipeFn)(opSkipSync(count), opSkipAsync(count));
|
|
32
|
+
exports.opSkip = opSkip;
|
|
33
|
+
//# sourceMappingURL=skip.js.map
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return isAsyncIterable(i) ? asyncFn(i) : syncFn(i);
|
|
6
|
-
}
|
|
7
|
-
return _;
|
|
8
|
-
}
|
|
9
|
-
function isAsyncIterable(i) {
|
|
10
|
-
return typeof i[Symbol.asyncIterator] === 'function';
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opTake = exports.opTakeSync = exports.opTakeAsync = void 0;
|
|
4
|
+
const util_js_1 = require("../helpers/util.js");
|
|
13
5
|
function opTakeAsync(count) {
|
|
14
6
|
async function* fn(iter) {
|
|
15
7
|
if (count <= 0)
|
|
@@ -22,6 +14,7 @@ function opTakeAsync(count) {
|
|
|
22
14
|
}
|
|
23
15
|
return fn;
|
|
24
16
|
}
|
|
17
|
+
exports.opTakeAsync = opTakeAsync;
|
|
25
18
|
function opTakeSync(count) {
|
|
26
19
|
function* fn(iter) {
|
|
27
20
|
if (count <= 0)
|
|
@@ -34,12 +27,11 @@ function opTakeSync(count) {
|
|
|
34
27
|
}
|
|
35
28
|
return fn;
|
|
36
29
|
}
|
|
30
|
+
exports.opTakeSync = opTakeSync;
|
|
37
31
|
/**
|
|
38
32
|
* Consume only the first `count` number from the iterable.
|
|
39
33
|
* @param count - number to take
|
|
40
34
|
*/
|
|
41
|
-
const opTake = (count) => toPipeFn(opTakeSync(count), opTakeAsync(count));
|
|
42
|
-
|
|
35
|
+
const opTake = (count) => (0, util_js_1.toPipeFn)(opTakeSync(count), opTakeAsync(count));
|
|
43
36
|
exports.opTake = opTake;
|
|
44
|
-
|
|
45
|
-
exports.opTakeSync = opTakeSync;
|
|
37
|
+
//# sourceMappingURL=take.js.map
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return isAsyncIterable(i) ? asyncFn(i) : syncFn(i);
|
|
6
|
-
}
|
|
7
|
-
return _;
|
|
8
|
-
}
|
|
9
|
-
function isAsyncIterable(i) {
|
|
10
|
-
return typeof i[Symbol.asyncIterator] === 'function';
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opTap = exports.opTapSync = exports.opTapAsync = void 0;
|
|
4
|
+
const util_js_1 = require("../helpers/util.js");
|
|
13
5
|
/**
|
|
14
6
|
* Tap allows you to listen on values, without modifying them.
|
|
15
7
|
*
|
|
@@ -24,6 +16,7 @@ function opTapAsync(tapFn) {
|
|
|
24
16
|
}
|
|
25
17
|
return fn;
|
|
26
18
|
}
|
|
19
|
+
exports.opTapAsync = opTapAsync;
|
|
27
20
|
/**
|
|
28
21
|
* Tap allows you to listen on values, without modifying them.
|
|
29
22
|
*
|
|
@@ -38,13 +31,12 @@ function opTapSync(tapFn) {
|
|
|
38
31
|
}
|
|
39
32
|
return fn;
|
|
40
33
|
}
|
|
34
|
+
exports.opTapSync = opTapSync;
|
|
41
35
|
/**
|
|
42
36
|
* Tap allows you to listen on values, without modifying them.
|
|
43
37
|
*
|
|
44
38
|
* @param fn - function to call for each value.
|
|
45
39
|
*/
|
|
46
|
-
const opTap = (fn) => toPipeFn(opTapSync(fn), opTapAsync(fn));
|
|
47
|
-
|
|
40
|
+
const opTap = (fn) => (0, util_js_1.toPipeFn)(opTapSync(fn), opTapAsync(fn));
|
|
48
41
|
exports.opTap = opTap;
|
|
49
|
-
|
|
50
|
-
exports.opTapSync = opTapSync;
|
|
42
|
+
//# sourceMappingURL=tap.js.map
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return isAsyncIterable(i) ? asyncFn(i) : syncFn(i);
|
|
6
|
-
}
|
|
7
|
-
return _;
|
|
8
|
-
}
|
|
9
|
-
function isAsyncIterable(i) {
|
|
10
|
-
return typeof i[Symbol.asyncIterator] === 'function';
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opUnique = exports.opUniqueSync = exports.opUniqueAsync = void 0;
|
|
4
|
+
const util_js_1 = require("../helpers/util.js");
|
|
13
5
|
function opUniqueAsync(k) {
|
|
14
6
|
function fnK(k) {
|
|
15
7
|
async function* fn(iter) {
|
|
@@ -35,6 +27,7 @@ function opUniqueAsync(k) {
|
|
|
35
27
|
}
|
|
36
28
|
return k ? fnK(k) : fn;
|
|
37
29
|
}
|
|
30
|
+
exports.opUniqueAsync = opUniqueAsync;
|
|
38
31
|
function opUniqueSync(k) {
|
|
39
32
|
function fnK(key) {
|
|
40
33
|
function* fn(iter) {
|
|
@@ -60,8 +53,7 @@ function opUniqueSync(k) {
|
|
|
60
53
|
}
|
|
61
54
|
return k ? fnK(k) : fn;
|
|
62
55
|
}
|
|
63
|
-
const opUnique = (getKey) => toPipeFn(opUniqueSync(getKey), opUniqueAsync(getKey));
|
|
64
|
-
|
|
65
|
-
exports.opUnique = opUnique;
|
|
66
|
-
exports.opUniqueAsync = opUniqueAsync;
|
|
67
56
|
exports.opUniqueSync = opUniqueSync;
|
|
57
|
+
const opUnique = (getKey) => (0, util_js_1.toPipeFn)(opUniqueSync(getKey), opUniqueAsync(getKey));
|
|
58
|
+
exports.opUnique = opUnique;
|
|
59
|
+
//# sourceMappingURL=unique.js.map
|
package/dist/cjs/pipe.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pipeSync = exports.pipeAsync = void 0;
|
|
4
|
+
const index_js_1 = require("./helpers/index.js");
|
|
5
|
+
const index_js_2 = require("./operators/index.js");
|
|
6
|
+
function pipeAsync(i, ...fns) {
|
|
7
|
+
const iter = (0, index_js_1.toAsyncIterable)(i);
|
|
8
|
+
return (0, index_js_2.opCombineAsync)(...fns)(iter);
|
|
9
|
+
}
|
|
10
|
+
exports.pipeAsync = pipeAsync;
|
|
11
|
+
function pipeSync(i, ...fns) {
|
|
12
|
+
return (0, index_js_2.opCombineSync)(...fns)(i);
|
|
13
|
+
}
|
|
14
|
+
exports.pipeSync = pipeSync;
|
|
15
|
+
//# sourceMappingURL=pipe.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reduce = exports.reduceAsync = exports.reduceSync = void 0;
|
|
4
|
+
const index_js_1 = require("./helpers/index.js");
|
|
5
|
+
const toArray_js_1 = require("./helpers/toArray.js");
|
|
6
|
+
const index_js_2 = require("./operators/index.js");
|
|
7
|
+
const pipe_js_1 = require("./pipe.js");
|
|
8
|
+
function reduceSync(iter, reduceFn, initialValue) {
|
|
9
|
+
const i = initialValue === undefined
|
|
10
|
+
? (0, pipe_js_1.pipeSync)(iter, (0, index_js_2.opReduceSync)(reduceFn))
|
|
11
|
+
: (0, pipe_js_1.pipeSync)(iter, (0, index_js_2.opReduceSync)(reduceFn, initialValue));
|
|
12
|
+
return [...i][0];
|
|
13
|
+
}
|
|
14
|
+
exports.reduceSync = reduceSync;
|
|
15
|
+
async function reduceAsync(iter, reduceFn, initialValue) {
|
|
16
|
+
const i = initialValue === undefined
|
|
17
|
+
? (0, pipe_js_1.pipeAsync)(iter, (0, index_js_2.opReduceAsync)(reduceFn))
|
|
18
|
+
: (0, pipe_js_1.pipeAsync)(iter, (0, index_js_2.opReduceAsync)(reduceFn, initialValue));
|
|
19
|
+
const arr = await (0, toArray_js_1.toArrayAsync)(i);
|
|
20
|
+
return arr[0];
|
|
21
|
+
}
|
|
22
|
+
exports.reduceAsync = reduceAsync;
|
|
23
|
+
function reduce(iter, reduceFn, initialValue) {
|
|
24
|
+
return (0, index_js_1.isAsyncIterable)(iter) ? reduceAsync(iter, reduceFn, initialValue) : reduceSync(iter, reduceFn, initialValue);
|
|
25
|
+
}
|
|
26
|
+
exports.reduce = reduce;
|
|
27
|
+
//# sourceMappingURL=reduce.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reduce = exports.pipeSync = exports.pipe = exports.opUnique = exports.opTap = exports.opTake = exports.opSkip = exports.opReduce = exports.opMap = exports.opLast = exports.opJoinStrings = exports.opFlatten = exports.opFirst = exports.opFilter = exports.opConcatMap = exports.opCombine = exports.opAppend = exports.toArray = void 0;
|
|
4
|
+
var toArray_js_1 = require("../helpers/toArray.js");
|
|
5
|
+
Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return toArray_js_1.toArraySync; } });
|
|
6
|
+
var index_js_1 = require("../operators/index.js");
|
|
7
|
+
Object.defineProperty(exports, "opAppend", { enumerable: true, get: function () { return index_js_1.opAppendSync; } });
|
|
8
|
+
Object.defineProperty(exports, "opCombine", { enumerable: true, get: function () { return index_js_1.opCombineSync; } });
|
|
9
|
+
Object.defineProperty(exports, "opConcatMap", { enumerable: true, get: function () { return index_js_1.opConcatMapSync; } });
|
|
10
|
+
Object.defineProperty(exports, "opFilter", { enumerable: true, get: function () { return index_js_1.opFilterSync; } });
|
|
11
|
+
Object.defineProperty(exports, "opFirst", { enumerable: true, get: function () { return index_js_1.opFirstSync; } });
|
|
12
|
+
Object.defineProperty(exports, "opFlatten", { enumerable: true, get: function () { return index_js_1.opFlattenSync; } });
|
|
13
|
+
Object.defineProperty(exports, "opJoinStrings", { enumerable: true, get: function () { return index_js_1.opJoinStringsSync; } });
|
|
14
|
+
Object.defineProperty(exports, "opLast", { enumerable: true, get: function () { return index_js_1.opLastSync; } });
|
|
15
|
+
Object.defineProperty(exports, "opMap", { enumerable: true, get: function () { return index_js_1.opMapSync; } });
|
|
16
|
+
Object.defineProperty(exports, "opReduce", { enumerable: true, get: function () { return index_js_1.opReduceSync; } });
|
|
17
|
+
Object.defineProperty(exports, "opSkip", { enumerable: true, get: function () { return index_js_1.opSkipSync; } });
|
|
18
|
+
Object.defineProperty(exports, "opTake", { enumerable: true, get: function () { return index_js_1.opTakeSync; } });
|
|
19
|
+
Object.defineProperty(exports, "opTap", { enumerable: true, get: function () { return index_js_1.opTapSync; } });
|
|
20
|
+
Object.defineProperty(exports, "opUnique", { enumerable: true, get: function () { return index_js_1.opUniqueSync; } });
|
|
21
|
+
var pipe_js_1 = require("../pipe.js");
|
|
22
|
+
Object.defineProperty(exports, "pipe", { enumerable: true, get: function () { return pipe_js_1.pipeSync; } });
|
|
23
|
+
Object.defineProperty(exports, "pipeSync", { enumerable: true, get: function () { return pipe_js_1.pipeSync; } });
|
|
24
|
+
var reduce_js_1 = require("../reduce.js");
|
|
25
|
+
Object.defineProperty(exports, "reduce", { enumerable: true, get: function () { return reduce_js_1.reduceSync; } });
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -10,4 +10,4 @@ export declare function toDistributableIterableSync<T>(iterable: Iterable<T>): I
|
|
|
10
10
|
* @param iterable - the iterable to share
|
|
11
11
|
*/
|
|
12
12
|
export declare const toDistributableIterable: typeof toDistributableIterableSync;
|
|
13
|
-
//# sourceMappingURL=distribute.d.
|
|
13
|
+
//# sourceMappingURL=distribute.d.mts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allows an iterable to be shared by multiple consumers.
|
|
3
|
+
* Each consumer takes from the iterable.
|
|
4
|
+
* @param iterable - the iterable to share
|
|
5
|
+
*/
|
|
6
|
+
export function toDistributableIterableSync(iterable) {
|
|
7
|
+
let lastValue;
|
|
8
|
+
let iter;
|
|
9
|
+
function getNext() {
|
|
10
|
+
if (lastValue && lastValue.done) {
|
|
11
|
+
return { ...lastValue };
|
|
12
|
+
}
|
|
13
|
+
iter = iter || iterable[Symbol.iterator]();
|
|
14
|
+
lastValue = iter.next();
|
|
15
|
+
return lastValue;
|
|
16
|
+
}
|
|
17
|
+
function* iterableFn() {
|
|
18
|
+
let next;
|
|
19
|
+
while (!(next = getNext()).done) {
|
|
20
|
+
yield next.value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
[Symbol.iterator]: iterableFn,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Allows an iterable to be shared by multiple consumers.
|
|
29
|
+
* Each consumer takes from the iterable.
|
|
30
|
+
* @param iterable - the iterable to share
|
|
31
|
+
*/
|
|
32
|
+
export const toDistributableIterable = toDistributableIterableSync;
|
|
33
|
+
//# sourceMappingURL=distribute.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { toDistributableIterable } from './distribute.mjs';
|
|
2
|
+
export { interleave } from './interleave.mjs';
|
|
3
|
+
export { asyncIteratorToAsyncIterable, iteratorToIterable } from './iteratorToIterable.mjs';
|
|
4
|
+
export { toArray } from './toArray.mjs';
|
|
5
|
+
export { toAsyncIterable } from './toAsyncIterable.mjs';
|
|
6
|
+
export { isAsyncIterable } from './util.mjs';
|
|
7
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { toDistributableIterable } from './distribute.mjs';
|
|
2
|
+
export { interleave } from './interleave.mjs';
|
|
3
|
+
export { asyncIteratorToAsyncIterable, iteratorToIterable } from './iteratorToIterable.mjs';
|
|
4
|
+
export { toArray } from './toArray.mjs';
|
|
5
|
+
export { toAsyncIterable } from './toAsyncIterable.mjs';
|
|
6
|
+
export { isAsyncIterable } from './util.mjs';
|
|
7
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function interleave<T>(a: Iterable<T>, b: Iterable<T>): Iterable<T>;
|
|
2
|
-
//# sourceMappingURL=interleave.d.
|
|
2
|
+
//# sourceMappingURL=interleave.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function* interleave(a, b) {
|
|
2
|
+
const ai = a[Symbol.iterator]();
|
|
3
|
+
const bi = b[Symbol.iterator]();
|
|
4
|
+
for (let aNext = ai.next(); !aNext.done; aNext = ai.next()) {
|
|
5
|
+
yield aNext.value;
|
|
6
|
+
const bNext = bi.next();
|
|
7
|
+
if (bNext.done)
|
|
8
|
+
break;
|
|
9
|
+
yield bNext.value;
|
|
10
|
+
}
|
|
11
|
+
for (let aNext = ai.next(); !aNext.done; aNext = ai.next()) {
|
|
12
|
+
yield aNext.value;
|
|
13
|
+
}
|
|
14
|
+
for (let bNext = bi.next(); !bNext.done; bNext = bi.next()) {
|
|
15
|
+
yield bNext.value;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=interleave.mjs.map
|
package/dist/{cjs/operators/helpers/iteratorToIterable.d.ts → esm/helpers/iteratorToIterable.d.mts}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function iteratorToIterable<T>(iterator: Iterator<T>): Iterable<T>;
|
|
2
2
|
export declare function asyncIteratorToAsyncIterable<T>(iterator: AsyncIterator<T> | Iterator<T>): AsyncIterable<T>;
|
|
3
|
-
//# sourceMappingURL=iteratorToIterable.d.
|
|
3
|
+
//# sourceMappingURL=iteratorToIterable.d.mts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function* iteratorToIterable(iterator) {
|
|
2
|
+
let n;
|
|
3
|
+
while (!(n = iterator.next()).done) {
|
|
4
|
+
yield n.value;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export async function* asyncIteratorToAsyncIterable(iterator) {
|
|
8
|
+
let n;
|
|
9
|
+
while (!(n = await iterator.next()).done) {
|
|
10
|
+
yield n.value;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=iteratorToIterable.mjs.map
|
|
@@ -3,4 +3,4 @@ export declare function toArray<T>(i: Iterable<T>): T[];
|
|
|
3
3
|
export declare function toArray<T>(i: Iterable<T> | AsyncIterable<T>): T[] | Promise<Awaited<T>[]>;
|
|
4
4
|
export declare function toArraySync<T>(iter: Iterable<T>): T[];
|
|
5
5
|
export declare function toArrayAsync<T>(iter: AsyncIterable<T>): Promise<Awaited<T>[]>;
|
|
6
|
-
//# sourceMappingURL=toArray.d.
|
|
6
|
+
//# sourceMappingURL=toArray.d.mts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isAsyncIterable } from './util.mjs';
|
|
2
|
+
export function toArray(i) {
|
|
3
|
+
return isAsyncIterable(i) ? toArrayAsync(i) : toArraySync(i);
|
|
4
|
+
}
|
|
5
|
+
export function toArraySync(iter) {
|
|
6
|
+
return [...iter];
|
|
7
|
+
}
|
|
8
|
+
export async function toArrayAsync(iter) {
|
|
9
|
+
const collection = [];
|
|
10
|
+
for await (const i of iter) {
|
|
11
|
+
collection.push(i);
|
|
12
|
+
}
|
|
13
|
+
return collection;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=toArray.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyIterable } from '../internalTypes.
|
|
1
|
+
import type { AnyIterable } from '../internalTypes.mjs';
|
|
2
2
|
export declare function mergeAsyncIterables<T>(iter: Iterable<T>): AsyncIterable<T>;
|
|
3
3
|
export declare function mergeAsyncIterables<T>(iter: AsyncIterable<T>): AsyncIterable<T>;
|
|
4
4
|
export declare function mergeAsyncIterables<T>(iter: Promise<Iterable<T>>): AsyncIterable<T>;
|
|
@@ -8,4 +8,4 @@ export declare function mergeAsyncIterables<T>(iter: AnyIterable<T>, ...rest: An
|
|
|
8
8
|
* Convert one or more iterables to an AsyncIterable
|
|
9
9
|
*/
|
|
10
10
|
export declare const toAsyncIterable: typeof mergeAsyncIterables;
|
|
11
|
-
//# sourceMappingURL=toAsyncIterable.d.
|
|
11
|
+
//# sourceMappingURL=toAsyncIterable.d.mts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge multiple iterables into an AsyncIterable
|
|
3
|
+
* @param iter - initial iterable.
|
|
4
|
+
* @param rest - iterables to merge.
|
|
5
|
+
*/
|
|
6
|
+
export async function* mergeAsyncIterables(iter, ...rest) {
|
|
7
|
+
for await (const i of [iter, ...rest]) {
|
|
8
|
+
yield* i;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Convert one or more iterables to an AsyncIterable
|
|
13
|
+
*/
|
|
14
|
+
export const toAsyncIterable = mergeAsyncIterables;
|
|
15
|
+
//# sourceMappingURL=toAsyncIterable.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyIterable, PipeFn, PipeFnAsync, PipeFnSync } from '../internalTypes.
|
|
1
|
+
import type { AnyIterable, PipeFn, PipeFnAsync, PipeFnSync } from '../internalTypes.mjs';
|
|
2
2
|
export declare function toPipeFn<T, U = T>(syncFn: PipeFnSync<T, U>, asyncFn: PipeFnAsync<T, U>): PipeFn<T, U>;
|
|
3
3
|
export declare function isAsyncIterable<T>(i: AnyIterable<T>): i is AsyncIterable<T>;
|
|
4
|
-
//# sourceMappingURL=util.d.
|
|
4
|
+
//# sourceMappingURL=util.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function toPipeFn(syncFn, asyncFn) {
|
|
2
|
+
function _(i) {
|
|
3
|
+
return isAsyncIterable(i) ? asyncFn(i) : syncFn(i);
|
|
4
|
+
}
|
|
5
|
+
return _;
|
|
6
|
+
}
|
|
7
|
+
export function isAsyncIterable(i) {
|
|
8
|
+
return typeof i[Symbol.asyncIterator] === 'function';
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=util.mjs.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _helpers from './helpers/index.mjs';
|
|
2
|
+
import * as _operators from './operators/index.mjs';
|
|
3
|
+
export { interleave, isAsyncIterable, toArray, toAsyncIterable, toDistributableIterable } from './helpers/index.mjs';
|
|
4
|
+
export { opAppend, opAwaitAsync, opConcatMap, opFilter, opFirst, opFlatten, opJoinStrings, opLast, opMap, opSkip, opTake, opTap, opUnique, } from './operators/index.mjs';
|
|
5
|
+
export { pipeAsync, pipeSync } from './pipe.mjs';
|
|
6
|
+
export { reduce, reduceAsync, reduceSync } from './reduce.mjs';
|
|
7
|
+
export declare const operators: typeof _operators;
|
|
8
|
+
export declare const helpers: typeof _helpers;
|
|
9
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _helpers from './helpers/index.mjs';
|
|
2
|
+
import * as _operators from './operators/index.mjs';
|
|
3
|
+
export { interleave, isAsyncIterable, toArray, toAsyncIterable, toDistributableIterable } from './helpers/index.mjs';
|
|
4
|
+
export { opAppend, opAwaitAsync, opConcatMap, opFilter, opFirst, opFlatten, opJoinStrings, opLast, opMap, opSkip, opTake, opTap, opUnique, } from './operators/index.mjs';
|
|
5
|
+
export { pipeAsync, pipeSync } from './pipe.mjs';
|
|
6
|
+
export { reduce, reduceAsync, reduceSync } from './reduce.mjs';
|
|
7
|
+
// eslint-disable-next-line unicorn/prefer-export-from
|
|
8
|
+
export const operators = _operators;
|
|
9
|
+
// eslint-disable-next-line unicorn/prefer-export-from
|
|
10
|
+
export const helpers = _helpers;
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -14,4 +14,4 @@ export type AnyIterable<T> = Iterable<T> | AsyncIterable<T> | Promise<Iterable<T
|
|
|
14
14
|
export type PaFn<T, U> = PipeFnAsync<T, U> | ((i: AsyncIterable<T>) => AsyncIterable<U>);
|
|
15
15
|
export type PipeAsyncTx<T extends [...any]> = T extends [infer Left, infer Right, ...infer Rest] ? Rest extends [any, ...any] ? [PaFn<Left, Right>, ...PipeAsyncTx<[Right, ...Rest]>] : [PaFn<Left, Right>] : never;
|
|
16
16
|
export type PipeSyncTx<T extends [...any]> = T extends [infer Left, infer Right, ...infer Rest] ? Rest extends [any, ...any] ? [PsFn<Left, Right>, ...PipeSyncTx<[Right, ...Rest]>] : [PsFn<Left, Right>] : never;
|
|
17
|
-
//# sourceMappingURL=internalTypes.d.
|
|
17
|
+
//# sourceMappingURL=internalTypes.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PipeFn } from '../internalTypes.
|
|
1
|
+
import type { PipeFn } from '../internalTypes.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* Append values onto the end of an iterable.
|
|
4
4
|
* @param iterablesToAppend - the iterables in the order to be appended.
|
|
@@ -12,4 +12,4 @@ export declare function opAppendAsync<T>(...iterablesToAppend: (AsyncIterable<T>
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function opAppendSync<T>(...iterablesToAppend: Iterable<T>[]): (iter: Iterable<T>) => Iterable<T>;
|
|
14
14
|
export declare function opAppend<T>(...iterablesToAppend: Iterable<T>[]): PipeFn<T, T>;
|
|
15
|
-
//# sourceMappingURL=append.d.
|
|
15
|
+
//# sourceMappingURL=append.d.mts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isAsyncIterable } from '../helpers/index.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Append values onto the end of an iterable.
|
|
4
|
+
* @param iterablesToAppend - the iterables in the order to be appended.
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export function opAppendAsync(...iterablesToAppend) {
|
|
8
|
+
async function* fn(iter) {
|
|
9
|
+
yield* iter;
|
|
10
|
+
for (const i of iterablesToAppend) {
|
|
11
|
+
yield* i;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return fn;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Append values onto the end of an iterable.
|
|
18
|
+
* @param iterablesToAppend - the iterables in the order to be appended.
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export function opAppendSync(...iterablesToAppend) {
|
|
22
|
+
function* fn(iter) {
|
|
23
|
+
yield* iter;
|
|
24
|
+
for (const i of iterablesToAppend) {
|
|
25
|
+
yield* i;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return fn;
|
|
29
|
+
}
|
|
30
|
+
export function opAppend(...iterablesToAppend) {
|
|
31
|
+
function _(i) {
|
|
32
|
+
return isAsyncIterable(i) ? opAppendAsync(...iterablesToAppend)(i) : opAppendSync(...iterablesToAppend)(i);
|
|
33
|
+
}
|
|
34
|
+
return _;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=append.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function opAwaitAsync<T>(): (iter: AsyncIterable<T>) => AsyncIterable<Awaited<T>>;
|
|
2
|
-
//# sourceMappingURL=await.d.
|
|
2
|
+
//# sourceMappingURL=await.d.mts.map
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
async function* _asyncAwait(iter) {
|
|
4
2
|
for await (const v of iter) {
|
|
5
3
|
yield v;
|
|
6
4
|
}
|
|
7
5
|
}
|
|
8
|
-
function opAwaitAsync() {
|
|
6
|
+
export function opAwaitAsync() {
|
|
9
7
|
return _asyncAwait;
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
exports.opAwaitAsync = opAwaitAsync;
|
|
9
|
+
//# sourceMappingURL=await.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PaFn, PipeAsyncTx, PipeSyncTx, PsFn } from '../internalTypes.
|
|
2
|
-
import type { OperatorAsync, OperatorSync } from './types.
|
|
1
|
+
import type { PaFn, PipeAsyncTx, PipeSyncTx, PsFn } from '../internalTypes.mjs';
|
|
2
|
+
import type { OperatorAsync, OperatorSync } from './types.mjs';
|
|
3
3
|
export declare function opCombineAsync<T>(): OperatorAsync<T>;
|
|
4
4
|
export declare function opCombineAsync<T, T0>(...f: PipeAsyncTx<[T, T0]>): OperatorAsync<T0>;
|
|
5
5
|
export declare function opCombineAsync<T, T0, T1>(...f: PipeAsyncTx<[T, T0, T1]>): OperatorAsync<T1>;
|
|
@@ -20,4 +20,4 @@ export declare function opCombineSync<T, T0, T1, T2, T3, T4, T5>(...f: PipeSyncT
|
|
|
20
20
|
export declare function opCombineSync<T, T0, T1, T2, T3, T4, T5, T6>(...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5, T6]>): OperatorSync<T6>;
|
|
21
21
|
export declare function opCombineSync<T, T0, T1, T2, T3, T4, T5, T6, T7>(...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5, T6, T7]>): OperatorSync<T7>;
|
|
22
22
|
export declare function opCombineSync<T>(...fns: PsFn<T, T>[]): OperatorSync<T>;
|
|
23
|
-
//# sourceMappingURL=combine.d.
|
|
23
|
+
//# sourceMappingURL=combine.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function opCombineAsync(...fns) {
|
|
2
|
+
function combine(iter) {
|
|
3
|
+
for (const fn of fns) {
|
|
4
|
+
iter = fn(iter);
|
|
5
|
+
}
|
|
6
|
+
return iter;
|
|
7
|
+
}
|
|
8
|
+
return combine;
|
|
9
|
+
}
|
|
10
|
+
export function opCombineSync(...fns) {
|
|
11
|
+
function combine(iter) {
|
|
12
|
+
for (const fn of fns) {
|
|
13
|
+
iter = fn(iter);
|
|
14
|
+
}
|
|
15
|
+
return iter;
|
|
16
|
+
}
|
|
17
|
+
return combine;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=combine.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function opConcatMapAsync<T, U = T>(mapFn: (v: T) => AsyncIterable<U> | Iterable<U>): (iter: AsyncIterable<T>) => AsyncIterable<U>;
|
|
2
2
|
export declare function opConcatMapSync<T, U = T>(mapFn: (v: T) => Iterable<U>): (iter: Iterable<T>) => Iterable<U>;
|
|
3
3
|
export declare const opConcatMap: <T, U>(fn: (v: T) => Iterable<U>) => import("../internalTypes.js").PipeFn<T, U>;
|
|
4
|
-
//# sourceMappingURL=concatMap.d.
|
|
4
|
+
//# sourceMappingURL=concatMap.d.mts.map
|