@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.
Files changed (213) hide show
  1. package/LICENCE +28 -0
  2. package/README.md +1 -1
  3. package/{types/src/Types/NonEmptyList.d.ts → dist/NonEmptyList-BlGFjor5.d.mts} +4 -3
  4. package/dist/NonEmptyList-BlGFjor5.d.ts +30 -0
  5. package/dist/Task-Bd3gXPRQ.d.mts +677 -0
  6. package/dist/Task-BjAkkD6t.d.ts +677 -0
  7. package/dist/chunk-4TXC322E.mjs +136 -0
  8. package/dist/chunk-BYWKZLHM.mjs +10 -0
  9. package/dist/chunk-DBIC62UV.mjs +6 -0
  10. package/dist/chunk-FAZN3IWZ.mjs +554 -0
  11. package/dist/chunk-QPTGO5AS.mjs +150 -0
  12. package/dist/chunk-UV2HMF2A.mjs +514 -0
  13. package/dist/composition.d.mts +495 -0
  14. package/dist/composition.d.ts +495 -0
  15. package/dist/composition.js +188 -0
  16. package/dist/composition.mjs +58 -0
  17. package/dist/core.d.mts +2170 -0
  18. package/dist/core.d.ts +2170 -0
  19. package/dist/core.js +698 -0
  20. package/dist/core.mjs +42 -0
  21. package/dist/index.d.mts +6 -0
  22. package/dist/index.d.ts +6 -0
  23. package/dist/index.js +1421 -0
  24. package/dist/index.mjs +120 -0
  25. package/dist/types.d.mts +54 -0
  26. package/{types/src/Types/Brand.d.ts → dist/types.d.ts} +6 -4
  27. package/dist/types.js +41 -0
  28. package/dist/types.mjs +10 -0
  29. package/dist/utils.d.mts +1285 -0
  30. package/dist/utils.d.ts +1285 -0
  31. package/dist/utils.js +722 -0
  32. package/dist/utils.mjs +18 -0
  33. package/package.json +64 -69
  34. package/esm/mod.js +0 -3
  35. package/esm/package.json +0 -3
  36. package/esm/src/Composition/compose.js +0 -3
  37. package/esm/src/Composition/converge.js +0 -3
  38. package/esm/src/Composition/curry.js +0 -42
  39. package/esm/src/Composition/flip.js +0 -20
  40. package/esm/src/Composition/flow.js +0 -8
  41. package/esm/src/Composition/fn.js +0 -85
  42. package/esm/src/Composition/index.js +0 -13
  43. package/esm/src/Composition/juxt.js +0 -3
  44. package/esm/src/Composition/memoize.js +0 -66
  45. package/esm/src/Composition/not.js +0 -25
  46. package/esm/src/Composition/on.js +0 -12
  47. package/esm/src/Composition/pipe.js +0 -3
  48. package/esm/src/Composition/tap.js +0 -33
  49. package/esm/src/Composition/uncurry.js +0 -32
  50. package/esm/src/Core/Deferred.js +0 -30
  51. package/esm/src/Core/InternalTypes.js +0 -1
  52. package/esm/src/Core/Lens.js +0 -98
  53. package/esm/src/Core/Logged.js +0 -111
  54. package/esm/src/Core/Option.js +0 -191
  55. package/esm/src/Core/Optional.js +0 -160
  56. package/esm/src/Core/Predicate.js +0 -133
  57. package/esm/src/Core/Reader.js +0 -134
  58. package/esm/src/Core/Refinement.js +0 -115
  59. package/esm/src/Core/RemoteData.js +0 -211
  60. package/esm/src/Core/Result.js +0 -170
  61. package/esm/src/Core/State.js +0 -181
  62. package/esm/src/Core/Task.js +0 -223
  63. package/esm/src/Core/TaskOption.js +0 -106
  64. package/esm/src/Core/TaskResult.js +0 -127
  65. package/esm/src/Core/TaskValidation.js +0 -128
  66. package/esm/src/Core/These.js +0 -245
  67. package/esm/src/Core/Tuple.js +0 -112
  68. package/esm/src/Core/Validation.js +0 -212
  69. package/esm/src/Core/index.js +0 -18
  70. package/esm/src/Types/Brand.js +0 -28
  71. package/esm/src/Types/NonEmptyList.js +0 -14
  72. package/esm/src/Types/index.js +0 -2
  73. package/esm/src/Utils/Arr.js +0 -570
  74. package/esm/src/Utils/Dict.js +0 -421
  75. package/esm/src/Utils/Num.js +0 -124
  76. package/esm/src/Utils/Rec.js +0 -241
  77. package/esm/src/Utils/Str.js +0 -134
  78. package/esm/src/Utils/Uniq.js +0 -265
  79. package/esm/src/Utils/index.js +0 -6
  80. package/script/mod.js +0 -19
  81. package/script/package.json +0 -3
  82. package/script/src/Composition/compose.js +0 -6
  83. package/script/src/Composition/converge.js +0 -6
  84. package/script/src/Composition/curry.js +0 -48
  85. package/script/src/Composition/flip.js +0 -24
  86. package/script/src/Composition/flow.js +0 -11
  87. package/script/src/Composition/fn.js +0 -98
  88. package/script/src/Composition/index.js +0 -29
  89. package/script/src/Composition/juxt.js +0 -6
  90. package/script/src/Composition/memoize.js +0 -71
  91. package/script/src/Composition/not.js +0 -29
  92. package/script/src/Composition/on.js +0 -16
  93. package/script/src/Composition/pipe.js +0 -6
  94. package/script/src/Composition/tap.js +0 -37
  95. package/script/src/Composition/uncurry.js +0 -38
  96. package/script/src/Core/Deferred.js +0 -33
  97. package/script/src/Core/InternalTypes.js +0 -2
  98. package/script/src/Core/Lens.js +0 -101
  99. package/script/src/Core/Logged.js +0 -114
  100. package/script/src/Core/Option.js +0 -194
  101. package/script/src/Core/Optional.js +0 -163
  102. package/script/src/Core/Predicate.js +0 -136
  103. package/script/src/Core/Reader.js +0 -137
  104. package/script/src/Core/Refinement.js +0 -118
  105. package/script/src/Core/RemoteData.js +0 -214
  106. package/script/src/Core/Result.js +0 -173
  107. package/script/src/Core/State.js +0 -184
  108. package/script/src/Core/Task.js +0 -226
  109. package/script/src/Core/TaskOption.js +0 -109
  110. package/script/src/Core/TaskResult.js +0 -130
  111. package/script/src/Core/TaskValidation.js +0 -131
  112. package/script/src/Core/These.js +0 -248
  113. package/script/src/Core/Tuple.js +0 -115
  114. package/script/src/Core/Validation.js +0 -215
  115. package/script/src/Core/index.js +0 -34
  116. package/script/src/Types/Brand.js +0 -31
  117. package/script/src/Types/NonEmptyList.js +0 -18
  118. package/script/src/Types/index.js +0 -18
  119. package/script/src/Utils/Arr.js +0 -573
  120. package/script/src/Utils/Dict.js +0 -424
  121. package/script/src/Utils/Num.js +0 -127
  122. package/script/src/Utils/Rec.js +0 -244
  123. package/script/src/Utils/Str.js +0 -137
  124. package/script/src/Utils/Uniq.js +0 -268
  125. package/script/src/Utils/index.js +0 -22
  126. package/types/mod.d.ts +0 -4
  127. package/types/mod.d.ts.map +0 -1
  128. package/types/src/Composition/compose.d.ts +0 -33
  129. package/types/src/Composition/compose.d.ts.map +0 -1
  130. package/types/src/Composition/converge.d.ts +0 -21
  131. package/types/src/Composition/converge.d.ts.map +0 -1
  132. package/types/src/Composition/curry.d.ts +0 -43
  133. package/types/src/Composition/curry.d.ts.map +0 -1
  134. package/types/src/Composition/flip.d.ts +0 -21
  135. package/types/src/Composition/flip.d.ts.map +0 -1
  136. package/types/src/Composition/flow.d.ts +0 -56
  137. package/types/src/Composition/flow.d.ts.map +0 -1
  138. package/types/src/Composition/fn.d.ts +0 -76
  139. package/types/src/Composition/fn.d.ts.map +0 -1
  140. package/types/src/Composition/index.d.ts +0 -14
  141. package/types/src/Composition/index.d.ts.map +0 -1
  142. package/types/src/Composition/juxt.d.ts +0 -18
  143. package/types/src/Composition/juxt.d.ts.map +0 -1
  144. package/types/src/Composition/memoize.d.ts +0 -46
  145. package/types/src/Composition/memoize.d.ts.map +0 -1
  146. package/types/src/Composition/not.d.ts +0 -26
  147. package/types/src/Composition/not.d.ts.map +0 -1
  148. package/types/src/Composition/on.d.ts +0 -13
  149. package/types/src/Composition/on.d.ts.map +0 -1
  150. package/types/src/Composition/pipe.d.ts +0 -56
  151. package/types/src/Composition/pipe.d.ts.map +0 -1
  152. package/types/src/Composition/tap.d.ts +0 -31
  153. package/types/src/Composition/tap.d.ts.map +0 -1
  154. package/types/src/Composition/uncurry.d.ts +0 -54
  155. package/types/src/Composition/uncurry.d.ts.map +0 -1
  156. package/types/src/Core/Deferred.d.ts +0 -49
  157. package/types/src/Core/Deferred.d.ts.map +0 -1
  158. package/types/src/Core/InternalTypes.d.ts +0 -23
  159. package/types/src/Core/InternalTypes.d.ts.map +0 -1
  160. package/types/src/Core/Lens.d.ts +0 -118
  161. package/types/src/Core/Lens.d.ts.map +0 -1
  162. package/types/src/Core/Logged.d.ts +0 -126
  163. package/types/src/Core/Logged.d.ts.map +0 -1
  164. package/types/src/Core/Option.d.ts +0 -209
  165. package/types/src/Core/Option.d.ts.map +0 -1
  166. package/types/src/Core/Optional.d.ts +0 -158
  167. package/types/src/Core/Optional.d.ts.map +0 -1
  168. package/types/src/Core/Predicate.d.ts +0 -161
  169. package/types/src/Core/Predicate.d.ts.map +0 -1
  170. package/types/src/Core/Reader.d.ts +0 -156
  171. package/types/src/Core/Reader.d.ts.map +0 -1
  172. package/types/src/Core/Refinement.d.ts +0 -138
  173. package/types/src/Core/Refinement.d.ts.map +0 -1
  174. package/types/src/Core/RemoteData.d.ts +0 -197
  175. package/types/src/Core/RemoteData.d.ts.map +0 -1
  176. package/types/src/Core/Result.d.ts +0 -182
  177. package/types/src/Core/Result.d.ts.map +0 -1
  178. package/types/src/Core/State.d.ts +0 -192
  179. package/types/src/Core/State.d.ts.map +0 -1
  180. package/types/src/Core/Task.d.ts +0 -219
  181. package/types/src/Core/Task.d.ts.map +0 -1
  182. package/types/src/Core/TaskOption.d.ts +0 -121
  183. package/types/src/Core/TaskOption.d.ts.map +0 -1
  184. package/types/src/Core/TaskResult.d.ts +0 -119
  185. package/types/src/Core/TaskResult.d.ts.map +0 -1
  186. package/types/src/Core/TaskValidation.d.ts +0 -144
  187. package/types/src/Core/TaskValidation.d.ts.map +0 -1
  188. package/types/src/Core/These.d.ts +0 -225
  189. package/types/src/Core/These.d.ts.map +0 -1
  190. package/types/src/Core/Tuple.d.ts +0 -129
  191. package/types/src/Core/Tuple.d.ts.map +0 -1
  192. package/types/src/Core/Validation.d.ts +0 -203
  193. package/types/src/Core/Validation.d.ts.map +0 -1
  194. package/types/src/Core/index.d.ts +0 -19
  195. package/types/src/Core/index.d.ts.map +0 -1
  196. package/types/src/Types/Brand.d.ts.map +0 -1
  197. package/types/src/Types/NonEmptyList.d.ts.map +0 -1
  198. package/types/src/Types/index.d.ts +0 -3
  199. package/types/src/Types/index.d.ts.map +0 -1
  200. package/types/src/Utils/Arr.d.ts +0 -403
  201. package/types/src/Utils/Arr.d.ts.map +0 -1
  202. package/types/src/Utils/Dict.d.ts +0 -310
  203. package/types/src/Utils/Dict.d.ts.map +0 -1
  204. package/types/src/Utils/Num.d.ts +0 -110
  205. package/types/src/Utils/Num.d.ts.map +0 -1
  206. package/types/src/Utils/Rec.d.ts +0 -159
  207. package/types/src/Utils/Rec.d.ts.map +0 -1
  208. package/types/src/Utils/Str.d.ts +0 -128
  209. package/types/src/Utils/Str.d.ts.map +0 -1
  210. package/types/src/Utils/Uniq.d.ts +0 -179
  211. package/types/src/Utils/Uniq.d.ts.map +0 -1
  212. package/types/src/Utils/index.d.ts +0 -7
  213. 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
+ };
@@ -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
- export type Brand<K extends string, T> = T & {
23
+ type Brand<K extends string, T> = T & {
22
24
  readonly [_brand]: K;
23
25
  };
24
- export declare namespace Brand {
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
- export {};
52
- //# sourceMappingURL=Brand.d.ts.map
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
+ });
package/dist/types.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ Brand
3
+ } from "./chunk-BYWKZLHM.mjs";
4
+ import {
5
+ isNonEmptyList
6
+ } from "./chunk-DBIC62UV.mjs";
7
+ export {
8
+ Brand,
9
+ isNonEmptyList
10
+ };