@cspell/cspell-pipe 7.0.0-alpha.2 → 7.0.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.
Files changed (175) hide show
  1. package/package.json +28 -38
  2. package/dist/cjs/helpers/distribute.js +0 -37
  3. package/dist/cjs/helpers/index.js +0 -17
  4. package/dist/cjs/helpers/interleave.js +0 -22
  5. package/dist/cjs/helpers/iteratorToIterable.js +0 -18
  6. package/dist/cjs/helpers/toArray.js +0 -21
  7. package/dist/cjs/helpers/toAsyncIterable.js +0 -19
  8. package/dist/cjs/helpers/util.js +0 -15
  9. package/dist/cjs/index.js +0 -60
  10. package/dist/cjs/internalTypes.js +0 -3
  11. package/dist/cjs/operators/append.js +0 -42
  12. package/dist/cjs/operators/await.js +0 -13
  13. package/dist/cjs/operators/combine.js +0 -24
  14. package/dist/cjs/operators/concatMap.js +0 -25
  15. package/dist/cjs/operators/filter.js +0 -36
  16. package/dist/cjs/operators/first.js +0 -40
  17. package/dist/cjs/operators/flatten.js +0 -25
  18. package/dist/cjs/operators/index.js +0 -60
  19. package/dist/cjs/operators/joinStrings.js +0 -28
  20. package/dist/cjs/operators/last.js +0 -45
  21. package/dist/cjs/operators/map.js +0 -25
  22. package/dist/cjs/operators/reduce.js +0 -54
  23. package/dist/cjs/operators/skip.js +0 -33
  24. package/dist/cjs/operators/take.js +0 -37
  25. package/dist/cjs/operators/tap.js +0 -42
  26. package/dist/cjs/operators/types.js +0 -3
  27. package/dist/cjs/operators/unique.js +0 -59
  28. package/dist/cjs/pipe.js +0 -15
  29. package/dist/cjs/reduce.js +0 -27
  30. package/dist/cjs/sync/index.js +0 -26
  31. package/dist/esm/helpers/distribute.d.mts +0 -13
  32. package/dist/esm/helpers/distribute.d.ts +0 -13
  33. package/dist/esm/helpers/distribute.mjs +0 -32
  34. package/dist/esm/helpers/index.d.mts +0 -7
  35. package/dist/esm/helpers/index.d.ts +0 -7
  36. package/dist/esm/helpers/index.mjs +0 -6
  37. package/dist/esm/helpers/interleave.d.mts +0 -2
  38. package/dist/esm/helpers/interleave.d.ts +0 -2
  39. package/dist/esm/helpers/interleave.mjs +0 -17
  40. package/dist/esm/helpers/iteratorToIterable.d.mts +0 -3
  41. package/dist/esm/helpers/iteratorToIterable.d.ts +0 -3
  42. package/dist/esm/helpers/iteratorToIterable.mjs +0 -12
  43. package/dist/esm/helpers/toArray.d.mts +0 -6
  44. package/dist/esm/helpers/toArray.d.ts +0 -6
  45. package/dist/esm/helpers/toArray.mjs +0 -14
  46. package/dist/esm/helpers/toAsyncIterable.d.mts +0 -11
  47. package/dist/esm/helpers/toAsyncIterable.d.ts +0 -11
  48. package/dist/esm/helpers/toAsyncIterable.mjs +0 -14
  49. package/dist/esm/helpers/util.d.mts +0 -4
  50. package/dist/esm/helpers/util.d.ts +0 -4
  51. package/dist/esm/helpers/util.mjs +0 -9
  52. package/dist/esm/index.d.mts +0 -9
  53. package/dist/esm/index.d.ts +0 -9
  54. package/dist/esm/index.mjs +0 -10
  55. package/dist/esm/internalTypes.d.mts +0 -17
  56. package/dist/esm/internalTypes.d.ts +0 -17
  57. package/dist/esm/internalTypes.mjs +0 -1
  58. package/dist/esm/operators/append.d.mts +0 -15
  59. package/dist/esm/operators/append.d.ts +0 -15
  60. package/dist/esm/operators/append.mjs +0 -35
  61. package/dist/esm/operators/await.d.mts +0 -2
  62. package/dist/esm/operators/await.d.ts +0 -2
  63. package/dist/esm/operators/await.mjs +0 -8
  64. package/dist/esm/operators/combine.d.mts +0 -23
  65. package/dist/esm/operators/combine.d.ts +0 -23
  66. package/dist/esm/operators/combine.mjs +0 -18
  67. package/dist/esm/operators/concatMap.d.mts +0 -4
  68. package/dist/esm/operators/concatMap.d.ts +0 -4
  69. package/dist/esm/operators/concatMap.mjs +0 -18
  70. package/dist/esm/operators/filter.d.mts +0 -10
  71. package/dist/esm/operators/filter.d.ts +0 -10
  72. package/dist/esm/operators/filter.mjs +0 -29
  73. package/dist/esm/operators/first.d.mts +0 -10
  74. package/dist/esm/operators/first.d.ts +0 -10
  75. package/dist/esm/operators/first.mjs +0 -33
  76. package/dist/esm/operators/flatten.d.mts +0 -4
  77. package/dist/esm/operators/flatten.d.ts +0 -4
  78. package/dist/esm/operators/flatten.mjs +0 -18
  79. package/dist/esm/operators/index.d.mts +0 -17
  80. package/dist/esm/operators/index.d.ts +0 -17
  81. package/dist/esm/operators/index.mjs +0 -15
  82. package/dist/esm/operators/joinStrings.d.mts +0 -4
  83. package/dist/esm/operators/joinStrings.d.ts +0 -4
  84. package/dist/esm/operators/joinStrings.mjs +0 -21
  85. package/dist/esm/operators/last.d.mts +0 -10
  86. package/dist/esm/operators/last.d.ts +0 -10
  87. package/dist/esm/operators/last.mjs +0 -38
  88. package/dist/esm/operators/map.d.mts +0 -4
  89. package/dist/esm/operators/map.d.ts +0 -4
  90. package/dist/esm/operators/map.mjs +0 -18
  91. package/dist/esm/operators/reduce.d.mts +0 -7
  92. package/dist/esm/operators/reduce.d.ts +0 -7
  93. package/dist/esm/operators/reduce.mjs +0 -48
  94. package/dist/esm/operators/skip.d.mts +0 -4
  95. package/dist/esm/operators/skip.d.ts +0 -4
  96. package/dist/esm/operators/skip.mjs +0 -26
  97. package/dist/esm/operators/take.d.mts +0 -8
  98. package/dist/esm/operators/take.d.ts +0 -8
  99. package/dist/esm/operators/take.mjs +0 -30
  100. package/dist/esm/operators/tap.d.mts +0 -19
  101. package/dist/esm/operators/tap.d.ts +0 -19
  102. package/dist/esm/operators/tap.mjs +0 -35
  103. package/dist/esm/operators/types.d.mts +0 -4
  104. package/dist/esm/operators/types.d.ts +0 -4
  105. package/dist/esm/operators/types.mjs +0 -1
  106. package/dist/esm/operators/unique.d.mts +0 -4
  107. package/dist/esm/operators/unique.d.ts +0 -4
  108. package/dist/esm/operators/unique.mjs +0 -52
  109. package/dist/esm/pipe.d.mts +0 -20
  110. package/dist/esm/pipe.d.ts +0 -20
  111. package/dist/esm/pipe.mjs +0 -9
  112. package/dist/esm/reduce.d.mts +0 -16
  113. package/dist/esm/reduce.d.ts +0 -16
  114. package/dist/esm/reduce.mjs +0 -20
  115. package/dist/esm/sync/index.d.mts +0 -6
  116. package/dist/esm/sync/index.d.ts +0 -6
  117. package/dist/esm/sync/index.mjs +0 -4
  118. /package/dist/{cjs/helpers → helpers}/distribute.d.ts +0 -0
  119. /package/dist/{esm/helpers → helpers}/distribute.js +0 -0
  120. /package/dist/{cjs/helpers → helpers}/index.d.ts +0 -0
  121. /package/dist/{esm/helpers → helpers}/index.js +0 -0
  122. /package/dist/{cjs/helpers → helpers}/interleave.d.ts +0 -0
  123. /package/dist/{esm/helpers → helpers}/interleave.js +0 -0
  124. /package/dist/{cjs/helpers → helpers}/iteratorToIterable.d.ts +0 -0
  125. /package/dist/{esm/helpers → helpers}/iteratorToIterable.js +0 -0
  126. /package/dist/{cjs/helpers → helpers}/toArray.d.ts +0 -0
  127. /package/dist/{esm/helpers → helpers}/toArray.js +0 -0
  128. /package/dist/{cjs/helpers → helpers}/toAsyncIterable.d.ts +0 -0
  129. /package/dist/{esm/helpers → helpers}/toAsyncIterable.js +0 -0
  130. /package/dist/{cjs/helpers → helpers}/util.d.ts +0 -0
  131. /package/dist/{esm/helpers → helpers}/util.js +0 -0
  132. /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
  133. /package/dist/{esm/index.js → index.js} +0 -0
  134. /package/dist/{cjs/internalTypes.d.ts → internalTypes.d.ts} +0 -0
  135. /package/dist/{esm/internalTypes.js → internalTypes.js} +0 -0
  136. /package/dist/{cjs/operators → operators}/append.d.ts +0 -0
  137. /package/dist/{esm/operators → operators}/append.js +0 -0
  138. /package/dist/{cjs/operators → operators}/await.d.ts +0 -0
  139. /package/dist/{esm/operators → operators}/await.js +0 -0
  140. /package/dist/{cjs/operators → operators}/combine.d.ts +0 -0
  141. /package/dist/{esm/operators → operators}/combine.js +0 -0
  142. /package/dist/{cjs/operators → operators}/concatMap.d.ts +0 -0
  143. /package/dist/{esm/operators → operators}/concatMap.js +0 -0
  144. /package/dist/{cjs/operators → operators}/filter.d.ts +0 -0
  145. /package/dist/{esm/operators → operators}/filter.js +0 -0
  146. /package/dist/{cjs/operators → operators}/first.d.ts +0 -0
  147. /package/dist/{esm/operators → operators}/first.js +0 -0
  148. /package/dist/{cjs/operators → operators}/flatten.d.ts +0 -0
  149. /package/dist/{esm/operators → operators}/flatten.js +0 -0
  150. /package/dist/{cjs/operators → operators}/index.d.ts +0 -0
  151. /package/dist/{esm/operators → operators}/index.js +0 -0
  152. /package/dist/{cjs/operators → operators}/joinStrings.d.ts +0 -0
  153. /package/dist/{esm/operators → operators}/joinStrings.js +0 -0
  154. /package/dist/{cjs/operators → operators}/last.d.ts +0 -0
  155. /package/dist/{esm/operators → operators}/last.js +0 -0
  156. /package/dist/{cjs/operators → operators}/map.d.ts +0 -0
  157. /package/dist/{esm/operators → operators}/map.js +0 -0
  158. /package/dist/{cjs/operators → operators}/reduce.d.ts +0 -0
  159. /package/dist/{esm/operators → operators}/reduce.js +0 -0
  160. /package/dist/{cjs/operators → operators}/skip.d.ts +0 -0
  161. /package/dist/{esm/operators → operators}/skip.js +0 -0
  162. /package/dist/{cjs/operators → operators}/take.d.ts +0 -0
  163. /package/dist/{esm/operators → operators}/take.js +0 -0
  164. /package/dist/{cjs/operators → operators}/tap.d.ts +0 -0
  165. /package/dist/{esm/operators → operators}/tap.js +0 -0
  166. /package/dist/{cjs/operators → operators}/types.d.ts +0 -0
  167. /package/dist/{esm/operators → operators}/types.js +0 -0
  168. /package/dist/{cjs/operators → operators}/unique.d.ts +0 -0
  169. /package/dist/{esm/operators → operators}/unique.js +0 -0
  170. /package/dist/{cjs/pipe.d.ts → pipe.d.ts} +0 -0
  171. /package/dist/{esm/pipe.js → pipe.js} +0 -0
  172. /package/dist/{cjs/reduce.d.ts → reduce.d.ts} +0 -0
  173. /package/dist/{esm/reduce.js → reduce.js} +0 -0
  174. /package/dist/{cjs/sync → sync}/index.d.ts +0 -0
  175. /package/dist/{esm/sync → sync}/index.js +0 -0
