@nlozgachev/pipelined 0.12.0 → 0.14.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/LICENCE +28 -0
- package/README.md +1 -1
- package/{types/src/Types/NonEmptyList.d.ts → dist/NonEmptyList-BlGFjor5.d.mts} +4 -3
- package/dist/NonEmptyList-BlGFjor5.d.ts +30 -0
- package/dist/Task-Bd3gXPRQ.d.mts +677 -0
- package/dist/Task-BjAkkD6t.d.ts +677 -0
- package/dist/chunk-4TXC322E.mjs +136 -0
- package/dist/chunk-BYWKZLHM.mjs +10 -0
- package/dist/chunk-DBIC62UV.mjs +6 -0
- package/dist/chunk-FAZN3IWZ.mjs +554 -0
- package/dist/chunk-QPTGO5AS.mjs +150 -0
- package/dist/chunk-UV2HMF2A.mjs +514 -0
- package/dist/composition.d.mts +495 -0
- package/dist/composition.d.ts +495 -0
- package/dist/composition.js +188 -0
- package/dist/composition.mjs +58 -0
- package/dist/core.d.mts +2170 -0
- package/dist/core.d.ts +2170 -0
- package/dist/core.js +698 -0
- package/dist/core.mjs +42 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1421 -0
- package/dist/index.mjs +120 -0
- package/dist/types.d.mts +54 -0
- package/{types/src/Types/Brand.d.ts → dist/types.d.ts} +6 -4
- package/dist/types.js +41 -0
- package/dist/types.mjs +10 -0
- package/dist/utils.d.mts +1285 -0
- package/dist/utils.d.ts +1285 -0
- package/dist/utils.js +722 -0
- package/dist/utils.mjs +18 -0
- package/package.json +64 -69
- package/esm/mod.js +0 -3
- package/esm/package.json +0 -3
- package/esm/src/Composition/compose.js +0 -3
- package/esm/src/Composition/converge.js +0 -3
- package/esm/src/Composition/curry.js +0 -42
- package/esm/src/Composition/flip.js +0 -20
- package/esm/src/Composition/flow.js +0 -8
- package/esm/src/Composition/fn.js +0 -85
- package/esm/src/Composition/index.js +0 -13
- package/esm/src/Composition/juxt.js +0 -3
- package/esm/src/Composition/memoize.js +0 -66
- package/esm/src/Composition/not.js +0 -25
- package/esm/src/Composition/on.js +0 -12
- package/esm/src/Composition/pipe.js +0 -3
- package/esm/src/Composition/tap.js +0 -33
- package/esm/src/Composition/uncurry.js +0 -32
- package/esm/src/Core/Deferred.js +0 -30
- package/esm/src/Core/InternalTypes.js +0 -1
- package/esm/src/Core/Lens.js +0 -98
- package/esm/src/Core/Logged.js +0 -111
- package/esm/src/Core/Option.js +0 -191
- package/esm/src/Core/Optional.js +0 -160
- package/esm/src/Core/Predicate.js +0 -133
- package/esm/src/Core/Reader.js +0 -134
- package/esm/src/Core/Refinement.js +0 -115
- package/esm/src/Core/RemoteData.js +0 -211
- package/esm/src/Core/Result.js +0 -170
- package/esm/src/Core/State.js +0 -181
- package/esm/src/Core/Task.js +0 -223
- package/esm/src/Core/TaskOption.js +0 -106
- package/esm/src/Core/TaskResult.js +0 -127
- package/esm/src/Core/TaskValidation.js +0 -128
- package/esm/src/Core/These.js +0 -245
- package/esm/src/Core/Tuple.js +0 -112
- package/esm/src/Core/Validation.js +0 -212
- package/esm/src/Core/index.js +0 -18
- package/esm/src/Types/Brand.js +0 -28
- package/esm/src/Types/NonEmptyList.js +0 -14
- package/esm/src/Types/index.js +0 -2
- package/esm/src/Utils/Arr.js +0 -570
- package/esm/src/Utils/Dict.js +0 -421
- package/esm/src/Utils/Num.js +0 -124
- package/esm/src/Utils/Rec.js +0 -241
- package/esm/src/Utils/Str.js +0 -134
- package/esm/src/Utils/Uniq.js +0 -265
- package/esm/src/Utils/index.js +0 -6
- package/script/mod.js +0 -19
- package/script/package.json +0 -3
- package/script/src/Composition/compose.js +0 -6
- package/script/src/Composition/converge.js +0 -6
- package/script/src/Composition/curry.js +0 -48
- package/script/src/Composition/flip.js +0 -24
- package/script/src/Composition/flow.js +0 -11
- package/script/src/Composition/fn.js +0 -98
- package/script/src/Composition/index.js +0 -29
- package/script/src/Composition/juxt.js +0 -6
- package/script/src/Composition/memoize.js +0 -71
- package/script/src/Composition/not.js +0 -29
- package/script/src/Composition/on.js +0 -16
- package/script/src/Composition/pipe.js +0 -6
- package/script/src/Composition/tap.js +0 -37
- package/script/src/Composition/uncurry.js +0 -38
- package/script/src/Core/Deferred.js +0 -33
- package/script/src/Core/InternalTypes.js +0 -2
- package/script/src/Core/Lens.js +0 -101
- package/script/src/Core/Logged.js +0 -114
- package/script/src/Core/Option.js +0 -194
- package/script/src/Core/Optional.js +0 -163
- package/script/src/Core/Predicate.js +0 -136
- package/script/src/Core/Reader.js +0 -137
- package/script/src/Core/Refinement.js +0 -118
- package/script/src/Core/RemoteData.js +0 -214
- package/script/src/Core/Result.js +0 -173
- package/script/src/Core/State.js +0 -184
- package/script/src/Core/Task.js +0 -226
- package/script/src/Core/TaskOption.js +0 -109
- package/script/src/Core/TaskResult.js +0 -130
- package/script/src/Core/TaskValidation.js +0 -131
- package/script/src/Core/These.js +0 -248
- package/script/src/Core/Tuple.js +0 -115
- package/script/src/Core/Validation.js +0 -215
- package/script/src/Core/index.js +0 -34
- package/script/src/Types/Brand.js +0 -31
- package/script/src/Types/NonEmptyList.js +0 -18
- package/script/src/Types/index.js +0 -18
- package/script/src/Utils/Arr.js +0 -573
- package/script/src/Utils/Dict.js +0 -424
- package/script/src/Utils/Num.js +0 -127
- package/script/src/Utils/Rec.js +0 -244
- package/script/src/Utils/Str.js +0 -137
- package/script/src/Utils/Uniq.js +0 -268
- package/script/src/Utils/index.js +0 -22
- package/types/mod.d.ts +0 -4
- package/types/mod.d.ts.map +0 -1
- package/types/src/Composition/compose.d.ts +0 -33
- package/types/src/Composition/compose.d.ts.map +0 -1
- package/types/src/Composition/converge.d.ts +0 -21
- package/types/src/Composition/converge.d.ts.map +0 -1
- package/types/src/Composition/curry.d.ts +0 -43
- package/types/src/Composition/curry.d.ts.map +0 -1
- package/types/src/Composition/flip.d.ts +0 -21
- package/types/src/Composition/flip.d.ts.map +0 -1
- package/types/src/Composition/flow.d.ts +0 -56
- package/types/src/Composition/flow.d.ts.map +0 -1
- package/types/src/Composition/fn.d.ts +0 -76
- package/types/src/Composition/fn.d.ts.map +0 -1
- package/types/src/Composition/index.d.ts +0 -14
- package/types/src/Composition/index.d.ts.map +0 -1
- package/types/src/Composition/juxt.d.ts +0 -18
- package/types/src/Composition/juxt.d.ts.map +0 -1
- package/types/src/Composition/memoize.d.ts +0 -46
- package/types/src/Composition/memoize.d.ts.map +0 -1
- package/types/src/Composition/not.d.ts +0 -26
- package/types/src/Composition/not.d.ts.map +0 -1
- package/types/src/Composition/on.d.ts +0 -13
- package/types/src/Composition/on.d.ts.map +0 -1
- package/types/src/Composition/pipe.d.ts +0 -56
- package/types/src/Composition/pipe.d.ts.map +0 -1
- package/types/src/Composition/tap.d.ts +0 -31
- package/types/src/Composition/tap.d.ts.map +0 -1
- package/types/src/Composition/uncurry.d.ts +0 -54
- package/types/src/Composition/uncurry.d.ts.map +0 -1
- package/types/src/Core/Deferred.d.ts +0 -49
- package/types/src/Core/Deferred.d.ts.map +0 -1
- package/types/src/Core/InternalTypes.d.ts +0 -23
- package/types/src/Core/InternalTypes.d.ts.map +0 -1
- package/types/src/Core/Lens.d.ts +0 -118
- package/types/src/Core/Lens.d.ts.map +0 -1
- package/types/src/Core/Logged.d.ts +0 -126
- package/types/src/Core/Logged.d.ts.map +0 -1
- package/types/src/Core/Option.d.ts +0 -209
- package/types/src/Core/Option.d.ts.map +0 -1
- package/types/src/Core/Optional.d.ts +0 -158
- package/types/src/Core/Optional.d.ts.map +0 -1
- package/types/src/Core/Predicate.d.ts +0 -161
- package/types/src/Core/Predicate.d.ts.map +0 -1
- package/types/src/Core/Reader.d.ts +0 -156
- package/types/src/Core/Reader.d.ts.map +0 -1
- package/types/src/Core/Refinement.d.ts +0 -138
- package/types/src/Core/Refinement.d.ts.map +0 -1
- package/types/src/Core/RemoteData.d.ts +0 -197
- package/types/src/Core/RemoteData.d.ts.map +0 -1
- package/types/src/Core/Result.d.ts +0 -182
- package/types/src/Core/Result.d.ts.map +0 -1
- package/types/src/Core/State.d.ts +0 -192
- package/types/src/Core/State.d.ts.map +0 -1
- package/types/src/Core/Task.d.ts +0 -219
- package/types/src/Core/Task.d.ts.map +0 -1
- package/types/src/Core/TaskOption.d.ts +0 -121
- package/types/src/Core/TaskOption.d.ts.map +0 -1
- package/types/src/Core/TaskResult.d.ts +0 -119
- package/types/src/Core/TaskResult.d.ts.map +0 -1
- package/types/src/Core/TaskValidation.d.ts +0 -144
- package/types/src/Core/TaskValidation.d.ts.map +0 -1
- package/types/src/Core/These.d.ts +0 -225
- package/types/src/Core/These.d.ts.map +0 -1
- package/types/src/Core/Tuple.d.ts +0 -129
- package/types/src/Core/Tuple.d.ts.map +0 -1
- package/types/src/Core/Validation.d.ts +0 -203
- package/types/src/Core/Validation.d.ts.map +0 -1
- package/types/src/Core/index.d.ts +0 -19
- package/types/src/Core/index.d.ts.map +0 -1
- package/types/src/Types/Brand.d.ts.map +0 -1
- package/types/src/Types/NonEmptyList.d.ts.map +0 -1
- package/types/src/Types/index.d.ts +0 -3
- package/types/src/Types/index.d.ts.map +0 -1
- package/types/src/Utils/Arr.d.ts +0 -403
- package/types/src/Utils/Arr.d.ts.map +0 -1
- package/types/src/Utils/Dict.d.ts +0 -310
- package/types/src/Utils/Dict.d.ts.map +0 -1
- package/types/src/Utils/Num.d.ts +0 -110
- package/types/src/Utils/Num.d.ts.map +0 -1
- package/types/src/Utils/Rec.d.ts +0 -159
- package/types/src/Utils/Rec.d.ts.map +0 -1
- package/types/src/Utils/Str.d.ts +0 -128
- package/types/src/Utils/Str.d.ts.map +0 -1
- package/types/src/Utils/Uniq.d.ts +0 -179
- package/types/src/Utils/Uniq.d.ts.map +0 -1
- package/types/src/Utils/index.d.ts +0 -7
- package/types/src/Utils/index.d.ts.map +0 -1
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {
|
|
2
|
+
and,
|
|
3
|
+
compose,
|
|
4
|
+
constFalse,
|
|
5
|
+
constNull,
|
|
6
|
+
constTrue,
|
|
7
|
+
constUndefined,
|
|
8
|
+
constVoid,
|
|
9
|
+
constant,
|
|
10
|
+
converge,
|
|
11
|
+
curry,
|
|
12
|
+
curry3,
|
|
13
|
+
curry4,
|
|
14
|
+
flip,
|
|
15
|
+
flow,
|
|
16
|
+
identity,
|
|
17
|
+
juxt,
|
|
18
|
+
memoize,
|
|
19
|
+
memoizeWeak,
|
|
20
|
+
not,
|
|
21
|
+
on,
|
|
22
|
+
once,
|
|
23
|
+
or,
|
|
24
|
+
pipe,
|
|
25
|
+
tap,
|
|
26
|
+
uncurry,
|
|
27
|
+
uncurry3,
|
|
28
|
+
uncurry4
|
|
29
|
+
} from "./chunk-4TXC322E.mjs";
|
|
30
|
+
import {
|
|
31
|
+
Lens,
|
|
32
|
+
Logged,
|
|
33
|
+
Optional,
|
|
34
|
+
Predicate,
|
|
35
|
+
Reader,
|
|
36
|
+
Refinement,
|
|
37
|
+
RemoteData,
|
|
38
|
+
State,
|
|
39
|
+
TaskOption,
|
|
40
|
+
TaskResult,
|
|
41
|
+
TaskValidation,
|
|
42
|
+
These,
|
|
43
|
+
Tuple,
|
|
44
|
+
Validation
|
|
45
|
+
} from "./chunk-UV2HMF2A.mjs";
|
|
46
|
+
import {
|
|
47
|
+
Arr,
|
|
48
|
+
Dict,
|
|
49
|
+
Num,
|
|
50
|
+
Rec,
|
|
51
|
+
Str,
|
|
52
|
+
Uniq
|
|
53
|
+
} from "./chunk-FAZN3IWZ.mjs";
|
|
54
|
+
import {
|
|
55
|
+
Deferred,
|
|
56
|
+
Option,
|
|
57
|
+
Result,
|
|
58
|
+
Task
|
|
59
|
+
} from "./chunk-QPTGO5AS.mjs";
|
|
60
|
+
import {
|
|
61
|
+
Brand
|
|
62
|
+
} from "./chunk-BYWKZLHM.mjs";
|
|
63
|
+
import {
|
|
64
|
+
isNonEmptyList
|
|
65
|
+
} from "./chunk-DBIC62UV.mjs";
|
|
66
|
+
export {
|
|
67
|
+
Arr,
|
|
68
|
+
Brand,
|
|
69
|
+
Deferred,
|
|
70
|
+
Dict,
|
|
71
|
+
Lens,
|
|
72
|
+
Logged,
|
|
73
|
+
Num,
|
|
74
|
+
Option,
|
|
75
|
+
Optional,
|
|
76
|
+
Predicate,
|
|
77
|
+
Reader,
|
|
78
|
+
Rec,
|
|
79
|
+
Refinement,
|
|
80
|
+
RemoteData,
|
|
81
|
+
Result,
|
|
82
|
+
State,
|
|
83
|
+
Str,
|
|
84
|
+
Task,
|
|
85
|
+
TaskOption,
|
|
86
|
+
TaskResult,
|
|
87
|
+
TaskValidation,
|
|
88
|
+
These,
|
|
89
|
+
Tuple,
|
|
90
|
+
Uniq,
|
|
91
|
+
Validation,
|
|
92
|
+
and,
|
|
93
|
+
compose,
|
|
94
|
+
constFalse,
|
|
95
|
+
constNull,
|
|
96
|
+
constTrue,
|
|
97
|
+
constUndefined,
|
|
98
|
+
constVoid,
|
|
99
|
+
constant,
|
|
100
|
+
converge,
|
|
101
|
+
curry,
|
|
102
|
+
curry3,
|
|
103
|
+
curry4,
|
|
104
|
+
flip,
|
|
105
|
+
flow,
|
|
106
|
+
identity,
|
|
107
|
+
isNonEmptyList,
|
|
108
|
+
juxt,
|
|
109
|
+
memoize,
|
|
110
|
+
memoizeWeak,
|
|
111
|
+
not,
|
|
112
|
+
on,
|
|
113
|
+
once,
|
|
114
|
+
or,
|
|
115
|
+
pipe,
|
|
116
|
+
tap,
|
|
117
|
+
uncurry,
|
|
118
|
+
uncurry3,
|
|
119
|
+
uncurry4
|
|
120
|
+
};
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export { N as NonEmptyList, i as isNonEmptyList } from './NonEmptyList-BlGFjor5.mjs';
|
|
2
|
+
|
|
3
|
+
declare const _brand: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Brand<K, T> creates a nominal type by tagging T with a phantom brand K.
|
|
6
|
+
* Prevents accidentally mixing up values that share the same underlying type.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* type UserId = Brand<"UserId", string>;
|
|
11
|
+
* type ProductId = Brand<"ProductId", string>;
|
|
12
|
+
*
|
|
13
|
+
* const toUserId = Brand.wrap<"UserId", string>();
|
|
14
|
+
* const toProductId = Brand.wrap<"ProductId", string>();
|
|
15
|
+
*
|
|
16
|
+
* const userId: UserId = toUserId("user-123");
|
|
17
|
+
* const productId: ProductId = toProductId("prod-456");
|
|
18
|
+
*
|
|
19
|
+
* // Type error: ProductId is not assignable to UserId
|
|
20
|
+
* // const wrong: UserId = productId;
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
type Brand<K extends string, T> = T & {
|
|
24
|
+
readonly [_brand]: K;
|
|
25
|
+
};
|
|
26
|
+
declare namespace Brand {
|
|
27
|
+
/**
|
|
28
|
+
* Returns a constructor that wraps a value of type T in brand K.
|
|
29
|
+
* The resulting function performs an unchecked cast — only use when the raw
|
|
30
|
+
* value is known to satisfy the brand's invariants.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* type PositiveNumber = Brand<"PositiveNumber", number>;
|
|
35
|
+
* const toPositiveNumber = Brand.wrap<"PositiveNumber", number>();
|
|
36
|
+
*
|
|
37
|
+
* const n: PositiveNumber = toPositiveNumber(42);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
const wrap: <K extends string, T>() => (value: T) => Brand<K, T>;
|
|
41
|
+
/**
|
|
42
|
+
* Strips the brand and returns the underlying value.
|
|
43
|
+
* Since Brand<K, T> extends T this is rarely needed, but can improve readability.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const userId: UserId = toUserId("user-123");
|
|
48
|
+
* const raw: string = Brand.unwrap(userId); // "user-123"
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
const unwrap: <K extends string, T>(branded: Brand<K, T>) => T;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { Brand };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { N as NonEmptyList, i as isNonEmptyList } from './NonEmptyList-BlGFjor5.js';
|
|
2
|
+
|
|
1
3
|
declare const _brand: unique symbol;
|
|
2
4
|
/**
|
|
3
5
|
* Brand<K, T> creates a nominal type by tagging T with a phantom brand K.
|
|
@@ -18,10 +20,10 @@ declare const _brand: unique symbol;
|
|
|
18
20
|
* // const wrong: UserId = productId;
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
type Brand<K extends string, T> = T & {
|
|
22
24
|
readonly [_brand]: K;
|
|
23
25
|
};
|
|
24
|
-
|
|
26
|
+
declare namespace Brand {
|
|
25
27
|
/**
|
|
26
28
|
* Returns a constructor that wraps a value of type T in brand K.
|
|
27
29
|
* The resulting function performs an unchecked cast — only use when the raw
|
|
@@ -48,5 +50,5 @@ export declare namespace Brand {
|
|
|
48
50
|
*/
|
|
49
51
|
const unwrap: <K extends string, T>(branded: Brand<K, T>) => T;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
|
|
54
|
+
export { Brand };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/Types/index.ts
|
|
21
|
+
var Types_exports = {};
|
|
22
|
+
__export(Types_exports, {
|
|
23
|
+
Brand: () => Brand,
|
|
24
|
+
isNonEmptyList: () => isNonEmptyList
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(Types_exports);
|
|
27
|
+
|
|
28
|
+
// src/Types/Brand.ts
|
|
29
|
+
var Brand;
|
|
30
|
+
((Brand2) => {
|
|
31
|
+
Brand2.wrap = () => (value) => value;
|
|
32
|
+
Brand2.unwrap = (branded) => branded;
|
|
33
|
+
})(Brand || (Brand = {}));
|
|
34
|
+
|
|
35
|
+
// src/Types/NonEmptyList.ts
|
|
36
|
+
var isNonEmptyList = (list) => list.length > 0;
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
Brand,
|
|
40
|
+
isNonEmptyList
|
|
41
|
+
});
|