@carbonteq/fp 0.9.1 → 0.10.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 +310 -96
- package/dist/errors.cjs +1 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.mts.map +1 -1
- package/dist/errors.mjs.map +1 -1
- package/dist/flow-experimental.cjs +286 -0
- package/dist/flow-experimental.cjs.map +1 -0
- package/dist/flow-experimental.d.cts +69 -0
- package/dist/flow-experimental.d.cts.map +1 -0
- package/dist/flow-experimental.d.mts +69 -0
- package/dist/flow-experimental.d.mts.map +1 -0
- package/dist/flow-experimental.mjs +284 -0
- package/dist/flow-experimental.mjs.map +1 -0
- package/dist/flow.cjs +296 -0
- package/dist/flow.cjs.map +1 -0
- package/dist/flow.d.cts +79 -0
- package/dist/flow.d.cts.map +1 -0
- package/dist/flow.d.mts +79 -0
- package/dist/flow.d.mts.map +1 -0
- package/dist/flow.mjs +294 -0
- package/dist/flow.mjs.map +1 -0
- package/dist/index.cjs +26 -11
- package/dist/index.d.cts +8 -3
- package/dist/index.d.mts +8 -3
- package/dist/index.mjs +8 -3
- package/dist/match.cjs +282 -0
- package/dist/match.cjs.map +1 -1
- package/dist/match.d.cts +471 -5
- package/dist/match.d.cts.map +1 -1
- package/dist/match.d.mts +471 -5
- package/dist/match.d.mts.map +1 -1
- package/dist/match.mjs +277 -1
- package/dist/match.mjs.map +1 -1
- package/dist/option-experimental.cjs +1503 -0
- package/dist/option-experimental.cjs.map +1 -0
- package/dist/option-experimental.d.cts +1383 -0
- package/dist/option-experimental.d.cts.map +1 -0
- package/dist/option-experimental.d.mts +1383 -0
- package/dist/option-experimental.d.mts.map +1 -0
- package/dist/option-experimental.mjs +1501 -0
- package/dist/option-experimental.mjs.map +1 -0
- package/dist/option.cjs +556 -29
- package/dist/option.cjs.map +1 -1
- package/dist/option.d.cts +505 -24
- package/dist/option.d.cts.map +1 -1
- package/dist/option.d.mts +505 -24
- package/dist/option.d.mts.map +1 -1
- package/dist/option.mjs +556 -30
- package/dist/option.mjs.map +1 -1
- package/dist/result-experimental.cjs +1266 -0
- package/dist/result-experimental.cjs.map +1 -0
- package/dist/result-experimental.d.cts +1127 -0
- package/dist/result-experimental.d.cts.map +1 -0
- package/dist/result-experimental.d.mts +1127 -0
- package/dist/result-experimental.d.mts.map +1 -0
- package/dist/result-experimental.mjs +1265 -0
- package/dist/result-experimental.mjs.map +1 -0
- package/dist/result.cjs +715 -122
- package/dist/result.cjs.map +1 -1
- package/dist/result.d.cts +785 -94
- package/dist/result.d.cts.map +1 -1
- package/dist/result.d.mts +785 -94
- package/dist/result.d.mts.map +1 -1
- package/dist/result.mjs +714 -117
- package/dist/result.mjs.map +1 -1
- package/dist/tuple.cjs +3 -0
- package/dist/tuple.cjs.map +1 -1
- package/dist/tuple.d.cts +5 -1
- package/dist/tuple.d.cts.map +1 -1
- package/dist/tuple.d.mts +5 -1
- package/dist/tuple.d.mts.map +1 -1
- package/dist/tuple.mjs +2 -0
- package/dist/tuple.mjs.map +1 -1
- package/dist/unit.cjs +2 -0
- package/dist/unit.cjs.map +1 -1
- package/dist/unit.d.cts +2 -0
- package/dist/unit.d.cts.map +1 -1
- package/dist/unit.d.mts +2 -0
- package/dist/unit.d.mts.map +1 -1
- package/dist/unit.mjs +1 -0
- package/dist/unit.mjs.map +1 -1
- package/dist/utils.cjs +15 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +10 -1
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.mts +10 -1
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +13 -1
- package/dist/utils.mjs.map +1 -1
- package/examples/README.md +46 -0
- package/examples/flow/01-basics.ts +74 -0
- package/examples/flow/02-async.ts +73 -0
- package/examples/flow/03-recovery.ts +60 -0
- package/examples/flow/04-complex-backend.ts +237 -0
- package/examples/flow/05-complex-backend-asyncGen.ts +224 -0
- package/examples/flow/index.ts +13 -0
- package/examples/flow-experimental/01-basics.ts +78 -0
- package/examples/flow-experimental/02-async.ts +77 -0
- package/examples/flow-experimental/03-recovery.ts +93 -0
- package/examples/flow-experimental/04-complex-backend.ts +241 -0
- package/examples/flow-experimental/05-complex-backend-asyncGen.ts +229 -0
- package/examples/flow-experimental/index.ts +14 -0
- package/examples/match/01-stable-match.ts +147 -0
- package/examples/match/index.ts +19 -0
- package/examples/match-experimental/01-experimental-match.ts +150 -0
- package/examples/match-experimental/index.ts +18 -0
- package/examples/option/01-basics.ts +16 -0
- package/examples/option/02-map-flatMap.ts +36 -0
- package/examples/option/03-zip-flatZip.ts +23 -0
- package/examples/option/04-constructors.ts +21 -0
- package/examples/option/05-transform.ts +15 -0
- package/examples/option/06-aggregation.ts +14 -0
- package/examples/option/index.ts +49 -0
- package/examples/option-experimental/01-map.ts +109 -0
- package/examples/option-experimental/02-flatMap.ts +234 -0
- package/examples/option-experimental/03-zip.ts +197 -0
- package/examples/option-experimental/04-flatZip.ts +251 -0
- package/examples/option-experimental/05-gen.ts +360 -0
- package/examples/option-experimental/06-genAdapter.ts +463 -0
- package/examples/option-experimental/07-asyncGen.ts +353 -0
- package/examples/option-experimental/08-asyncGenAdapter.ts +514 -0
- package/examples/option-experimental/09-workflow-simple-sync.ts +321 -0
- package/examples/option-experimental/10-workflow-async.ts +378 -0
- package/examples/option-experimental/index.ts +341 -0
- package/examples/option-experimental/shared-domain.ts +325 -0
- package/examples/result/01-basics.ts +16 -0
- package/examples/result/02-map-flatMap.ts +34 -0
- package/examples/result/03-zip-flatZip.ts +23 -0
- package/examples/result/04-validation.ts +44 -0
- package/examples/result/05-constructors.ts +30 -0
- package/examples/result/06-utilities.ts +36 -0
- package/examples/result/index.ts +53 -0
- package/examples/result-experimental/01-map.ts +60 -0
- package/examples/result-experimental/02-flatMap.ts +169 -0
- package/examples/result-experimental/03-zip.ts +145 -0
- package/examples/result-experimental/04-flatZip.ts +252 -0
- package/examples/result-experimental/05-gen.ts +293 -0
- package/examples/result-experimental/06-genAdapter.ts +396 -0
- package/examples/result-experimental/07-asyncGen.ts +379 -0
- package/examples/result-experimental/08-asyncGenAdapter.ts +553 -0
- package/examples/result-experimental/09-workflow-simple-sync.ts +304 -0
- package/examples/result-experimental/10-workflow-async.ts +356 -0
- package/examples/result-experimental/index.ts +312 -0
- package/examples/result-experimental/shared-domain.ts +263 -0
- package/package.json +50 -18
package/dist/option.d.cts
CHANGED
|
@@ -14,85 +14,566 @@ declare class UnwrappedNone extends Error {
|
|
|
14
14
|
readonly name = "UnwrapError";
|
|
15
15
|
constructor();
|
|
16
16
|
}
|
|
17
|
+
/** Option alias for presence-without-payload values. */
|
|
17
18
|
type UnitOption = Option<UNIT>;
|
|
19
|
+
/** Extracts the contained value type from an Option type. */
|
|
18
20
|
type UnwrapOption<T> = T extends Option<infer R> ? R : never;
|
|
19
21
|
type CombinedOptions<T extends Option<unknown>[]> = { [K in keyof T]: UnwrapOption<T[K]> };
|
|
20
22
|
interface MatchCases<T, U> {
|
|
21
23
|
Some: (val: T) => U;
|
|
22
24
|
None: () => U;
|
|
23
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Wrapper that makes Option yieldable with proper type tracking.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
declare class OptionYieldWrap<T> {
|
|
32
|
+
readonly option: Option<T>;
|
|
33
|
+
constructor(option: Option<T>);
|
|
34
|
+
[Symbol.iterator](): Generator<OptionYieldWrap<T>, T, unknown>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Wrapper that makes Option yieldable in async generators with proper type tracking.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
declare class AsyncOptionYieldWrap<T> {
|
|
42
|
+
readonly option: Promise<Option<T>>;
|
|
43
|
+
constructor(option: Option<T> | Promise<Option<T>>);
|
|
44
|
+
[Symbol.asyncIterator](): AsyncGenerator<AsyncOptionYieldWrap<T>, Awaited<T>, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Represents an optional value: `Some<T>` or `None`.
|
|
48
|
+
* Provides composable, null-safe transformation and chaining methods.
|
|
49
|
+
*/
|
|
24
50
|
declare class Option<T> {
|
|
25
51
|
#private;
|
|
26
52
|
/** Discriminant tag for type-level identification */
|
|
27
53
|
readonly _tag: "Some" | "None";
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new Option instance with internal context.
|
|
56
|
+
*
|
|
57
|
+
* @param val - Stored value or sentinel
|
|
58
|
+
* @param ctx - Internal async tracking context
|
|
59
|
+
* @param tag - Discriminant tag for Some/None
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
28
63
|
private constructor();
|
|
29
64
|
/** Singleton None instance */
|
|
30
65
|
static readonly None: Option<never>;
|
|
31
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Creates a Some variant containing the provided value.
|
|
68
|
+
*
|
|
69
|
+
* @template Inner - Type of the wrapped value
|
|
70
|
+
* @param val - Value to wrap in Some
|
|
71
|
+
* @returns Option in the Some state
|
|
72
|
+
*/
|
|
32
73
|
static Some<Inner>(this: void, val: Inner): Option<Inner>;
|
|
33
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Creates an Option from a nullable value, returning None for null/undefined.
|
|
76
|
+
*
|
|
77
|
+
* @template T - Input type that may include null/undefined
|
|
78
|
+
* @param val - Value to convert
|
|
79
|
+
* @returns Some for non-nullish values, otherwise None
|
|
80
|
+
*/
|
|
34
81
|
static fromNullable<T>(val: T): Option<NonNullable<T>>;
|
|
35
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Creates an Option from a potentially falsy value, returning None for falsy.
|
|
84
|
+
*
|
|
85
|
+
* Treats false, 0, "", null, and undefined as absence.
|
|
86
|
+
*
|
|
87
|
+
* @template T - Input type
|
|
88
|
+
* @param val - Value to convert
|
|
89
|
+
* @returns Some for truthy values, otherwise None
|
|
90
|
+
*/
|
|
36
91
|
static fromFalsy<T>(val: T | Falsy): Option<T>;
|
|
37
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Creates an Option based on a predicate.
|
|
94
|
+
*
|
|
95
|
+
* @template T - Input type
|
|
96
|
+
* @param val - Value to test
|
|
97
|
+
* @param pred - Predicate to decide Some vs None
|
|
98
|
+
* @returns Some when predicate passes, otherwise None
|
|
99
|
+
*/
|
|
38
100
|
static fromPredicate<T>(val: T, pred: Predicate<T>): Option<T>;
|
|
39
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Wraps a Promise<Option<T>> as Option<Promise<T>>.
|
|
103
|
+
*
|
|
104
|
+
* NOTE: the returned value starts as `Some(Promise<T>)`; final `None` is known
|
|
105
|
+
* only after settlement. Use `toPromise()` (or await `unwrap`/`safeUnwrap`) to
|
|
106
|
+
* observe settled absence.
|
|
107
|
+
*
|
|
108
|
+
* @template U - Inner value type
|
|
109
|
+
* @param o - Promise resolving to an Option
|
|
110
|
+
* @returns Option containing a Promise of the inner value
|
|
111
|
+
*/
|
|
40
112
|
static fromPromise<U>(o: Promise<Option<U>>): Option<Promise<U>>;
|
|
41
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Combines multiple Options into a single Option of an array.
|
|
115
|
+
*
|
|
116
|
+
* Returns Some of all values if all inputs are Some; otherwise None.
|
|
117
|
+
*
|
|
118
|
+
* @template T - Variadic tuple of Option types
|
|
119
|
+
* @param options - Options to combine
|
|
120
|
+
* @returns Some of tuple values, or None if any input is None
|
|
121
|
+
*/
|
|
42
122
|
static all<T extends Option<unknown>[]>(...options: T): Option<CombinedOptions<T>>;
|
|
43
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Returns the first Some in the list, or None if all are None.
|
|
125
|
+
*
|
|
126
|
+
* For async Some values, settlement is awaited and selection follows input order.
|
|
127
|
+
*
|
|
128
|
+
* @template T - Value type
|
|
129
|
+
* @param options - Options to search
|
|
130
|
+
* @returns The first Some found, otherwise None
|
|
131
|
+
*/
|
|
44
132
|
static any<T>(...options: Option<T>[]): Option<T>;
|
|
45
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* Type guard that narrows to Some.
|
|
135
|
+
*
|
|
136
|
+
* @returns true if this Option is Some
|
|
137
|
+
*/
|
|
46
138
|
isSome(): this is Option<T> & {
|
|
47
139
|
readonly _tag: "Some";
|
|
48
140
|
};
|
|
49
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Type guard that narrows to None.
|
|
143
|
+
*
|
|
144
|
+
* Includes async None tracking for Option<Promise<T>>.
|
|
145
|
+
*
|
|
146
|
+
* @returns true if this Option is None
|
|
147
|
+
*/
|
|
50
148
|
isNone(): this is Option<never> & {
|
|
51
149
|
readonly _tag: "None";
|
|
52
150
|
};
|
|
53
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* Type guard for the UNIT sentinel value.
|
|
153
|
+
*
|
|
154
|
+
* @returns true if the contained value is UNIT
|
|
155
|
+
*/
|
|
54
156
|
isUnit(): this is Option<UNIT>;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Returns the contained value or throws if None.
|
|
159
|
+
*
|
|
160
|
+
* @throws UnwrappedNone when called on None
|
|
161
|
+
* @returns The contained value
|
|
162
|
+
*/
|
|
163
|
+
unwrap(this: Option<never>): never;
|
|
164
|
+
unwrap(this: Option<Promise<T>>): Promise<T>;
|
|
165
|
+
unwrap(this: Option<T>): T;
|
|
166
|
+
/**
|
|
167
|
+
* Returns the contained value or the provided default.
|
|
168
|
+
*
|
|
169
|
+
* @param defaultValue - Value to use when None
|
|
170
|
+
* @returns The contained value or default
|
|
171
|
+
*/
|
|
58
172
|
unwrapOr(defaultValue: T): T;
|
|
59
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* Returns the contained value or computes a default lazily.
|
|
175
|
+
*
|
|
176
|
+
* @param fn - Default factory invoked only when None
|
|
177
|
+
* @returns The contained value or computed default
|
|
178
|
+
*/
|
|
60
179
|
unwrapOrElse(fn: () => T): T;
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Returns the contained value or null for None.
|
|
182
|
+
*
|
|
183
|
+
* @returns The contained value, or null when None
|
|
184
|
+
*/
|
|
185
|
+
safeUnwrap(this: Option<never>): null;
|
|
186
|
+
safeUnwrap(this: Option<Promise<T>>): Promise<T | null>;
|
|
187
|
+
safeUnwrap(this: Option<T>): T | null;
|
|
188
|
+
/**
|
|
189
|
+
* Exhaustive pattern match on Option state.
|
|
190
|
+
*
|
|
191
|
+
* @template U - Result type
|
|
192
|
+
* @param cases - Handlers for Some and None
|
|
193
|
+
* @returns Result of the matching handler
|
|
194
|
+
*/
|
|
64
195
|
match<U>(cases: MatchCases<T, U>): U;
|
|
196
|
+
/**
|
|
197
|
+
* Transforms the contained value and wraps it in a new Option.
|
|
198
|
+
*
|
|
199
|
+
* If None, returns None without calling the mapper. Supports async values
|
|
200
|
+
* and async mappers; returns Option<Promise<U>> when async is involved.
|
|
201
|
+
*
|
|
202
|
+
* @template U - Result value type
|
|
203
|
+
* @param mapper - Function to transform the contained value
|
|
204
|
+
* @returns Option of the mapped value (sync or async)
|
|
205
|
+
*
|
|
206
|
+
* @see flatMap
|
|
207
|
+
*/
|
|
65
208
|
map<U, Curr = Awaited<T>>(this: Option<Promise<Curr>>, mapper: AsyncMapper<Curr, U>): Option<Promise<U>>;
|
|
66
209
|
map<U, Curr = Awaited<T>>(this: Option<Promise<Curr>>, mapper: Mapper<Curr, U>): Option<Promise<U>>;
|
|
67
210
|
map<U>(this: Option<T>, mapper: AsyncMapper<T, U>): Option<Promise<U>>;
|
|
68
211
|
map<U>(this: Option<T>, mapper: Mapper<T, U>): Option<U>;
|
|
212
|
+
/**
|
|
213
|
+
* Safely maps a promised value while tracking None in async context.
|
|
214
|
+
*
|
|
215
|
+
* @template Curr - Input value type
|
|
216
|
+
* @template U - Output value type
|
|
217
|
+
* @param p - Promise to map over
|
|
218
|
+
* @param mapper - Transform function
|
|
219
|
+
* @param ctx - Async context for None tracking
|
|
220
|
+
* @returns Promise of the transformed value or sentinel
|
|
221
|
+
*/
|
|
69
222
|
private static safeMap;
|
|
223
|
+
/**
|
|
224
|
+
* Maps the value or returns a default (unwrapped).
|
|
225
|
+
*
|
|
226
|
+
* If None, returns the default without calling fn. Supports async values
|
|
227
|
+
* and async mappers; returns Promise<U> when async is involved.
|
|
228
|
+
*
|
|
229
|
+
* @template U - Result type
|
|
230
|
+
* @param defaultVal - Value to return if None
|
|
231
|
+
* @param fn - Mapper applied when Some
|
|
232
|
+
* @returns Mapped value or default (sync or async)
|
|
233
|
+
*/
|
|
70
234
|
mapOr<U, Curr = Awaited<T>>(this: Option<Promise<Curr>>, defaultVal: U, fn: Mapper<Curr, U>): Promise<U>;
|
|
71
235
|
mapOr<U, Curr = Awaited<T>>(this: Option<Promise<Curr>>, defaultVal: U, fn: AsyncMapper<Curr, U>): Promise<U>;
|
|
236
|
+
mapOr<U>(this: Option<T>, defaultVal: U, fn: AsyncMapper<T, U>): Promise<U>;
|
|
72
237
|
mapOr<U>(this: Option<T>, defaultVal: U, fn: Mapper<T, U>): U;
|
|
238
|
+
/**
|
|
239
|
+
* Chains operations that return Option, flattening nested Options.
|
|
240
|
+
*
|
|
241
|
+
* If None, returns None without calling the mapper. Supports async values
|
|
242
|
+
* and async mappers; returns Option<Promise<U>> when async is involved.
|
|
243
|
+
*
|
|
244
|
+
* @template U - Result value type
|
|
245
|
+
* @param mapper - Function returning an Option
|
|
246
|
+
* @returns Flattened Option result (sync or async)
|
|
247
|
+
*
|
|
248
|
+
* @see map
|
|
249
|
+
*/
|
|
73
250
|
flatMap<U, Curr = Awaited<T>>(this: Option<Promise<Curr>>, mapper: AsyncFlatMapper<Curr, U>): Option<Promise<U>>;
|
|
74
251
|
flatMap<U, Curr = Awaited<T>>(this: Option<Promise<Curr>>, mapper: FlatMapper<Curr, U>): Option<Promise<U>>;
|
|
75
252
|
flatMap<U>(this: Option<T>, mapper: AsyncFlatMapper<T, U>): Option<Promise<U>>;
|
|
76
253
|
flatMap<U>(this: Option<T>, mapper: FlatMapper<T, U>): Option<U>;
|
|
254
|
+
/**
|
|
255
|
+
* Filters the contained value by a predicate.
|
|
256
|
+
*
|
|
257
|
+
* If Some, returns Some when predicate passes, otherwise None. Supports
|
|
258
|
+
* async values and async predicates; returns Option<Promise<T>> when async.
|
|
259
|
+
*
|
|
260
|
+
* @param pred - Predicate function
|
|
261
|
+
* @returns Option filtered by the predicate (sync or async)
|
|
262
|
+
*/
|
|
77
263
|
filter(pred: FilterPredicate<T>): Option<T>;
|
|
78
264
|
filter(pred: AsyncPredicate<T>): Option<Promise<T>>;
|
|
265
|
+
/**
|
|
266
|
+
* Pairs the original value with a derived value in a tuple.
|
|
267
|
+
*
|
|
268
|
+
* If None, returns None. Supports async values and async derivation; returns
|
|
269
|
+
* Option<Promise<[Curr, Awaited<U>]>> when async is involved.
|
|
270
|
+
*
|
|
271
|
+
* @template U - Derived value type
|
|
272
|
+
* @param fn - Function to derive a value from the contained value
|
|
273
|
+
* @returns Option of tuple with original and derived values
|
|
274
|
+
*/
|
|
79
275
|
zip<U, Curr>(this: Option<Promise<Curr>>, fn: (val: Curr) => U): Option<Promise<[Curr, Awaited<U>]>>;
|
|
80
276
|
zip<U, Curr>(this: Option<Curr>, fn: (val: Curr) => Promise<U>): Option<Promise<[Curr, Awaited<U>]>>;
|
|
81
277
|
zip<U, Curr>(this: Option<Curr>, fn: (val: Curr) => U): Option<[Curr, U]>;
|
|
278
|
+
/**
|
|
279
|
+
* Pairs the original value with a derived Option value, flattening the result.
|
|
280
|
+
*
|
|
281
|
+
* If None, returns None. Supports async values and async Option derivation;
|
|
282
|
+
* returns Option<Promise<[Curr, U]>> when async is involved.
|
|
283
|
+
*
|
|
284
|
+
* @template U - Derived Option value type
|
|
285
|
+
* @param fn - Function returning an Option
|
|
286
|
+
* @returns Option of tuple with original and derived values
|
|
287
|
+
*/
|
|
82
288
|
flatZip<U, Curr>(this: Option<Promise<Curr>>, fn: (val: Curr) => Promise<Option<U>>): Option<Promise<[Curr, U]>>;
|
|
83
289
|
flatZip<U, Curr>(this: Option<Promise<Curr>>, fn: (val: Curr) => Option<U>): Option<Promise<[Curr, U]>>;
|
|
84
|
-
flatZip<U, Curr>(this: Option<Curr>, fn: (val: Curr) => Promise<Option<U>>): Option<Promise<[
|
|
85
|
-
flatZip<U, Curr>(this: Option<Curr>, fn: (val: Curr) => Option<U>): Option<[
|
|
86
|
-
/**
|
|
290
|
+
flatZip<U, Curr>(this: Option<Curr>, fn: (val: Curr) => Promise<Option<U>>): Option<Promise<[Curr, U]>>;
|
|
291
|
+
flatZip<U, Curr>(this: Option<Curr>, fn: (val: Curr) => Option<U>): Option<[Curr, U]>;
|
|
292
|
+
/**
|
|
293
|
+
* Executes a side effect for Some values and returns self.
|
|
294
|
+
*
|
|
295
|
+
* For `Option<Promise<T>>`, `tap` receives the wrapped promise object,
|
|
296
|
+
* not the settled inner value.
|
|
297
|
+
*
|
|
298
|
+
* @param fn - Side effect function
|
|
299
|
+
* @returns The same Option (chainable)
|
|
300
|
+
*/
|
|
87
301
|
tap(fn: (val: T) => void): Option<T>;
|
|
88
|
-
/**
|
|
302
|
+
/**
|
|
303
|
+
* Converts this Option to a Result, using the provided error for None.
|
|
304
|
+
*
|
|
305
|
+
* @template E - Error type
|
|
306
|
+
* @param error - Error value for None
|
|
307
|
+
* @returns Ok with value when Some, otherwise Err with error
|
|
308
|
+
*/
|
|
89
309
|
toResult<E>(error: E): Result<T, E>;
|
|
90
|
-
/**
|
|
310
|
+
/**
|
|
311
|
+
* Resolves the inner promise (if any) while preserving Option structure.
|
|
312
|
+
*
|
|
313
|
+
* @template Curr - Awaited value type
|
|
314
|
+
* @returns Promise of Option with awaited value, or None
|
|
315
|
+
*/
|
|
91
316
|
toPromise<Curr = Awaited<T>>(): Promise<Option<Curr>>;
|
|
92
|
-
/**
|
|
317
|
+
/**
|
|
318
|
+
* Maps over array elements inside an Option<Array<T>>.
|
|
319
|
+
*
|
|
320
|
+
* @template Inner - Array element type
|
|
321
|
+
* @template Out - Mapped element type
|
|
322
|
+
* @param mapper - Function to map each element
|
|
323
|
+
* @returns Option containing the mapped array
|
|
324
|
+
* @throws TypeError if called on a non-array value
|
|
325
|
+
*/
|
|
93
326
|
innerMap<Inner, Out>(this: Option<Array<Inner>>, mapper: (val: Inner) => Out): Option<NoInfer<Out>[]>;
|
|
94
|
-
/**
|
|
327
|
+
/**
|
|
328
|
+
* Returns a string representation of the Option.
|
|
329
|
+
*
|
|
330
|
+
* @returns "Option::None" or "Option::Some(value)"
|
|
331
|
+
*/
|
|
95
332
|
toString(): string;
|
|
333
|
+
/**
|
|
334
|
+
* Makes Option iterable for use with generator-based syntax.
|
|
335
|
+
*
|
|
336
|
+
* Yields self and returns the unwrapped value when resumed.
|
|
337
|
+
* Used internally by {@link Option.gen} for `yield*` syntax.
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* ```ts
|
|
341
|
+
* const result = Option.gen(function* () {
|
|
342
|
+
* const value = yield* Option.Some(42);
|
|
343
|
+
* return value * 2;
|
|
344
|
+
* });
|
|
345
|
+
* // Some(84)
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* @internal
|
|
349
|
+
*/
|
|
350
|
+
[Symbol.iterator](): Generator<Option<T>, T, unknown>;
|
|
351
|
+
/**
|
|
352
|
+
* Makes Option iterable for use with async generator-based syntax.
|
|
353
|
+
*
|
|
354
|
+
* Yields self and returns the unwrapped value when resumed.
|
|
355
|
+
* Used internally by {@link Option.asyncGen} for `yield*` syntax.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```ts
|
|
359
|
+
* const result = await Option.asyncGen(async function* () {
|
|
360
|
+
* const value = yield* await Promise.resolve(Option.Some(42));
|
|
361
|
+
* return value * 2;
|
|
362
|
+
* });
|
|
363
|
+
* // Some(84)
|
|
364
|
+
* ```
|
|
365
|
+
*
|
|
366
|
+
* @internal
|
|
367
|
+
*/
|
|
368
|
+
[Symbol.asyncIterator](): AsyncGenerator<Option<T>, Awaited<T>, unknown>;
|
|
369
|
+
/**
|
|
370
|
+
* Generator-based syntax for chaining Option operations (simplified, no adapter).
|
|
371
|
+
*
|
|
372
|
+
* Provides imperative-style code while maintaining functional Option handling.
|
|
373
|
+
* Use `yield*` to unwrap Options or short-circuit on `None`.
|
|
374
|
+
*
|
|
375
|
+
* Short-circuits on first `None`, returning singleton `None`. Uses iteration
|
|
376
|
+
* instead of recursion to avoid stack overflow on deep chains.
|
|
377
|
+
*
|
|
378
|
+
* @template T - The return type of the generator
|
|
379
|
+
* @param genFn - A generator function that yields Options
|
|
380
|
+
* @returns `Some<T>` with the generator's return value, or `None`
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```ts
|
|
384
|
+
* // Simple sync chain
|
|
385
|
+
* const result = Option.gen(function* () {
|
|
386
|
+
* const a = yield* Option.Some(1);
|
|
387
|
+
* const b = yield* Option.Some(2);
|
|
388
|
+
* return a + b;
|
|
389
|
+
* });
|
|
390
|
+
* // Some(3)
|
|
391
|
+
*
|
|
392
|
+
* // None short-circuit
|
|
393
|
+
* const shortCircuit = Option.gen(function* () {
|
|
394
|
+
* const a = yield* Option.Some(1);
|
|
395
|
+
* const b = yield* Option.None; // Short-circuits here
|
|
396
|
+
* const c = yield* Option.Some(3); // Never executes
|
|
397
|
+
* return a + b + c;
|
|
398
|
+
* });
|
|
399
|
+
* // None
|
|
400
|
+
*
|
|
401
|
+
* // Chaining optional operations
|
|
402
|
+
* const email = Option.gen(function* () {
|
|
403
|
+
* const user = yield* findUser(userId);
|
|
404
|
+
* const profile = yield* Option.fromNullable(user.profile);
|
|
405
|
+
* const settings = yield* Option.fromNullable(profile.settings);
|
|
406
|
+
* return settings.email;
|
|
407
|
+
* });
|
|
408
|
+
*
|
|
409
|
+
* // Nested optional access
|
|
410
|
+
* const city = Option.gen(function* () {
|
|
411
|
+
* const user = yield* Option.fromNullable(getUser());
|
|
412
|
+
* const address = yield* Option.fromNullable(user?.address);
|
|
413
|
+
* const city = yield* Option.fromNullable(address?.city);
|
|
414
|
+
* return city;
|
|
415
|
+
* });
|
|
416
|
+
* ```
|
|
417
|
+
*
|
|
418
|
+
* @see {@link genAdapter} for better type inference in complex chains
|
|
419
|
+
* @see {@link asyncGen} for async operations
|
|
420
|
+
*/
|
|
421
|
+
static gen<T>(this: void, genFn: () => Generator<Option<unknown>, T, unknown>): Option<T>;
|
|
422
|
+
/**
|
|
423
|
+
* Generator-based syntax for chaining Option operations with an adapter function.
|
|
424
|
+
*
|
|
425
|
+
* Provides better type inference and IDE support compared to {@link gen}.
|
|
426
|
+
* The `$` adapter wraps Options and enables clearer type tracking.
|
|
427
|
+
*
|
|
428
|
+
* Short-circuits on first `None`, returning singleton `None`. Uses iteration
|
|
429
|
+
* instead of recursion to avoid stack overflow on deep chains.
|
|
430
|
+
*
|
|
431
|
+
* @template Eff - The effect type (inferred from usage)
|
|
432
|
+
* @template T - The return type of the generator
|
|
433
|
+
* @param genFn - A generator function receiving an adapter `$`
|
|
434
|
+
* @returns `Some<T>` with the generator's return value, or `None`
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* ```ts
|
|
438
|
+
* // Better type inference
|
|
439
|
+
* const result = Option.genAdapter(function* ($) {
|
|
440
|
+
* const a = yield* $(Option.Some(1));
|
|
441
|
+
* const b = yield* $(Option.Some(2));
|
|
442
|
+
* return a + b;
|
|
443
|
+
* });
|
|
444
|
+
* // Some(3)
|
|
445
|
+
*
|
|
446
|
+
* // Deep nested access with better type safety
|
|
447
|
+
* const email = Option.genAdapter(function* ($) {
|
|
448
|
+
* const user = yield* $(Option.fromNullable(apiResponse?.user));
|
|
449
|
+
* const profile = yield* $(Option.fromNullable(user?.profile));
|
|
450
|
+
* const contact = yield* $(Option.fromNullable(profile?.contact));
|
|
451
|
+
* return contact?.email;
|
|
452
|
+
* });
|
|
453
|
+
*
|
|
454
|
+
* // Complex validation chain
|
|
455
|
+
* const validConfig = Option.genAdapter(function* ($) {
|
|
456
|
+
* const raw = yield* $(loadConfig());
|
|
457
|
+
* const parsed = yield* $(parseConfig(raw));
|
|
458
|
+
* const validated = yield* $(validateConfig(parsed));
|
|
459
|
+
* return validated;
|
|
460
|
+
* });
|
|
461
|
+
* ```
|
|
462
|
+
*
|
|
463
|
+
* @see {@link gen} for simpler chains without adapter
|
|
464
|
+
* @see {@link asyncGenAdapter} for async operations
|
|
465
|
+
*/
|
|
466
|
+
static genAdapter<Eff extends OptionYieldWrap<any>, T>(this: void, genFn: (adapter: <A>(option: Option<A>) => OptionYieldWrap<A>) => Generator<Eff, T, any>): Option<T>;
|
|
467
|
+
/**
|
|
468
|
+
* Async generator-based syntax for chaining Option operations (simplified, no adapter).
|
|
469
|
+
*
|
|
470
|
+
* Use `yield*` with `Option<T>` values directly. For `Promise<Option<T>>`,
|
|
471
|
+
* await first then `yield*`.
|
|
472
|
+
*
|
|
473
|
+
* Short-circuits on first `None`, returning singleton `None`. Uses async iteration
|
|
474
|
+
* instead of recursion to avoid stack overflow on deep chains.
|
|
475
|
+
*
|
|
476
|
+
* @template T - The return type of the generator
|
|
477
|
+
* @param genFn - An async generator function that yields Options
|
|
478
|
+
* @returns `Promise<Some<T>>` with the generator's return value, or `Promise<None>`
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* ```ts
|
|
482
|
+
* // Simple async chain
|
|
483
|
+
* const result = await Option.asyncGen(async function* () {
|
|
484
|
+
* const a = yield* Option.Some(1);
|
|
485
|
+
* const b = yield* await asyncOperation(a); // await Promise<Option> first
|
|
486
|
+
* const c = yield* Option.Some(3);
|
|
487
|
+
* return a + b + c;
|
|
488
|
+
* });
|
|
489
|
+
* // Some(result)
|
|
490
|
+
*
|
|
491
|
+
* // None short-circuit in async
|
|
492
|
+
* const shortCircuit = await Option.asyncGen(async function* () {
|
|
493
|
+
* const data = yield* await fetchOptionalData();
|
|
494
|
+
* const parsed = yield* parse(data); // Short-circuits on None
|
|
495
|
+
* const validated = yield* validate(parsed); // Never executes
|
|
496
|
+
* return validated;
|
|
497
|
+
* });
|
|
498
|
+
* // None
|
|
499
|
+
*
|
|
500
|
+
* // Mixed sync/async workflow
|
|
501
|
+
* const result = await Option.asyncGen(async function* () {
|
|
502
|
+
* const id = yield* Option.Some(parseInt(input)); // sync
|
|
503
|
+
* const user = yield* await fetchUser(id); // async
|
|
504
|
+
* const profile = yield* Option.fromNullable(user?.profile); // sync
|
|
505
|
+
* const enriched = yield* await enrichProfile(profile); // async
|
|
506
|
+
* return enriched;
|
|
507
|
+
* });
|
|
508
|
+
*
|
|
509
|
+
* // Complex pipeline with multiple optional steps
|
|
510
|
+
* async function processLead(email: string): Promise<Option<Lead>> {
|
|
511
|
+
* return await Option.asyncGen(async function* () {
|
|
512
|
+
* const normalized = yield* Option.Some(normalizeEmail(email));
|
|
513
|
+
* const existing = yield* await findExistingLead(normalized);
|
|
514
|
+
* const enriched = yield* await enrichLeadData(existing);
|
|
515
|
+
* const validated = yield* validateLead(enriched);
|
|
516
|
+
* return validated;
|
|
517
|
+
* });
|
|
518
|
+
* }
|
|
519
|
+
* ```
|
|
520
|
+
*
|
|
521
|
+
* @see {@link asyncGenAdapter} for better type inference and cleaner syntax
|
|
522
|
+
* @see {@link gen} for synchronous operations
|
|
523
|
+
*/
|
|
524
|
+
static asyncGen<T>(this: void, genFn: () => AsyncGenerator<Option<unknown>, T, unknown>): Promise<Option<T>>;
|
|
525
|
+
/**
|
|
526
|
+
* Async generator-based syntax for chaining Option operations with an adapter function.
|
|
527
|
+
*
|
|
528
|
+
* The `$` adapter handles both sync `Option<T>` and async `Promise<Option<T>>`,
|
|
529
|
+
* automatically awaiting promises. This provides cleaner syntax for mixed sync/async workflows.
|
|
530
|
+
*
|
|
531
|
+
* Short-circuits on first `None`, returning singleton `None`. Uses async iteration
|
|
532
|
+
* instead of recursion to avoid stack overflow on deep chains.
|
|
533
|
+
*
|
|
534
|
+
* @template Eff - The effect type (inferred from usage)
|
|
535
|
+
* @template T - The return type of the generator
|
|
536
|
+
* @param genFn - An async generator function receiving an adapter `$`
|
|
537
|
+
* @returns `Promise<Some<T>>` with the generator's return value, or `Promise<None>`
|
|
538
|
+
*
|
|
539
|
+
* @example
|
|
540
|
+
* ```ts
|
|
541
|
+
* // No need to manually await - adapter handles it
|
|
542
|
+
* const result = await Option.asyncGenAdapter(async function* ($) {
|
|
543
|
+
* const a = yield* $(Option.Some(1)); // sync Option
|
|
544
|
+
* const b = yield* $(asyncOperation(a)); // Promise<Option> - auto-awaited
|
|
545
|
+
* const c = yield* $(Option.Some(3));
|
|
546
|
+
* return a + b + c;
|
|
547
|
+
* });
|
|
548
|
+
*
|
|
549
|
+
* // Complex workflow with database and API calls
|
|
550
|
+
* const userData = await Option.asyncGenAdapter(async function* ($) {
|
|
551
|
+
* const session = yield* $(getSession()); // Promise<Option<Session>>
|
|
552
|
+
* const userId = yield* $(Option.fromNullable(session?.userId));
|
|
553
|
+
* const profile = yield* $(await fetchProfile(userId)); // Promise<Option<Profile>>
|
|
554
|
+
* const preferences = yield* $(Option.fromNullable(profile?.preferences));
|
|
555
|
+
* const enriched = yield* $(await enrichPreferences(preferences));
|
|
556
|
+
* return enriched;
|
|
557
|
+
* });
|
|
558
|
+
*
|
|
559
|
+
* // Real-world: Optional data enrichment
|
|
560
|
+
* async function getProductDetails(productId: string): Promise<Option<ProductDetails>> {
|
|
561
|
+
* return await Option.asyncGenAdapter(async function* ($) {
|
|
562
|
+
* const product = yield* $(await fetchProduct(productId));
|
|
563
|
+
* const pricing = yield* $(await fetchPricing(product.sku));
|
|
564
|
+
* const inventory = yield* $(await checkInventory(product.id));
|
|
565
|
+
* const reviews = yield* $(await fetchReviews(product.id));
|
|
566
|
+
* const related = yield* $(await fetchRelatedProducts(product.category));
|
|
567
|
+
*
|
|
568
|
+
* return { product, pricing, inventory, reviews, related };
|
|
569
|
+
* });
|
|
570
|
+
* }
|
|
571
|
+
* ```
|
|
572
|
+
*
|
|
573
|
+
* @see {@link asyncGen} when you want explicit `await` for async operations
|
|
574
|
+
* @see {@link genAdapter} for synchronous operations
|
|
575
|
+
*/
|
|
576
|
+
static asyncGenAdapter<Eff extends AsyncOptionYieldWrap<any>, T>(this: void, genFn: (adapter: <A>(option: Option<A> | Promise<Option<A>>) => AsyncOptionYieldWrap<A>) => AsyncGenerator<Eff, T, any>): Promise<Option<T>>;
|
|
96
577
|
}
|
|
97
578
|
//#endregion
|
|
98
579
|
export { Option, UnitOption, UnwrapOption, UnwrappedNone };
|
package/dist/option.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option.d.cts","names":[],"sources":["../src/option.ts"],"
|
|
1
|
+
{"version":3,"file":"option.d.cts","names":[],"sources":["../src/option.ts"],"mappings":";;;;KAIK,MAAA,UAAgB,GAAA,EAAK,CAAA,KAAM,CAAA;AAAA,KAC3B,WAAA,UAAqB,GAAA,EAAK,CAAA,KAAM,OAAA,CAAQ,CAAA;AAAA,KACxC,UAAA,UAAoB,GAAA,EAAK,CAAA,KAAM,MAAA,CAAO,CAAA;AAAA,KACtC,eAAA,UAAyB,GAAA,EAAK,CAAA,KAAM,OAAA,CAAQ,MAAA,CAAO,CAAA;AAAA,KACnD,SAAA,OAAgB,GAAA,EAAK,CAAA;AAAA,KACrB,eAAA,OAAsB,GAAA,EAAK,OAAA,CAAQ,CAAA;AAAA,KACnC,cAAA,OAAqB,GAAA,EAAK,OAAA,CAAQ,CAAA,MAAO,OAAA;AAAA,KACzC,KAAA;AAAA,cAEQ,aAAA,SAAsB,KAAA;EAAA,SACxB,IAAA;EAET,WAAA,CAAA;AAAA;;KAUU,UAAA,GAAa,MAAA,CAAO,IAAA;;KAEpB,YAAA,MAAkB,CAAA,SAAU,MAAA,YAAkB,CAAA;AAAA,KAErD,eAAA,WAA0B,MAAA,6BACjB,CAAA,GAAI,YAAA,CAAa,CAAA,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