@@ -1,48 +0,0 @@
1
- import { asyncIteratorToAsyncIterable, iteratorToIterable } from '../helpers/index.mjs';
2
- export function opReduceAsync(reduceFn, initialValue) {
3
- async function* reduce(head, tail) {
4
- for await (const v of tail) {
5
- head = reduceFn(head, v);
6
- }
7
- yield head;
8
- }
9
- async function* fn(iter) {
10
- const ht = initialValue === undefined ? await headTailAsync(iter) : { head: await initialValue, tail: iter };
11
- if (!ht)
12
- return;
13
- yield* reduce(ht.head, ht.tail);
14
- }
15
- return fn;
16
- }
17
- export function opReduceSync(reduceFn, initialValue) {
18
- function* reduce(head, tail) {
19
- for (const v of tail) {
20
- head = reduceFn(head, v);
21
- }
22
- yield head;
23
- }
24
- function* fn(iter) {
25
- const ht = initialValue === undefined ? headTail(iter) : { head: initialValue, tail: iter };
26
- if (!ht)
27
- return;
28
- yield* reduce(ht.head, ht.tail);
29
- }
30
- return fn;
31
- }
32
- function headTail(iter) {
33
- const iterator = iter[Symbol.iterator]();
34
- const first = iterator.next();
35
- if (first.done)
36
- return undefined;
37
- return { head: first.value, tail: iteratorToIterable(iterator) };
38
- }
39
- async function headTailAsync(iter) {
40
- const iterator = isIterable(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator]();
41
- const first = await iterator.next();
42
- if (first.done)
43
- return undefined;
44
- return { head: first.value, tail: asyncIteratorToAsyncIterable(iterator) };
45
- }
46
- function isIterable(i) {
47
- return typeof i[Symbol.iterator] === 'function';
48
- }
@@ -1,4 +0,0 @@
1
- export declare function opSkipAsync<T>(count: number): (iter: AsyncIterable<T> | Iterable<T>) => AsyncIterable<T>;
2
- export declare function opSkipSync<T>(count: number): (iter: Iterable<T>) => Iterable<T>;
3
- export declare const opSkip: <T>(count: number) => import("../internalTypes.js").PipeFn<T, T>;
4
- //# sourceMappingURL=skip.d.mts.map
@@ -1,4 +0,0 @@
1
- export declare function opSkipAsync<T>(count: number): (iter: AsyncIterable<T> | Iterable<T>) => AsyncIterable<T>;
2
- export declare function opSkipSync<T>(count: number): (iter: Iterable<T>) => Iterable<T>;
3
- export declare const opSkip: <T>(count: number) => import("../internalTypes.js").PipeFn<T, T>;
4
- //# sourceMappingURL=skip.d.ts.map
@@ -1,26 +0,0 @@
1
- import { toPipeFn } from '../helpers/util.mjs';
2
- export function opSkipAsync(count) {
3
- async function* fn(iter) {
4
- for await (const v of iter) {
5
- if (count > 0) {
6
- --count;
7
- continue;
8
- }
9
- yield v;
10
- }
11
- }
12
- return fn;
13
- }
14
- export function opSkipSync(count) {
15
- function* fn(iter) {
16
- for (const v of iter) {
17
- if (count > 0) {
18
- --count;
19
- continue;
20
- }
21
- yield v;
22
- }
23
- }
24
- return fn;
25
- }
26
- export const opSkip = (count) => toPipeFn(opSkipSync(count), opSkipAsync(count));
@@ -1,8 +0,0 @@
1
- export declare function opTakeAsync<T>(count: number): (iter: AsyncIterable<T> | Iterable<T>) => AsyncIterable<T>;
2
- export declare function opTakeSync<T>(count: number): (iter: Iterable<T>) => Iterable<T>;
3
- /**
4
- * Consume only the first `count` number from the iterable.
5
- * @param count - number to take
6
- */
7
- export declare const opTake: <T>(count: number) => import("../internalTypes.js").PipeFn<T, T>;
8
- //# sourceMappingURL=take.d.mts.map
@@ -1,8 +0,0 @@
1
- export declare function opTakeAsync<T>(count: number): (iter: AsyncIterable<T> | Iterable<T>) => AsyncIterable<T>;
2
- export declare function opTakeSync<T>(count: number): (iter: Iterable<T>) => Iterable<T>;
3
- /**
4
- * Consume only the first `count` number from the iterable.
5
- * @param count - number to take
6
- */
7
- export declare const opTake: <T>(count: number) => import("../internalTypes.js").PipeFn<T, T>;
8
- //# sourceMappingURL=take.d.ts.map
@@ -1,30 +0,0 @@
1
- import { toPipeFn } from '../helpers/util.mjs';
2
- export function opTakeAsync(count) {
3
- async function* fn(iter) {
4
- if (count <= 0)
5
- return;
6
- for await (const v of iter) {
7
- yield v;
8
- if (--count <= 0)
9
- return;
10
- }
11
- }
12
- return fn;
13
- }
14
- export function opTakeSync(count) {
15
- function* fn(iter) {
16
- if (count <= 0)
17
- return;
18
- for (const v of iter) {
19
- yield v;
20
- if (--count <= 0)
21
- return;
22
- }
23
- }
24
- return fn;
25
- }
26
- /**
27
- * Consume only the first `count` number from the iterable.
28
- * @param count - number to take
29
- */
30
- export const opTake = (count) => toPipeFn(opTakeSync(count), opTakeAsync(count));
@@ -1,19 +0,0 @@
1
- /**
2
- * Tap allows you to listen on values, without modifying them.
3
- *
4
- * @param fn - function to call for each value.
5
- */
6
- export declare function opTapAsync<T>(tapFn: (v: T) => void): (iter: AsyncIterable<T>) => AsyncIterable<T>;
7
- /**
8
- * Tap allows you to listen on values, without modifying them.
9
- *
10
- * @param fn - function to call for each value.
11
- */
12
- export declare function opTapSync<T>(tapFn: (v: T) => void): (iter: Iterable<T>) => Iterable<T>;
13
- /**
14
- * Tap allows you to listen on values, without modifying them.
15
- *
16
- * @param fn - function to call for each value.
17
- */
18
- export declare const opTap: <T>(fn: (v: T) => void) => import("../internalTypes.js").PipeFn<T, T>;
19
- //# sourceMappingURL=tap.d.mts.map
@@ -1,19 +0,0 @@
1
- /**
2
- * Tap allows you to listen on values, without modifying them.
3
- *
4
- * @param fn - function to call for each value.
5
- */
6
- export declare function opTapAsync<T>(tapFn: (v: T) => void): (iter: AsyncIterable<T>) => AsyncIterable<T>;
7
- /**
8
- * Tap allows you to listen on values, without modifying them.
9
- *
10
- * @param fn - function to call for each value.
11
- */
12
- export declare function opTapSync<T>(tapFn: (v: T) => void): (iter: Iterable<T>) => Iterable<T>;
13
- /**
14
- * Tap allows you to listen on values, without modifying them.
15
- *
16
- * @param fn - function to call for each value.
17
- */
18
- export declare const opTap: <T>(fn: (v: T) => void) => import("../internalTypes.js").PipeFn<T, T>;
19
- //# sourceMappingURL=tap.d.ts.map
@@ -1,35 +0,0 @@
1
- import { toPipeFn } from '../helpers/util.mjs';
2
- /**
3
- * Tap allows you to listen on values, without modifying them.
4
- *
5
- * @param fn - function to call for each value.
6
- */
7
- export function opTapAsync(tapFn) {
8
- async function* fn(iter) {
9
- for await (const v of iter) {
10
- tapFn(v);
11
- yield v;
12
- }
13
- }
14
- return fn;
15
- }
16
- /**
17
- * Tap allows you to listen on values, without modifying them.
18
- *
19
- * @param fn - function to call for each value.
20
- */
21
- export function opTapSync(tapFn) {
22
- function* fn(iter) {
23
- for (const v of iter) {
24
- tapFn(v);
25
- yield v;
26
- }
27
- }
28
- return fn;
29
- }
30
- /**
31
- * Tap allows you to listen on values, without modifying them.
32
- *
33
- * @param fn - function to call for each value.
34
- */
35
- export const opTap = (fn) => toPipeFn(opTapSync(fn), opTapAsync(fn));
@@ -1,4 +0,0 @@
1
- export type OperatorSync<T, U = T> = (i: Iterable<T>) => Iterable<U>;
2
- export type OperatorAsync<T, U = T> = (i: AsyncIterable<T>) => AsyncIterable<U>;
3
- export type OperatorSyncToAsync<T, U = T> = (i: Iterable<T>) => AsyncIterable<U>;
4
- //# sourceMappingURL=types.d.mts.map
@@ -1,4 +0,0 @@
1
- export type OperatorSync<T, U = T> = (i: Iterable<T>) => Iterable<U>;
2
- export type OperatorAsync<T, U = T> = (i: AsyncIterable<T>) => AsyncIterable<U>;
3
- export type OperatorSyncToAsync<T, U = T> = (i: Iterable<T>) => AsyncIterable<U>;
4
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export declare function opUniqueAsync<T, U>(k?: (v: T) => U): (iter: AsyncIterable<T>) => AsyncIterable<T>;
2
- export declare function opUniqueSync<T, U>(k?: (v: T) => U): (iter: Iterable<T>) => Iterable<T>;
3
- export declare const opUnique: <T, U = T>(getKey?: ((v: T) => U) | undefined) => import("../internalTypes.js").PipeFn<T, T>;
4
- //# sourceMappingURL=unique.d.mts.map
@@ -1,4 +0,0 @@
1
- export declare function opUniqueAsync<T, U>(k?: (v: T) => U): (iter: AsyncIterable<T>) => AsyncIterable<T>;
2
- export declare function opUniqueSync<T, U>(k?: (v: T) => U): (iter: Iterable<T>) => Iterable<T>;
3
- export declare const opUnique: <T, U = T>(getKey?: ((v: T) => U) | undefined) => import("../internalTypes.js").PipeFn<T, T>;
4
- //# sourceMappingURL=unique.d.ts.map
@@ -1,52 +0,0 @@
1
- import { toPipeFn } from '../helpers/util.mjs';
2
- export function opUniqueAsync(k) {
3
- function fnK(k) {
4
- async function* fn(iter) {
5
- const s = new Set();
6
- for await (const v of iter) {
7
- const kk = k(v);
8
- if (s.has(kk))
9
- continue;
10
- s.add(kk);
11
- yield v;
12
- }
13
- }
14
- return fn;
15
- }
16
- async function* fn(iter) {
17
- const s = new Set();
18
- for await (const v of iter) {
19
- if (s.has(v))
20
- continue;
21
- s.add(v);
22
- yield v;
23
- }
24
- }
25
- return k ? fnK(k) : fn;
26
- }
27
- export function opUniqueSync(k) {
28
- function fnK(key) {
29
- function* fn(iter) {
30
- const s = new Set();
31
- for (const v of iter) {
32
- const kk = key(v);
33
- if (s.has(kk))
34
- continue;
35
- s.add(kk);
36
- yield v;
37
- }
38
- }
39
- return fn;
40
- }
41
- function* fn(iter) {
42
- const s = new Set();
43
- for (const v of iter) {
44
- if (s.has(v))
45
- continue;
46
- s.add(v);
47
- yield v;
48
- }
49
- }
50
- return k ? fnK(k) : fn;
51
- }
52
- export const opUnique = (getKey) => toPipeFn(opUniqueSync(getKey), opUniqueAsync(getKey));
@@ -1,20 +0,0 @@
1
- import type { AnyIterable, PipeAsyncTx, PipeSyncTx } from './internalTypes.mjs';
2
- export declare function pipeAsync<T>(i: AnyIterable<T>): AsyncIterable<T>;
3
- export declare function pipeAsync<T, T0>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0]>): AsyncIterable<T0>;
4
- export declare function pipeAsync<T, T0, T1>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1]>): AsyncIterable<T1>;
5
- export declare function pipeAsync<T, T0, T1, T2>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2]>): AsyncIterable<T2>;
6
- export declare function pipeAsync<T, T0, T1, T2, T3>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3]>): AsyncIterable<T3>;
7
- export declare function pipeAsync<T, T0, T1, T2, T3, T4>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4]>): AsyncIterable<T4>;
8
- export declare function pipeAsync<T, T0, T1, T2, T3, T4, T5>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4, T5]>): AsyncIterable<T5>;
9
- export declare function pipeAsync<T, T0, T1, T2, T3, T4, T5, T6>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4, T5, T6]>): AsyncIterable<T6>;
10
- export declare function pipeAsync<T, T0, T1, T2, T3, T4, T5, T6, T7>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4, T5, T6, T7]>): AsyncIterable<T7>;
11
- export declare function pipeSync<T>(i: Iterable<T>): Iterable<T>;
12
- export declare function pipeSync<T, T0 = T>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0]>): Iterable<T0>;
13
- export declare function pipeSync<T, T0, T1>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1]>): Iterable<T1>;
14
- export declare function pipeSync<T, T0, T1, T2>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2]>): Iterable<T2>;
15
- export declare function pipeSync<T, T0, T1, T2, T3>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3]>): Iterable<T3>;
16
- export declare function pipeSync<T, T0, T1, T2, T3, T4>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4]>): Iterable<T4>;
17
- export declare function pipeSync<T, T0, T1, T2, T3, T4, T5>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5]>): Iterable<T5>;
18
- export declare function pipeSync<T, T0, T1, T2, T3, T4, T5, T6>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5, T6]>): Iterable<T6>;
19
- export declare function pipeSync<T, T0, T1, T2, T3, T4, T5, T6, T7>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5, T6, T7]>): Iterable<T7>;
20
- //# sourceMappingURL=pipe.d.mts.map
@@ -1,20 +0,0 @@
1
- import type { AnyIterable, PipeAsyncTx, PipeSyncTx } from './internalTypes.js';
2
- export declare function pipeAsync<T>(i: AnyIterable<T>): AsyncIterable<T>;
3
- export declare function pipeAsync<T, T0>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0]>): AsyncIterable<T0>;
4
- export declare function pipeAsync<T, T0, T1>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1]>): AsyncIterable<T1>;
5
- export declare function pipeAsync<T, T0, T1, T2>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2]>): AsyncIterable<T2>;
6
- export declare function pipeAsync<T, T0, T1, T2, T3>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3]>): AsyncIterable<T3>;
7
- export declare function pipeAsync<T, T0, T1, T2, T3, T4>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4]>): AsyncIterable<T4>;
8
- export declare function pipeAsync<T, T0, T1, T2, T3, T4, T5>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4, T5]>): AsyncIterable<T5>;
9
- export declare function pipeAsync<T, T0, T1, T2, T3, T4, T5, T6>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4, T5, T6]>): AsyncIterable<T6>;
10
- export declare function pipeAsync<T, T0, T1, T2, T3, T4, T5, T6, T7>(i: AnyIterable<T>, ...f: PipeAsyncTx<[T, T0, T1, T2, T3, T4, T5, T6, T7]>): AsyncIterable<T7>;
11
- export declare function pipeSync<T>(i: Iterable<T>): Iterable<T>;
12
- export declare function pipeSync<T, T0 = T>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0]>): Iterable<T0>;
13
- export declare function pipeSync<T, T0, T1>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1]>): Iterable<T1>;
14
- export declare function pipeSync<T, T0, T1, T2>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2]>): Iterable<T2>;
15
- export declare function pipeSync<T, T0, T1, T2, T3>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3]>): Iterable<T3>;
16
- export declare function pipeSync<T, T0, T1, T2, T3, T4>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4]>): Iterable<T4>;
17
- export declare function pipeSync<T, T0, T1, T2, T3, T4, T5>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5]>): Iterable<T5>;
18
- export declare function pipeSync<T, T0, T1, T2, T3, T4, T5, T6>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5, T6]>): Iterable<T6>;
19
- export declare function pipeSync<T, T0, T1, T2, T3, T4, T5, T6, T7>(i: Iterable<T>, ...f: PipeSyncTx<[T, T0, T1, T2, T3, T4, T5, T6, T7]>): Iterable<T7>;
20
- //# sourceMappingURL=pipe.d.ts.map
package/dist/esm/pipe.mjs DELETED
@@ -1,9 +0,0 @@
1
- import { toAsyncIterable } from './helpers/index.mjs';
2
- import { opCombineAsync, opCombineSync } from './operators/index.mjs';
3
- export function pipeAsync(i, ...fns) {
4
- const iter = toAsyncIterable(i);
5
- return opCombineAsync(...fns)(iter);
6
- }
7
- export function pipeSync(i, ...fns) {
8
- return opCombineSync(...fns)(i);
9
- }
@@ -1,16 +0,0 @@
1
- import type { AnyIterable } from './internalTypes.mjs';
2
- export declare function reduceSync<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T): T | undefined;
3
- export declare function reduceSync<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): T;
4
- export declare function reduceSync<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue?: T): T | undefined;
5
- export declare function reduceSync<T, U>(iter: Iterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): U;
6
- export declare function reduceAsync<T>(iter: AnyIterable<T>, reduceFn: (prev: T, curr: T) => T): Promise<T | undefined>;
7
- export declare function reduceAsync<T>(iter: AnyIterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): Promise<T>;
8
- export declare function reduceAsync<T>(iter: AnyIterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue?: T): Promise<T | undefined>;
9
- export declare function reduceAsync<T, U>(iter: AnyIterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): Promise<U>;
10
- export declare function reduce<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T): T | undefined;
11
- export declare function reduce<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): T;
12
- export declare function reduce<T, U>(iter: Iterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): U;
13
- export declare function reduce<T>(iter: AsyncIterable<T>, reduceFn: (prev: T, curr: T) => T): Promise<T | undefined>;
14
- export declare function reduce<T>(iter: AsyncIterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): Promise<T>;
15
- export declare function reduce<T, U>(iter: AsyncIterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): Promise<U>;
16
- //# sourceMappingURL=reduce.d.mts.map
@@ -1,16 +0,0 @@
1
- import type { AnyIterable } from './internalTypes.js';
2
- export declare function reduceSync<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T): T | undefined;
3
- export declare function reduceSync<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): T;
4
- export declare function reduceSync<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue?: T): T | undefined;
5
- export declare function reduceSync<T, U>(iter: Iterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): U;
6
- export declare function reduceAsync<T>(iter: AnyIterable<T>, reduceFn: (prev: T, curr: T) => T): Promise<T | undefined>;
7
- export declare function reduceAsync<T>(iter: AnyIterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): Promise<T>;
8
- export declare function reduceAsync<T>(iter: AnyIterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue?: T): Promise<T | undefined>;
9
- export declare function reduceAsync<T, U>(iter: AnyIterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): Promise<U>;
10
- export declare function reduce<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T): T | undefined;
11
- export declare function reduce<T>(iter: Iterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): T;
12
- export declare function reduce<T, U>(iter: Iterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): U;
13
- export declare function reduce<T>(iter: AsyncIterable<T>, reduceFn: (prev: T, curr: T) => T): Promise<T | undefined>;
14
- export declare function reduce<T>(iter: AsyncIterable<T>, reduceFn: (prev: T, curr: T) => T, initialValue: T): Promise<T>;
15
- export declare function reduce<T, U>(iter: AsyncIterable<T>, reduceFn: (prev: U, curr: T) => U, initialValue: U): Promise<U>;
16
- //# sourceMappingURL=reduce.d.ts.map
@@ -1,20 +0,0 @@
1
- import { isAsyncIterable } from './helpers/index.mjs';
2
- import { toArrayAsync } from './helpers/toArray.mjs';
3
- import { opReduceAsync, opReduceSync } from './operators/index.mjs';
4
- import { pipeAsync, pipeSync } from './pipe.mjs';
5
- export function reduceSync(iter, reduceFn, initialValue) {
6
- const i = initialValue === undefined
7
- ? pipeSync(iter, opReduceSync(reduceFn))
8
- : pipeSync(iter, opReduceSync(reduceFn, initialValue));
9
- return [...i][0];
10
- }
11
- export async function reduceAsync(iter, reduceFn, initialValue) {
12
- const i = initialValue === undefined
13
- ? pipeAsync(iter, opReduceAsync(reduceFn))
14
- : pipeAsync(iter, opReduceAsync(reduceFn, initialValue));
15
- const arr = await toArrayAsync(i);
16
- return arr[0];
17
- }
18
- export function reduce(iter, reduceFn, initialValue) {
19
- return isAsyncIterable(iter) ? reduceAsync(iter, reduceFn, initialValue) : reduceSync(iter, reduceFn, initialValue);
20
- }
@@ -1,6 +0,0 @@
1
- export { toArraySync as toArray } from '../helpers/toArray.mjs';
2
- export type { OperatorSync as Operator } from '../operators/index.mjs';
3
- export { opAppendSync as opAppend, opCombineSync as opCombine, opConcatMapSync as opConcatMap, opFilterSync as opFilter, opFirstSync as opFirst, opFlattenSync as opFlatten, opJoinStringsSync as opJoinStrings, opLastSync as opLast, opMapSync as opMap, opReduceSync as opReduce, opSkipSync as opSkip, opTakeSync as opTake, opTapSync as opTap, opUniqueSync as opUnique, } from '../operators/index.mjs';
4
- export { pipeSync as pipe, pipeSync } from '../pipe.mjs';
5
- export { reduceSync as reduce } from '../reduce.mjs';
6
- //# sourceMappingURL=index.d.mts.map
@@ -1,6 +0,0 @@
1
- export { toArraySync as toArray } from '../helpers/toArray.js';
2
- export type { OperatorSync as Operator } from '../operators/index.js';
3
- export { opAppendSync as opAppend, opCombineSync as opCombine, opConcatMapSync as opConcatMap, opFilterSync as opFilter, opFirstSync as opFirst, opFlattenSync as opFlatten, opJoinStringsSync as opJoinStrings, opLastSync as opLast, opMapSync as opMap, opReduceSync as opReduce, opSkipSync as opSkip, opTakeSync as opTake, opTapSync as opTap, opUniqueSync as opUnique, } from '../operators/index.js';
4
- export { pipeSync as pipe, pipeSync } from '../pipe.js';
5
- export { reduceSync as reduce } from '../reduce.js';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- export { toArraySync as toArray } from '../helpers/toArray.mjs';
2
- export { opAppendSync as opAppend, opCombineSync as opCombine, opConcatMapSync as opConcatMap, opFilterSync as opFilter, opFirstSync as opFirst, opFlattenSync as opFlatten, opJoinStringsSync as opJoinStrings, opLastSync as opLast, opMapSync as opMap, opReduceSync as opReduce, opSkipSync as opSkip, opTakeSync as opTake, opTapSync as opTap, opUniqueSync as opUnique, } from '../operators/index.mjs';
3
- export { pipeSync as pipe, pipeSync } from '../pipe.mjs';
4
- export { reduceSync as reduce } from '../reduce.mjs';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes