@nlozgachev/pipelined 0.33.0 → 0.35.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/README.md +75 -40
- package/dist/{Task-5na0QzS4.d.mts → Task-DXsuurnc.d.mts} +54 -55
- package/dist/{Task-DeiWgoeJ.d.ts → Task-zAY4kSVB.d.ts} +54 -55
- package/dist/{chunk-FZX4MTRI.mjs → chunk-5AWUAG7G.mjs} +445 -308
- package/dist/{chunk-NRF2FVPZ.mjs → chunk-AHEZFTMT.mjs} +64 -32
- package/dist/{chunk-GSTKY7MF.mjs → chunk-DLBHVYII.mjs} +69 -52
- package/dist/{chunk-W53ZYTLX.mjs → chunk-IJFFWBKW.mjs} +184 -64
- package/dist/composition.d.mts +8 -7
- package/dist/composition.d.ts +8 -7
- package/dist/composition.js +64 -32
- package/dist/composition.mjs +1 -1
- package/dist/core.d.mts +172 -163
- package/dist/core.d.ts +172 -163
- package/dist/core.js +535 -384
- package/dist/core.mjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +783 -480
- package/dist/index.mjs +4 -4
- package/dist/utils.d.mts +8 -7
- package/dist/utils.d.ts +8 -7
- package/dist/utils.js +252 -115
- package/dist/utils.mjs +2 -2
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
uncurry,
|
|
27
27
|
uncurry3,
|
|
28
28
|
uncurry4
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-AHEZFTMT.mjs";
|
|
30
30
|
import {
|
|
31
31
|
Combinable,
|
|
32
32
|
Equality,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
These,
|
|
49
49
|
Tuple,
|
|
50
50
|
Validation
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-5AWUAG7G.mjs";
|
|
52
52
|
import {
|
|
53
53
|
Arr,
|
|
54
54
|
Dict,
|
|
@@ -56,13 +56,13 @@ import {
|
|
|
56
56
|
Rec,
|
|
57
57
|
Str,
|
|
58
58
|
Uniq
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-IJFFWBKW.mjs";
|
|
60
60
|
import {
|
|
61
61
|
Deferred,
|
|
62
62
|
Maybe,
|
|
63
63
|
Result,
|
|
64
64
|
Task
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-DLBHVYII.mjs";
|
|
66
66
|
import "./chunk-IPP4XFYH.mjs";
|
|
67
67
|
import {
|
|
68
68
|
isNonEmptyList
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-
|
|
1
|
+
import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-DXsuurnc.mjs';
|
|
2
2
|
import { NonEmptyList } from './types.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -156,7 +156,7 @@ declare namespace Arr {
|
|
|
156
156
|
*
|
|
157
157
|
* @example
|
|
158
158
|
* ```ts
|
|
159
|
-
* Arr.separate([Result.ok(1), Result.
|
|
159
|
+
* Arr.separate([Result.ok(1), Result.err("bad"), Result.ok(3)]); // [["bad"], [1, 3]]
|
|
160
160
|
* ```
|
|
161
161
|
*/
|
|
162
162
|
const separate: <E, A>(data: readonly Result<E, A>[]) => readonly [readonly E[], readonly A[]];
|
|
@@ -167,7 +167,7 @@ declare namespace Arr {
|
|
|
167
167
|
* ```ts
|
|
168
168
|
* pipe(
|
|
169
169
|
* [1, 2, 3, 4],
|
|
170
|
-
* Arr.partitionMap(n => n % 2 === 0 ? Result.ok(n) : Result.
|
|
170
|
+
* Arr.partitionMap(n => n % 2 === 0 ? Result.ok(n) : Result.err(`odd: ${n}`))
|
|
171
171
|
* ); // [["odd: 1", "odd: 3"], [2, 4]]
|
|
172
172
|
* ```
|
|
173
173
|
*/
|
|
@@ -309,7 +309,7 @@ declare namespace Arr {
|
|
|
309
309
|
*/
|
|
310
310
|
const reduce: <A, B>(initial: B, f: (acc: B, a: A) => B) => (data: readonly A[]) => B;
|
|
311
311
|
/**
|
|
312
|
-
* Maps each element to
|
|
312
|
+
* Maps each element to a Maybe and collects the results.
|
|
313
313
|
* Returns None if any mapping returns None.
|
|
314
314
|
*
|
|
315
315
|
* @example
|
|
@@ -332,7 +332,7 @@ declare namespace Arr {
|
|
|
332
332
|
* ```ts
|
|
333
333
|
* pipe(
|
|
334
334
|
* [1, 2, 3],
|
|
335
|
-
* Arr.traverseResult(n => n > 0 ? Result.ok(n) : Result.
|
|
335
|
+
* Arr.traverseResult(n => n > 0 ? Result.ok(n) : Result.err("negative"))
|
|
336
336
|
* ); // Ok([1, 2, 3])
|
|
337
337
|
* ```
|
|
338
338
|
*/
|
|
@@ -350,7 +350,7 @@ declare namespace Arr {
|
|
|
350
350
|
*/
|
|
351
351
|
const traverseTask: <A, B>(f: (a: A) => Task<B>) => (data: readonly A[]) => Task<readonly B[]>;
|
|
352
352
|
/**
|
|
353
|
-
* Collects an array of
|
|
353
|
+
* Collects an array of Maybe instances into a Maybe of array.
|
|
354
354
|
* Returns None if any element is None.
|
|
355
355
|
*
|
|
356
356
|
* @example
|
|
@@ -1073,6 +1073,7 @@ declare namespace Rec {
|
|
|
1073
1073
|
* ```
|
|
1074
1074
|
*/
|
|
1075
1075
|
const map: <A, B>(f: (a: A) => B) => (data: Readonly<Record<string, A>>) => Readonly<Record<string, B>>;
|
|
1076
|
+
const filterMap: <A, B>(f: (a: A) => Maybe<B>) => (data: Readonly<Record<string, A>>) => Readonly<Record<string, B>>;
|
|
1076
1077
|
/**
|
|
1077
1078
|
* Transforms each value in a record, also receiving the key.
|
|
1078
1079
|
*
|
|
@@ -1428,7 +1429,7 @@ declare namespace Str {
|
|
|
1428
1429
|
* @example
|
|
1429
1430
|
* ```ts
|
|
1430
1431
|
* Str.parseJson('{"a": 1}'); // Ok({ a: 1 })
|
|
1431
|
-
* Str.parseJson('invalid'); //
|
|
1432
|
+
* Str.parseJson('invalid'); // Err(SyntaxError)
|
|
1432
1433
|
* ```
|
|
1433
1434
|
*/
|
|
1434
1435
|
const parseJson: (s: string) => Result<SyntaxError, unknown>;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-
|
|
1
|
+
import { M as Maybe, R as Result, E as Equality, b as Ordering, T as Task } from './Task-zAY4kSVB.js';
|
|
2
2
|
import { NonEmptyList } from './types.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -156,7 +156,7 @@ declare namespace Arr {
|
|
|
156
156
|
*
|
|
157
157
|
* @example
|
|
158
158
|
* ```ts
|
|
159
|
-
* Arr.separate([Result.ok(1), Result.
|
|
159
|
+
* Arr.separate([Result.ok(1), Result.err("bad"), Result.ok(3)]); // [["bad"], [1, 3]]
|
|
160
160
|
* ```
|
|
161
161
|
*/
|
|
162
162
|
const separate: <E, A>(data: readonly Result<E, A>[]) => readonly [readonly E[], readonly A[]];
|
|
@@ -167,7 +167,7 @@ declare namespace Arr {
|
|
|
167
167
|
* ```ts
|
|
168
168
|
* pipe(
|
|
169
169
|
* [1, 2, 3, 4],
|
|
170
|
-
* Arr.partitionMap(n => n % 2 === 0 ? Result.ok(n) : Result.
|
|
170
|
+
* Arr.partitionMap(n => n % 2 === 0 ? Result.ok(n) : Result.err(`odd: ${n}`))
|
|
171
171
|
* ); // [["odd: 1", "odd: 3"], [2, 4]]
|
|
172
172
|
* ```
|
|
173
173
|
*/
|
|
@@ -309,7 +309,7 @@ declare namespace Arr {
|
|
|
309
309
|
*/
|
|
310
310
|
const reduce: <A, B>(initial: B, f: (acc: B, a: A) => B) => (data: readonly A[]) => B;
|
|
311
311
|
/**
|
|
312
|
-
* Maps each element to
|
|
312
|
+
* Maps each element to a Maybe and collects the results.
|
|
313
313
|
* Returns None if any mapping returns None.
|
|
314
314
|
*
|
|
315
315
|
* @example
|
|
@@ -332,7 +332,7 @@ declare namespace Arr {
|
|
|
332
332
|
* ```ts
|
|
333
333
|
* pipe(
|
|
334
334
|
* [1, 2, 3],
|
|
335
|
-
* Arr.traverseResult(n => n > 0 ? Result.ok(n) : Result.
|
|
335
|
+
* Arr.traverseResult(n => n > 0 ? Result.ok(n) : Result.err("negative"))
|
|
336
336
|
* ); // Ok([1, 2, 3])
|
|
337
337
|
* ```
|
|
338
338
|
*/
|
|
@@ -350,7 +350,7 @@ declare namespace Arr {
|
|
|
350
350
|
*/
|
|
351
351
|
const traverseTask: <A, B>(f: (a: A) => Task<B>) => (data: readonly A[]) => Task<readonly B[]>;
|
|
352
352
|
/**
|
|
353
|
-
* Collects an array of
|
|
353
|
+
* Collects an array of Maybe instances into a Maybe of array.
|
|
354
354
|
* Returns None if any element is None.
|
|
355
355
|
*
|
|
356
356
|
* @example
|
|
@@ -1073,6 +1073,7 @@ declare namespace Rec {
|
|
|
1073
1073
|
* ```
|
|
1074
1074
|
*/
|
|
1075
1075
|
const map: <A, B>(f: (a: A) => B) => (data: Readonly<Record<string, A>>) => Readonly<Record<string, B>>;
|
|
1076
|
+
const filterMap: <A, B>(f: (a: A) => Maybe<B>) => (data: Readonly<Record<string, A>>) => Readonly<Record<string, B>>;
|
|
1076
1077
|
/**
|
|
1077
1078
|
* Transforms each value in a record, also receiving the key.
|
|
1078
1079
|
*
|
|
@@ -1428,7 +1429,7 @@ declare namespace Str {
|
|
|
1428
1429
|
* @example
|
|
1429
1430
|
* ```ts
|
|
1430
1431
|
* Str.parseJson('{"a": 1}'); // Ok({ a: 1 })
|
|
1431
|
-
* Str.parseJson('invalid'); //
|
|
1432
|
+
* Str.parseJson('invalid'); // Err(SyntaxError)
|
|
1432
1433
|
* ```
|
|
1433
1434
|
*/
|
|
1434
1435
|
const parseJson: (s: string) => Result<SyntaxError, unknown>;
|