@nicolastoulemont/std 0.4.0 → 0.5.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 (122) hide show
  1. package/dist/adt/index.d.mts +1 -1
  2. package/dist/adt/index.mjs +1 -3
  3. package/dist/adt-DZmVJG4P.mjs +2 -0
  4. package/dist/adt-DZmVJG4P.mjs.map +1 -0
  5. package/dist/{apply-fn.types-0g_9eXRy.d.mts → apply-fn.types-CMgY6WQe.d.mts} +1 -1
  6. package/dist/{apply-fn.types-0g_9eXRy.d.mts.map → apply-fn.types-CMgY6WQe.d.mts.map} +1 -1
  7. package/dist/brand/index.d.mts +1 -1
  8. package/dist/brand/index.mjs +1 -3
  9. package/dist/brand-BUqMmkzC.mjs +2 -0
  10. package/dist/{brand-BqcqFXj5.mjs.map → brand-BUqMmkzC.mjs.map} +1 -1
  11. package/dist/data/index.d.mts +1 -1
  12. package/dist/data/index.mjs +1 -3
  13. package/dist/data-DzqKBCQg.mjs +2 -0
  14. package/dist/data-DzqKBCQg.mjs.map +1 -0
  15. package/dist/{discriminator.types-D-UbMmAD.d.mts → discriminator.types-DkThfvNE.d.mts} +1 -1
  16. package/dist/discriminator.types-DkThfvNE.d.mts.map +1 -0
  17. package/dist/either/index.d.mts +2 -2
  18. package/dist/either/index.mjs +1 -3
  19. package/dist/either-BDY9T5oz.mjs +2 -0
  20. package/dist/either-BDY9T5oz.mjs.map +1 -0
  21. package/dist/equality-D2EJvZm4.mjs +2 -0
  22. package/dist/{equality-C2l3BIi8.mjs.map → equality-D2EJvZm4.mjs.map} +1 -1
  23. package/dist/err/index.d.mts +1 -1
  24. package/dist/err/index.mjs +1 -3
  25. package/dist/err-CYs4b1RV.mjs +2 -0
  26. package/dist/{err-BM-svBaK.mjs.map → err-CYs4b1RV.mjs.map} +1 -1
  27. package/dist/flow/index.d.mts +1 -1
  28. package/dist/flow/index.mjs +1 -3
  29. package/dist/flow-CxKQ5yac.mjs +2 -0
  30. package/dist/{flow-D4cE0EAg.mjs.map → flow-CxKQ5yac.mjs.map} +1 -1
  31. package/dist/fx/index.d.mts +3 -3
  32. package/dist/fx/index.mjs +1 -4
  33. package/dist/fx-C4UuWCqP.mjs +2 -0
  34. package/dist/fx-C4UuWCqP.mjs.map +1 -0
  35. package/dist/fx.types-CXTwEa1G.mjs +2 -0
  36. package/dist/{fx.types-DpIQILok.mjs.map → fx.types-CXTwEa1G.mjs.map} +1 -1
  37. package/dist/{fx.types-aTmhyidu.d.mts → fx.types-DO-8yG4c.d.mts} +1 -1
  38. package/dist/{fx.types-aTmhyidu.d.mts.map → fx.types-DO-8yG4c.d.mts.map} +1 -1
  39. package/dist/{index-USQPafrR.d.mts → index-78LWwTds.d.mts} +1 -1
  40. package/dist/{index-USQPafrR.d.mts.map → index-78LWwTds.d.mts.map} +1 -1
  41. package/dist/{index-BO6bxBeo.d.mts → index-BQ5wVDSP.d.mts} +8 -24
  42. package/dist/index-BQ5wVDSP.d.mts.map +1 -0
  43. package/dist/{index-BOrJQBPO.d.mts → index-BahMvQpA.d.mts} +2 -2
  44. package/dist/{index-BOrJQBPO.d.mts.map → index-BahMvQpA.d.mts.map} +1 -1
  45. package/dist/{index-ClxPiGP9.d.mts → index-Bs5TTFlK.d.mts} +40 -44
  46. package/dist/index-Bs5TTFlK.d.mts.map +1 -0
  47. package/dist/{index-D5tzehjf.d.mts → index-BuLJRX1e.d.mts} +11 -11
  48. package/dist/{index-D5tzehjf.d.mts.map → index-BuLJRX1e.d.mts.map} +1 -1
  49. package/dist/{index-CQxzD1YM.d.mts → index-CDio8mJY.d.mts} +4 -4
  50. package/dist/{index-CQxzD1YM.d.mts.map → index-CDio8mJY.d.mts.map} +1 -1
  51. package/dist/{index-FySViSfh.d.mts → index-DLlx9jiG.d.mts} +5 -105
  52. package/dist/index-DLlx9jiG.d.mts.map +1 -0
  53. package/dist/{index-CLspOlBH.d.mts → index-DQoTXLSm.d.mts} +192 -83
  54. package/dist/index-DQoTXLSm.d.mts.map +1 -0
  55. package/dist/{index-Cydt5ocm.d.mts → index-DjjJIDaA.d.mts} +2 -2
  56. package/dist/{index-Cydt5ocm.d.mts.map → index-DjjJIDaA.d.mts.map} +1 -1
  57. package/dist/{index-EmWRCTY3.d.mts → index-DtAPrec7.d.mts} +2 -2
  58. package/dist/{index-EmWRCTY3.d.mts.map → index-DtAPrec7.d.mts.map} +1 -1
  59. package/dist/{index-CLlcoy8B.d.mts → index-IdejL485.d.mts} +2 -2
  60. package/dist/{index-CLlcoy8B.d.mts.map → index-IdejL485.d.mts.map} +1 -1
  61. package/dist/index.d.mts +16 -40
  62. package/dist/index.mjs +1 -15
  63. package/dist/option/index.d.mts +3 -3
  64. package/dist/option/index.mjs +1 -4
  65. package/dist/option-Qiv7Ls7L.mjs +2 -0
  66. package/dist/option-Qiv7Ls7L.mjs.map +1 -0
  67. package/dist/option.types-By5UOfC2.mjs +2 -0
  68. package/dist/option.types-By5UOfC2.mjs.map +1 -0
  69. package/dist/{option.types-CVvowfmd.d.mts → option.types-Cluybn30.d.mts} +22 -20
  70. package/dist/option.types-Cluybn30.d.mts.map +1 -0
  71. package/dist/pipe/index.d.mts +1 -1
  72. package/dist/pipe/index.mjs +1 -3
  73. package/dist/pipe-BROILDeC.mjs +2 -0
  74. package/dist/{pipe-BF4G4SLo.mjs.map → pipe-BROILDeC.mjs.map} +1 -1
  75. package/dist/{pipeable-Dr0d_q4F.d.mts → pipeable-KHu4D8ol.d.mts} +1 -1
  76. package/dist/{pipeable-Dr0d_q4F.d.mts.map → pipeable-KHu4D8ol.d.mts.map} +1 -1
  77. package/dist/pipeable-rQvolRqh.mjs +2 -0
  78. package/dist/{pipeable-DYNrUps7.mjs.map → pipeable-rQvolRqh.mjs.map} +1 -1
  79. package/dist/predicate/index.d.mts +1 -1
  80. package/dist/predicate/index.mjs +1 -3
  81. package/dist/predicate-DvXnfmeJ.mjs +2 -0
  82. package/dist/{predicate-Dt9Qsbav.mjs.map → predicate-DvXnfmeJ.mjs.map} +1 -1
  83. package/dist/result/index.d.mts +2 -2
  84. package/dist/result/index.mjs +1 -3
  85. package/dist/result-B68pxC7l.mjs +2 -0
  86. package/dist/result-B68pxC7l.mjs.map +1 -0
  87. package/dist/result-uRORQlAQ.mjs +1 -0
  88. package/dist/{result.types-_W95221K.d.mts → result.types-fIbuBwVQ.d.mts} +129 -20
  89. package/dist/result.types-fIbuBwVQ.d.mts.map +1 -0
  90. package/package.json +1 -1
  91. package/dist/adt-DH37Pprw.mjs +0 -318
  92. package/dist/adt-DH37Pprw.mjs.map +0 -1
  93. package/dist/brand-BqcqFXj5.mjs +0 -165
  94. package/dist/chunk-DRYujVrt.mjs +0 -18
  95. package/dist/data-Cg8ySt6-.mjs +0 -244
  96. package/dist/data-Cg8ySt6-.mjs.map +0 -1
  97. package/dist/discriminator.types-D-UbMmAD.d.mts.map +0 -1
  98. package/dist/either-jkBX8xS1.mjs +0 -735
  99. package/dist/either-jkBX8xS1.mjs.map +0 -1
  100. package/dist/equality-C2l3BIi8.mjs +0 -201
  101. package/dist/err-BM-svBaK.mjs +0 -176
  102. package/dist/flow-D4cE0EAg.mjs +0 -28
  103. package/dist/fx-B-0MxGTM.mjs +0 -1306
  104. package/dist/fx-B-0MxGTM.mjs.map +0 -1
  105. package/dist/fx.types-DpIQILok.mjs +0 -13
  106. package/dist/index-BO6bxBeo.d.mts.map +0 -1
  107. package/dist/index-CLspOlBH.d.mts.map +0 -1
  108. package/dist/index-ClxPiGP9.d.mts.map +0 -1
  109. package/dist/index-FySViSfh.d.mts.map +0 -1
  110. package/dist/index.d.mts.map +0 -1
  111. package/dist/option-C2QpGffy.mjs +0 -530
  112. package/dist/option-C2QpGffy.mjs.map +0 -1
  113. package/dist/option.types-BiAiZ8Ks.mjs +0 -33
  114. package/dist/option.types-BiAiZ8Ks.mjs.map +0 -1
  115. package/dist/option.types-CVvowfmd.d.mts.map +0 -1
  116. package/dist/pipe-BF4G4SLo.mjs +0 -10
  117. package/dist/pipeable-DYNrUps7.mjs +0 -92
  118. package/dist/predicate-Dt9Qsbav.mjs +0 -293
  119. package/dist/result-BmqdTN5o.mjs +0 -1
  120. package/dist/result-DhYA-J-M.mjs +0 -542
  121. package/dist/result-DhYA-J-M.mjs.map +0 -1
  122. package/dist/result.types-_W95221K.d.mts.map +0 -1
@@ -1,530 +0,0 @@
1
- import { t as __exportAll } from "./chunk-DRYujVrt.mjs";
2
- import { t as FxTypeId } from "./fx.types-DpIQILok.mjs";
3
- import { n as dual, t as pipeMethod } from "./pipeable-DYNrUps7.mjs";
4
- import { n as isPromise } from "./flow-D4cE0EAg.mjs";
5
- import { t as NoSuchElementError } from "./option.types-BiAiZ8Ks.mjs";
6
-
7
- //#region src/option/option.ts
8
- var option_exports = /* @__PURE__ */ __exportAll({
9
- Option: () => Option,
10
- all: () => all,
11
- filter: () => filter,
12
- flatMap: () => flatMap,
13
- fromNullable: () => fromNullable,
14
- fromTry: () => fromTry,
15
- isNone: () => isNone,
16
- isSome: () => isSome,
17
- map: () => map,
18
- match: () => match,
19
- none: () => none,
20
- orElse: () => orElse,
21
- some: () => some,
22
- tap: () => tap,
23
- unwrapOr: () => unwrapOr,
24
- unwrapOrElse: () => unwrapOrElse
25
- });
26
- /**
27
- * Create an Option with a value.
28
- *
29
- * @param value - The value to wrap
30
- * @returns An Option with some: true
31
- *
32
- * @example
33
- * ```ts
34
- * some(42) // { some: true, value: 42 }
35
- * ```
36
- */
37
- const some = (value) => ({
38
- some: true,
39
- value,
40
- [FxTypeId]: {
41
- _A: () => value,
42
- _E: () => void 0,
43
- _R: () => void 0
44
- },
45
- pipe: pipeMethod,
46
- *[Symbol.iterator]() {
47
- return value;
48
- }
49
- });
50
- /**
51
- * Create an Option with no value.
52
- *
53
- * @returns An Option with some: false
54
- *
55
- * @example
56
- * ```ts
57
- * none() // { some: false }
58
- * ```
59
- */
60
- const none = () => ({
61
- some: false,
62
- [FxTypeId]: {
63
- _A: () => void 0,
64
- _E: () => void 0,
65
- _R: () => void 0
66
- },
67
- pipe: pipeMethod,
68
- *[Symbol.iterator]() {
69
- yield new NoSuchElementError();
70
- throw new Error("Unreachable: Fx.gen should short-circuit on NoSuchElementError");
71
- }
72
- });
73
- /**
74
- * Check if an Option has a value.
75
- *
76
- * @param option - The Option to check
77
- * @returns true if the Option is some
78
- *
79
- * @example
80
- * ```ts
81
- * const option = some(42)
82
- * if (isSome(option)) {
83
- * console.log(option.value) // TypeScript knows value exists
84
- * }
85
- * ```
86
- */
87
- const isSome = (option) => option.some;
88
- /**
89
- * Check if an Option has no value.
90
- *
91
- * @param option - The Option to check
92
- * @returns true if the Option is none
93
- *
94
- * @example
95
- * ```ts
96
- * const option = none()
97
- * if (isNone(option)) {
98
- * console.log('No value') // TypeScript knows value doesn't exist
99
- * }
100
- * ```
101
- */
102
- const isNone = (option) => !option.some;
103
- /**
104
- * Transform the value of an Option.
105
- * If the Option is none, it passes through unchanged.
106
- *
107
- * Supports both data-first and data-last calling styles:
108
- * - Data-first: `map(option, fn)`
109
- * - Data-last: `pipe(option, map(fn))`
110
- *
111
- * Supports both sync and async functions:
112
- * - Sync fn: returns Option<U>
113
- * - Async fn: returns Promise<Option<U>>
114
- *
115
- * @param fn - Function to transform the value
116
- * @returns A function that takes an Option and returns a new Option
117
- *
118
- * @example
119
- * ```ts
120
- * // Data-first (direct call)
121
- * map(some(5), n => n * 2) // { some: true, value: 10 }
122
- *
123
- * // Data-last (curried for pipe)
124
- * pipe(
125
- * some(5),
126
- * map(n => n * 2)
127
- * ) // { some: true, value: 10 }
128
- *
129
- * // Async usage
130
- * await pipe(
131
- * some(userId),
132
- * map(async id => await fetchName(id))
133
- * ) // Promise<Option<string>>
134
- * ```
135
- */
136
- const map = dual(2, (option, fn) => {
137
- if (!option.some) return option;
138
- const mapped = fn(option.value);
139
- if (mapped instanceof Promise) return mapped.then(some);
140
- return some(mapped);
141
- });
142
- /**
143
- * Chain operations that return Options.
144
- * If the Option is none, it passes through unchanged.
145
- *
146
- * Supports both data-first and data-last calling styles:
147
- * - Data-first: `flatMap(option, fn)`
148
- * - Data-last: `pipe(option, flatMap(fn))`
149
- *
150
- * Supports both sync and async functions:
151
- * - Sync fn: returns Option<U>
152
- * - Async fn: returns Promise<Option<U>>
153
- *
154
- * @param fn - Function that takes a value and returns an Option (or Promise<Option>)
155
- * @returns A function that takes an Option and returns a new Option
156
- *
157
- * @example
158
- * ```ts
159
- * const findUser = (id: number) =>
160
- * id > 0 ? some({ id, name: 'Alice' }) : none()
161
- *
162
- * // Data-first (direct call)
163
- * flatMap(some(10), id => findUser(id))
164
- * // { some: true, value: { id: 10, name: 'Alice' } }
165
- *
166
- * // Data-last (curried for pipe)
167
- * pipe(
168
- * some(10),
169
- * flatMap(id => findUser(id))
170
- * ) // { some: true, value: { id: 10, name: 'Alice' } }
171
- *
172
- * // Async usage
173
- * await pipe(
174
- * some(userId),
175
- * flatMap(async id => some(await fetchUser(id)))
176
- * ) // Promise<Option<User>>
177
- * ```
178
- */
179
- const flatMap = dual(2, (option, fn) => option.some ? fn(option.value) : option);
180
- /**
181
- * Perform a side effect on the value without modifying the Option.
182
- * Useful for debugging, logging, or other side effects in a pipeline.
183
- * If the Option is none, the function is not called.
184
- *
185
- * Supports both data-first and data-last calling styles:
186
- * - Data-first: `tap(option, fn)`
187
- * - Data-last: `pipe(option, tap(fn))`
188
- *
189
- * Supports both sync and async functions:
190
- * - Sync fn: returns Option<T>
191
- * - Async fn: returns Promise<Option<T>>
192
- *
193
- * @param fn - Function to call with the value (return value is ignored)
194
- * @returns A function that takes an Option and returns the same Option
195
- *
196
- * @example
197
- * ```ts
198
- * // Data-first (direct call)
199
- * tap(some(42), console.log) // logs 42, returns { some: true, value: 42 }
200
- *
201
- * // Data-last (curried for pipe)
202
- * pipe(
203
- * some(42),
204
- * tap(console.log), // logs 42
205
- * map(n => n * 2)
206
- * ) // { some: true, value: 84 }
207
- *
208
- * // Async usage
209
- * await pipe(
210
- * some(42),
211
- * tap(async v => await logToServer(v)),
212
- * map(n => n * 2)
213
- * ) // Promise<Option<84>>
214
- * ```
215
- */
216
- const tap = dual(2, (option, fn) => {
217
- if (!option.some) return option;
218
- const sideEffect = fn(option.value);
219
- if (sideEffect instanceof Promise) return sideEffect.then(() => option);
220
- return option;
221
- });
222
- /**
223
- * Recover from none by providing an alternative Option.
224
- * If the Option is some, it passes through unchanged.
225
- *
226
- * Supports both data-first and data-last calling styles:
227
- * - Data-first: `orElse(option, fn)`
228
- * - Data-last: `pipe(option, orElse(fn))`
229
- *
230
- * Supports both sync and async functions:
231
- * - Sync fn: returns Option<T | U>
232
- * - Async fn: returns Promise<Option<T | U>>
233
- *
234
- * @param fn - Function that returns an alternative Option
235
- * @returns A function that takes an Option and returns a new Option
236
- *
237
- * @example
238
- * ```ts
239
- * // Data-first (direct call)
240
- * orElse(none(), () => some(defaultValue))
241
- * // { some: true, value: defaultValue }
242
- *
243
- * // Data-last (curried for pipe)
244
- * pipe(
245
- * none(),
246
- * orElse(() => some(defaultValue))
247
- * ) // { some: true, value: defaultValue }
248
- *
249
- * // Async recovery
250
- * await pipe(
251
- * none(),
252
- * orElse(async () => some(await fetchFromAPI()))
253
- * ) // Promise<Option<T>>
254
- *
255
- * // Chain multiple fallbacks
256
- * pipe(
257
- * none(),
258
- * orElse(() => tryCache()),
259
- * orElse(() => tryAPI()),
260
- * orElse(() => some(fallback))
261
- * )
262
- * ```
263
- */
264
- const orElse = dual(2, (option, fn) => option.some ? option : fn());
265
- /**
266
- * Filter an Option based on a predicate.
267
- * If the predicate returns false, converts to none.
268
- * If the Option is already none, it passes through unchanged.
269
- *
270
- * Supports both data-first and data-last calling styles:
271
- * - Data-first: `filter(option, predicate)`
272
- * - Data-last: `pipe(option, filter(predicate))`
273
- *
274
- * @param predicate - Function that returns true to keep the value
275
- * @returns A function that takes an Option and returns a new Option
276
- *
277
- * @example
278
- * ```ts
279
- * // Data-first (direct call)
280
- * filter(some(5), n => n > 10) // { some: false }
281
- *
282
- * // Data-last (curried for pipe)
283
- * pipe(
284
- * some(5),
285
- * filter(n => n > 10)
286
- * ) // { some: false }
287
- *
288
- * pipe(
289
- * some(15),
290
- * filter(n => n > 10)
291
- * ) // { some: true, value: 15 }
292
- *
293
- * // With complex validation
294
- * pipe(
295
- * some(user),
296
- * filter(u => u.age >= 18)
297
- * )
298
- * ```
299
- */
300
- const filter = dual(2, (option, predicate) => {
301
- if (!option.some) return option;
302
- return predicate(option.value) ? option : none();
303
- });
304
- /**
305
- * Combine multiple Options into a single Option.
306
- * Supports both array and object inputs.
307
- *
308
- * - If all Options are some, returns some with all values
309
- * - If any Option is none, returns none (short-circuits)
310
- *
311
- * For arrays of 1-6 elements, tuple types are inferred automatically.
312
- * For longer arrays, use `as const` to preserve tuple structure.
313
- *
314
- * @example
315
- * ```ts
316
- * // Array form - tuple types inferred automatically for up to 6 elements
317
- * const [num, str] = pipe(
318
- * Option.all([parseNumber(input), parseString(other)]),
319
- * Option.unwrapOr([0, ''])
320
- * )
321
- *
322
- * // Object form - returns Option<{ user: User, config: Config }>
323
- * pipe(
324
- * Option.all({ user: findUser(id), config: loadConfig() }),
325
- * Option.tap(({ user, config }) => console.log(user.name, config.theme))
326
- * )
327
- * ```
328
- */
329
- const all = (options) => {
330
- if (Array.isArray(options)) {
331
- const values$1 = [];
332
- for (const option of options) {
333
- if (!option.some) return option;
334
- values$1.push(option.value);
335
- }
336
- return some(values$1);
337
- }
338
- const values = {};
339
- for (const [key, option] of Object.entries(options)) {
340
- const o = option;
341
- if (!o.some) return option;
342
- values[key] = o.value;
343
- }
344
- return some(values);
345
- };
346
- /**
347
- * Get the value or a default value.
348
- *
349
- * Supports both data-first and data-last calling styles:
350
- * - Data-first: `unwrapOr(option, defaultValue)`
351
- * - Data-last: `pipe(option, unwrapOr(defaultValue))`
352
- *
353
- * Uses NoInfer to prevent type inference from the default value.
354
- *
355
- * @param defaultValue - Value to return if the Option is none
356
- * @returns A function that takes an Option and returns the value or default
357
- *
358
- * @example
359
- * ```ts
360
- * // Data-first (direct call)
361
- * unwrapOr(some(42), 0) // 42
362
- * unwrapOr(none(), 0) // 0
363
- *
364
- * // Data-last (curried for pipe)
365
- * pipe(some(42), unwrapOr(0)) // 42
366
- * pipe(none(), unwrapOr(0)) // 0
367
- * ```
368
- */
369
- const unwrapOr = dual(2, (option, defaultValue) => option.some ? option.value : defaultValue);
370
- /**
371
- * Get the value or compute a value.
372
- *
373
- * Supports both data-first and data-last calling styles:
374
- * - Data-first: `unwrapOrElse(option, fn)`
375
- * - Data-last: `pipe(option, unwrapOrElse(fn))`
376
- *
377
- * @param fn - Function to compute a value
378
- * @returns A function that takes an Option and returns the value or computed value
379
- *
380
- * @example
381
- * ```ts
382
- * // Data-first (direct call)
383
- * unwrapOrElse(none(), () => generateDefault()) // generateDefault()
384
- *
385
- * // Data-last (curried for pipe)
386
- * pipe(
387
- * none(),
388
- * unwrapOrElse(() => generateDefault())
389
- * ) // generateDefault()
390
- * ```
391
- */
392
- const unwrapOrElse = dual(2, (option, fn) => option.some ? option.value : fn());
393
- /**
394
- * Pattern match on an Option, handling both some and none cases.
395
- *
396
- * Supports both data-first and data-last calling styles:
397
- * - Data-first: `match(option, { some: ..., none: ... })`
398
- * - Data-last: `pipe(option, match({ some: ..., none: ... }))`
399
- *
400
- * @param handlers - Object with some and none handlers
401
- * @returns A function that takes an Option and returns the handler result
402
- *
403
- * @example
404
- * ```ts
405
- * // Data-first (direct call)
406
- * match(some(42), {
407
- * some: n => `Got ${n}`,
408
- * none: () => 'No value'
409
- * }) // 'Got 42'
410
- *
411
- * // Data-last (curried for pipe)
412
- * pipe(
413
- * some(42),
414
- * match({
415
- * some: n => `Got ${n}`,
416
- * none: () => 'No value'
417
- * })
418
- * ) // 'Got 42'
419
- * ```
420
- */
421
- const match = dual(2, (option, handlers) => option.some ? handlers.some(option.value) : handlers.none());
422
- /**
423
- * Convert a nullable value to an Option.
424
- * null and undefined become none, other values become some.
425
- *
426
- * @param value - The value to convert
427
- * @returns An Option
428
- *
429
- * @example
430
- * ```ts
431
- * fromNullable(42) // { some: true, value: 42 }
432
- * fromNullable(null) // { some: false }
433
- * fromNullable(undefined) // { some: false }
434
- * ```
435
- */
436
- const fromNullable = (value) => value === null || value === void 0 ? none() : some(value);
437
- /**
438
- * Wrap a function that might throw into an Option.
439
- * Supports both sync and async functions with automatic type inference.
440
- *
441
- * - Sync fn: returns Option<T>
442
- * - Async fn: returns Promise<Option<T>>
443
- *
444
- * **Note on `any` return types:** If your function returns `any` (e.g., `JSON.parse`),
445
- * you should add an explicit return type annotation. This is because TypeScript's
446
- * conditional types cannot determine if `any` is a Promise or not, resulting in a
447
- * union type `Promise<Option<unknown>> | Option<any>` that won't work
448
- * with Option utilities like `isSome` or `isNone`.
449
- *
450
- * @param fn - Function that might throw (sync or async)
451
- * @returns An Option with the return value or none
452
- *
453
- * @example
454
- * ```ts
455
- * // Sync usage
456
- * fromTry(() => JSON.parse('{"valid": true}'))
457
- * // { some: true, value: { valid: true } }
458
- *
459
- * fromTry(() => JSON.parse('not json'))
460
- * // { some: false }
461
- *
462
- * // When fn returns `any`, add explicit return type:
463
- * fromTry((): unknown => JSON.parse(input))
464
- * fromTry((): MyType => JSON.parse(input))
465
- *
466
- * // Async usage
467
- * await fromTry(async () => await fetch('/api/user'))
468
- * // Promise<Option<Response>>
469
- *
470
- * await fromTry(async () => {
471
- * throw new Error('network error')
472
- * })
473
- * // Promise<{ some: false }>
474
- * ```
475
- */
476
- const fromTry = (fn) => {
477
- try {
478
- const result = fn();
479
- if (isPromise(result)) return result.then(some).catch(() => none());
480
- return some(result);
481
- } catch {
482
- return none();
483
- }
484
- };
485
- /**
486
- * Option namespace containing all utility functions for working with Option types.
487
- *
488
- * Option represents either the presence (some) or absence (none) of a value.
489
- * Use this for optional values without needing to track why the value is missing.
490
- *
491
- * @see {@link Result} for success/failure with error information
492
- * @see {@link Either} for two valid outcomes
493
- *
494
- * @example
495
- * ```ts
496
- * import { Option, pipe } from '@repo/std'
497
- * import type { Option as OptionType } from '@repo/std'
498
- *
499
- * const findUser = (id: number): OptionType<User> =>
500
- * id > 0 ? Option.some({ id, name: 'Alice' }) : Option.none()
501
- *
502
- * const result = pipe(
503
- * Option.some(10),
504
- * Option.flatMap(findUser),
505
- * Option.map(user => user.name),
506
- * Option.unwrapOr('Unknown')
507
- * )
508
- * ```
509
- */
510
- const Option = {
511
- some,
512
- none,
513
- isSome,
514
- isNone,
515
- map,
516
- flatMap,
517
- tap,
518
- orElse,
519
- filter,
520
- all,
521
- unwrapOr,
522
- unwrapOrElse,
523
- match,
524
- fromNullable,
525
- fromTry
526
- };
527
-
528
- //#endregion
529
- export { option_exports as n, some as r, none as t };
530
- //# sourceMappingURL=option-C2QpGffy.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"option-C2QpGffy.mjs","names":["values"],"sources":["../src/option/option.ts"],"sourcesContent":["import { FxTypeId } from \"../fx/fx.types\"\nimport { dual } from \"../shared/dual\"\nimport { isPromise } from \"../shared/is-promise\"\nimport { pipeMethod } from \"../shared/pipeable\"\nimport { NoSuchElementError } from \"./option.types\"\nimport type {\n Option as OptionType,\n OptionAll,\n OptionFlatMap,\n OptionMap,\n OptionMatch,\n OptionTap,\n OptionOrElse,\n OptionFilter,\n OptionUnwrapOr,\n OptionUnwrapOrElse,\n FromTryReturn,\n} from \"./option.types\"\n\n// ============================================================================\n// Constructors\n// ============================================================================\n\n/**\n * Create an Option with a value.\n *\n * @param value - The value to wrap\n * @returns An Option with some: true\n *\n * @example\n * ```ts\n * some(42) // { some: true, value: 42 }\n * ```\n */\nexport const some = <T>(value: T): OptionType<T> => ({\n some: true,\n value,\n [FxTypeId]: {\n _A: () => value,\n _E: () => undefined as never,\n _R: () => undefined as never,\n },\n pipe: pipeMethod,\n // oxlint-disable-next-line require-yield\n *[Symbol.iterator](): Generator<NoSuchElementError, T, unknown> {\n return value\n },\n})\n\n/**\n * Create an Option with no value.\n *\n * @returns An Option with some: false\n *\n * @example\n * ```ts\n * none() // { some: false }\n * ```\n */\nexport const none = <T = never>(): OptionType<T> => ({\n some: false,\n [FxTypeId]: {\n _A: () => undefined as never,\n _E: () => undefined as unknown as NoSuchElementError,\n _R: () => undefined as never,\n },\n pipe: pipeMethod,\n *[Symbol.iterator](): Generator<NoSuchElementError, never, unknown> {\n yield new NoSuchElementError()\n throw new Error(\"Unreachable: Fx.gen should short-circuit on NoSuchElementError\")\n },\n})\n\n// ============================================================================\n// Type Guards\n// ============================================================================\n\n/**\n * Check if an Option has a value.\n *\n * @param option - The Option to check\n * @returns true if the Option is some\n *\n * @example\n * ```ts\n * const option = some(42)\n * if (isSome(option)) {\n * console.log(option.value) // TypeScript knows value exists\n * }\n * ```\n */\nexport const isSome = <T>(option: OptionType<T>): option is Extract<OptionType<T>, { some: true }> => option.some\n\n/**\n * Check if an Option has no value.\n *\n * @param option - The Option to check\n * @returns true if the Option is none\n *\n * @example\n * ```ts\n * const option = none()\n * if (isNone(option)) {\n * console.log('No value') // TypeScript knows value doesn't exist\n * }\n * ```\n */\nexport const isNone = <T>(option: OptionType<T>): option is Extract<OptionType<T>, { some: false }> => !option.some\n\n// ============================================================================\n// Transformations (curried for pipe)\n// ============================================================================\n\n/**\n * Transform the value of an Option.\n * If the Option is none, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `map(option, fn)`\n * - Data-last: `pipe(option, map(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Option<U>\n * - Async fn: returns Promise<Option<U>>\n *\n * @param fn - Function to transform the value\n * @returns A function that takes an Option and returns a new Option\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * map(some(5), n => n * 2) // { some: true, value: 10 }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * some(5),\n * map(n => n * 2)\n * ) // { some: true, value: 10 }\n *\n * // Async usage\n * await pipe(\n * some(userId),\n * map(async id => await fetchName(id))\n * ) // Promise<Option<string>>\n * ```\n */\n/* oxlint-disable no-explicit-any, no-unsafe-return, no-unsafe-type-assertion -- Required for overloaded return types in curried functions */\nexport const map: OptionMap = dual(2, (option: OptionType<unknown>, fn: (value: unknown) => unknown) => {\n if (!option.some) return option as any\n const mapped = fn(option.value)\n if (mapped instanceof Promise) {\n return mapped.then(some) as any\n }\n return some(mapped) as any\n})\n/* oxlint-enable no-explicit-any, no-unsafe-return, no-unsafe-type-assertion */\n\n/**\n * Chain operations that return Options.\n * If the Option is none, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `flatMap(option, fn)`\n * - Data-last: `pipe(option, flatMap(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Option<U>\n * - Async fn: returns Promise<Option<U>>\n *\n * @param fn - Function that takes a value and returns an Option (or Promise<Option>)\n * @returns A function that takes an Option and returns a new Option\n *\n * @example\n * ```ts\n * const findUser = (id: number) =>\n * id > 0 ? some({ id, name: 'Alice' }) : none()\n *\n * // Data-first (direct call)\n * flatMap(some(10), id => findUser(id))\n * // { some: true, value: { id: 10, name: 'Alice' } }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * some(10),\n * flatMap(id => findUser(id))\n * ) // { some: true, value: { id: 10, name: 'Alice' } }\n *\n * // Async usage\n * await pipe(\n * some(userId),\n * flatMap(async id => some(await fetchUser(id)))\n * ) // Promise<Option<User>>\n * ```\n */\n// oxlint-disable-next-line no-explicit-any, no-unsafe-return, no-unsafe-type-assertion -- Required for overloaded return types\nexport const flatMap: OptionFlatMap = dual(2, (option: OptionType<unknown>, fn: (value: unknown) => unknown) =>\n option.some ? fn(option.value) : option,\n)\n\n/**\n * Perform a side effect on the value without modifying the Option.\n * Useful for debugging, logging, or other side effects in a pipeline.\n * If the Option is none, the function is not called.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `tap(option, fn)`\n * - Data-last: `pipe(option, tap(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Option<T>\n * - Async fn: returns Promise<Option<T>>\n *\n * @param fn - Function to call with the value (return value is ignored)\n * @returns A function that takes an Option and returns the same Option\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * tap(some(42), console.log) // logs 42, returns { some: true, value: 42 }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * some(42),\n * tap(console.log), // logs 42\n * map(n => n * 2)\n * ) // { some: true, value: 84 }\n *\n * // Async usage\n * await pipe(\n * some(42),\n * tap(async v => await logToServer(v)),\n * map(n => n * 2)\n * ) // Promise<Option<84>>\n * ```\n */\n/* oxlint-disable no-explicit-any, no-unsafe-return, no-unsafe-type-assertion -- Required for overloaded return types in curried functions */\nexport const tap: OptionTap = dual(2, (option: OptionType<unknown>, fn: (value: unknown) => unknown) => {\n if (!option.some) return option as any\n const sideEffect = fn(option.value)\n if (sideEffect instanceof Promise) {\n return sideEffect.then(() => option) as any\n }\n return option as any\n})\n/* oxlint-enable no-explicit-any, no-unsafe-return, no-unsafe-type-assertion */\n\n/**\n * Recover from none by providing an alternative Option.\n * If the Option is some, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `orElse(option, fn)`\n * - Data-last: `pipe(option, orElse(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Option<T | U>\n * - Async fn: returns Promise<Option<T | U>>\n *\n * @param fn - Function that returns an alternative Option\n * @returns A function that takes an Option and returns a new Option\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * orElse(none(), () => some(defaultValue))\n * // { some: true, value: defaultValue }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * none(),\n * orElse(() => some(defaultValue))\n * ) // { some: true, value: defaultValue }\n *\n * // Async recovery\n * await pipe(\n * none(),\n * orElse(async () => some(await fetchFromAPI()))\n * ) // Promise<Option<T>>\n *\n * // Chain multiple fallbacks\n * pipe(\n * none(),\n * orElse(() => tryCache()),\n * orElse(() => tryAPI()),\n * orElse(() => some(fallback))\n * )\n * ```\n */\n// oxlint-disable-next-line no-explicit-any, no-unsafe-return, no-unsafe-type-assertion -- Required for overloaded return types\nexport const orElse: OptionOrElse = dual(2, (option: OptionType<unknown>, fn: () => unknown) =>\n option.some ? option : fn(),\n)\n\n/**\n * Filter an Option based on a predicate.\n * If the predicate returns false, converts to none.\n * If the Option is already none, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `filter(option, predicate)`\n * - Data-last: `pipe(option, filter(predicate))`\n *\n * @param predicate - Function that returns true to keep the value\n * @returns A function that takes an Option and returns a new Option\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * filter(some(5), n => n > 10) // { some: false }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * some(5),\n * filter(n => n > 10)\n * ) // { some: false }\n *\n * pipe(\n * some(15),\n * filter(n => n > 10)\n * ) // { some: true, value: 15 }\n *\n * // With complex validation\n * pipe(\n * some(user),\n * filter(u => u.age >= 18)\n * )\n * ```\n */\nexport const filter: OptionFilter = dual(2, (option: OptionType<unknown>, predicate: (value: unknown) => boolean) => {\n if (!option.some) return option\n return predicate(option.value) ? option : none()\n})\n\n// ============================================================================\n// Combinators\n// ============================================================================\n\n/**\n * Combine multiple Options into a single Option.\n * Supports both array and object inputs.\n *\n * - If all Options are some, returns some with all values\n * - If any Option is none, returns none (short-circuits)\n *\n * For arrays of 1-6 elements, tuple types are inferred automatically.\n * For longer arrays, use `as const` to preserve tuple structure.\n *\n * @example\n * ```ts\n * // Array form - tuple types inferred automatically for up to 6 elements\n * const [num, str] = pipe(\n * Option.all([parseNumber(input), parseString(other)]),\n * Option.unwrapOr([0, ''])\n * )\n *\n * // Object form - returns Option<{ user: User, config: Config }>\n * pipe(\n * Option.all({ user: findUser(id), config: loadConfig() }),\n * Option.tap(({ user, config }) => console.log(user.name, config.theme))\n * )\n * ```\n */\n/* oxlint-disable no-explicit-any, no-unsafe-return, no-unsafe-member-access, strict-boolean-expressions, no-unsafe-type-assertion, no-unsafe-argument -- Required for handling union types in overloaded function */\nexport const all: OptionAll = (options: any): any => {\n if (Array.isArray(options)) {\n const values: unknown[] = []\n for (const option of options) {\n if (!option.some) return option\n values.push(option.value)\n }\n return some(values)\n }\n\n const values: Record<string, unknown> = {}\n for (const [key, option] of Object.entries(options)) {\n const o = option as OptionType<unknown>\n if (!o.some) return option\n values[key] = o.value\n }\n return some(values)\n}\n/* oxlint-enable no-explicit-any, no-unsafe-return, no-unsafe-member-access, strict-boolean-expressions, no-unsafe-type-assertion */\n\n// ============================================================================\n// Extraction\n// ============================================================================\n\n/**\n * Get the value or a default value.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `unwrapOr(option, defaultValue)`\n * - Data-last: `pipe(option, unwrapOr(defaultValue))`\n *\n * Uses NoInfer to prevent type inference from the default value.\n *\n * @param defaultValue - Value to return if the Option is none\n * @returns A function that takes an Option and returns the value or default\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * unwrapOr(some(42), 0) // 42\n * unwrapOr(none(), 0) // 0\n *\n * // Data-last (curried for pipe)\n * pipe(some(42), unwrapOr(0)) // 42\n * pipe(none(), unwrapOr(0)) // 0\n * ```\n */\nexport const unwrapOr: OptionUnwrapOr = dual(\n 2,\n <T>(option: OptionType<T>, defaultValue: NoInfer<T>): T => (option.some ? option.value : defaultValue),\n)\n\n/**\n * Get the value or compute a value.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `unwrapOrElse(option, fn)`\n * - Data-last: `pipe(option, unwrapOrElse(fn))`\n *\n * @param fn - Function to compute a value\n * @returns A function that takes an Option and returns the value or computed value\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * unwrapOrElse(none(), () => generateDefault()) // generateDefault()\n *\n * // Data-last (curried for pipe)\n * pipe(\n * none(),\n * unwrapOrElse(() => generateDefault())\n * ) // generateDefault()\n * ```\n */\nexport const unwrapOrElse: OptionUnwrapOrElse = dual(\n 2,\n <T>(option: OptionType<T>, fn: () => T): T => (option.some ? option.value : fn()),\n)\n\n/**\n * Pattern match on an Option, handling both some and none cases.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `match(option, { some: ..., none: ... })`\n * - Data-last: `pipe(option, match({ some: ..., none: ... }))`\n *\n * @param handlers - Object with some and none handlers\n * @returns A function that takes an Option and returns the handler result\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * match(some(42), {\n * some: n => `Got ${n}`,\n * none: () => 'No value'\n * }) // 'Got 42'\n *\n * // Data-last (curried for pipe)\n * pipe(\n * some(42),\n * match({\n * some: n => `Got ${n}`,\n * none: () => 'No value'\n * })\n * ) // 'Got 42'\n * ```\n */\nexport const match: OptionMatch = dual(\n 2,\n <T, U>(option: OptionType<T>, handlers: { some: (value: T) => U; none: () => U }): U =>\n option.some ? handlers.some(option.value) : handlers.none(),\n)\n\n// ============================================================================\n// Conversions\n// ============================================================================\n\n/**\n * Convert a nullable value to an Option.\n * null and undefined become none, other values become some.\n *\n * @param value - The value to convert\n * @returns An Option\n *\n * @example\n * ```ts\n * fromNullable(42) // { some: true, value: 42 }\n * fromNullable(null) // { some: false }\n * fromNullable(undefined) // { some: false }\n * ```\n */\nexport const fromNullable = <T>(value: T | null | undefined): OptionType<T> =>\n value === null || value === undefined ? none<T>() : some(value)\n\n/**\n * Wrap a function that might throw into an Option.\n * Supports both sync and async functions with automatic type inference.\n *\n * - Sync fn: returns Option<T>\n * - Async fn: returns Promise<Option<T>>\n *\n * **Note on `any` return types:** If your function returns `any` (e.g., `JSON.parse`),\n * you should add an explicit return type annotation. This is because TypeScript's\n * conditional types cannot determine if `any` is a Promise or not, resulting in a\n * union type `Promise<Option<unknown>> | Option<any>` that won't work\n * with Option utilities like `isSome` or `isNone`.\n *\n * @param fn - Function that might throw (sync or async)\n * @returns An Option with the return value or none\n *\n * @example\n * ```ts\n * // Sync usage\n * fromTry(() => JSON.parse('{\"valid\": true}'))\n * // { some: true, value: { valid: true } }\n *\n * fromTry(() => JSON.parse('not json'))\n * // { some: false }\n *\n * // When fn returns `any`, add explicit return type:\n * fromTry((): unknown => JSON.parse(input))\n * fromTry((): MyType => JSON.parse(input))\n *\n * // Async usage\n * await fromTry(async () => await fetch('/api/user'))\n * // Promise<Option<Response>>\n *\n * await fromTry(async () => {\n * throw new Error('network error')\n * })\n * // Promise<{ some: false }>\n * ```\n */\n/* oxlint-disable no-explicit-any, no-unsafe-type-assertion -- Required for conditional return type */\nexport const fromTry = <T>(fn: () => T): FromTryReturn<T> => {\n try {\n const result = fn()\n if (isPromise(result)) {\n return result.then(some).catch(() => none()) as unknown as FromTryReturn<T>\n }\n return some(result) as unknown as FromTryReturn<T>\n } catch {\n return none() as unknown as FromTryReturn<T>\n }\n}\n\n// ============================================================================\n// Namespace\n// ============================================================================\n\n/**\n * Option namespace containing all utility functions for working with Option types.\n *\n * Option represents either the presence (some) or absence (none) of a value.\n * Use this for optional values without needing to track why the value is missing.\n *\n * @see {@link Result} for success/failure with error information\n * @see {@link Either} for two valid outcomes\n *\n * @example\n * ```ts\n * import { Option, pipe } from '@repo/std'\n * import type { Option as OptionType } from '@repo/std'\n *\n * const findUser = (id: number): OptionType<User> =>\n * id > 0 ? Option.some({ id, name: 'Alice' }) : Option.none()\n *\n * const result = pipe(\n * Option.some(10),\n * Option.flatMap(findUser),\n * Option.map(user => user.name),\n * Option.unwrapOr('Unknown')\n * )\n * ```\n */\nexport const Option = {\n some,\n none,\n isSome,\n isNone,\n map,\n flatMap,\n tap,\n orElse,\n filter,\n all,\n unwrapOr,\n unwrapOrElse,\n match,\n fromNullable,\n fromTry,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,QAAW,WAA6B;CACnD,MAAM;CACN;EACC,WAAW;EACV,UAAU;EACV,UAAU;EACV,UAAU;EACX;CACD,MAAM;CAEN,EAAE,OAAO,YAAuD;AAC9D,SAAO;;CAEV;;;;;;;;;;;AAYD,MAAa,cAAwC;CACnD,MAAM;EACL,WAAW;EACV,UAAU;EACV,UAAU;EACV,UAAU;EACX;CACD,MAAM;CACN,EAAE,OAAO,YAA2D;AAClE,QAAM,IAAI,oBAAoB;AAC9B,QAAM,IAAI,MAAM,iEAAiE;;CAEpF;;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AO,MAAM;;AAE3B,SAAO,KAAKA,SAAO;;CAGrB,MAAM,SAAkC,EAAE;AAC1C,MAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,QAAQ,EAAE;EACnD,MAAM,IAAI;AACV,MAAI,CAAC,EAAE,KAAM,QAAO;AACpB,SAAO,OAAO,EAAE;;AAElB,QAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;AA+BrB,MAAa,WAA2B,KACtC,IACI,QAAuB,iBAAiC,OAAO,OAAO,OAAO,QAAQ,aAC1F;;;;;;;;;;;;;;;;;;;;;;;AAwBD,MAAa,eAAmC,KAC9C,IACI,QAAuB,OAAoB,OAAO,OAAO,OAAO,QAAQ,IAAI,CACjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,MAAa,QAAqB,KAChC,IACO,QAAuB,aAC5B,OAAO,OAAO,SAAS,KAAK,OAAO,MAAM,GAAG,SAAS,MAAM,CAC9D;;;;;;;;;;;;;;;AAoBD,MAAa,gBAAmB,UAC9B,UAAU,QAAQ,UAAU,SAAY,MAAS,GAAG,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CjE,MAAa,WAAc,OAAkC;AAC3D,KAAI;EACF,MAAM,SAAS,IAAI;AACnB,MAAI,UAAU,OAAO,CACnB,QAAO,OAAO,KAAK,KAAK,CAAC,YAAY,MAAM,CAAC;AAE9C,SAAO,KAAK,OAAO;SACb;AACN,SAAO,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCjB,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -1,33 +0,0 @@
1
- import { t as FxTypeId } from "./fx.types-DpIQILok.mjs";
2
-
3
- //#region src/option/option.types.ts
4
- /**
5
- * Error thrown when attempting to access a value from None.
6
- * Used as the error type when Option is yielded in Fx.gen().
7
- *
8
- * When you yield* Option.none() in Fx.gen(), the computation short-circuits
9
- * with this error, which becomes part of the error union type.
10
- *
11
- * Implements Fx protocol so it can be yielded in Fx.gen() directly.
12
- */
13
- var NoSuchElementError = class extends Error {
14
- _tag = "NoSuchElementError";
15
- [FxTypeId] = {
16
- _A: () => void 0,
17
- _E: () => this,
18
- _R: () => void 0
19
- };
20
- constructor() {
21
- super("Option is None - no element present");
22
- this.name = "NoSuchElementError";
23
- }
24
- };
25
- /**
26
- * Singleton None value.
27
- * @deprecated Use NoSuchElementError instead for Fx.gen() error handling.
28
- */
29
- const None = { _tag: "None" };
30
-
31
- //#endregion
32
- export { None as n, NoSuchElementError as t };
33
- //# sourceMappingURL=option.types-BiAiZ8Ks.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"option.types-BiAiZ8Ks.mjs","names":[],"sources":["../src/option/option.types.ts"],"sourcesContent":["import { FxTypeId } from \"../fx/fx.types\"\nimport type { Fx } from \"../fx/fx.types\"\nimport type { Pipeable } from \"../shared/pipeable\"\n\n// ============================================================================\n// NoSuchElementError\n// ============================================================================\n\n/**\n * Error thrown when attempting to access a value from None.\n * Used as the error type when Option is yielded in Fx.gen().\n *\n * When you yield* Option.none() in Fx.gen(), the computation short-circuits\n * with this error, which becomes part of the error union type.\n *\n * Implements Fx protocol so it can be yielded in Fx.gen() directly.\n */\nexport class NoSuchElementError extends Error implements Fx<never, NoSuchElementError, never> {\n readonly _tag = \"NoSuchElementError\"\n\n readonly [FxTypeId] = {\n _A: () => undefined as never,\n _E: () => this as NoSuchElementError,\n _R: () => undefined as never,\n }\n\n constructor() {\n super(\"Option is None - no element present\")\n this.name = \"NoSuchElementError\"\n }\n}\n\n// ============================================================================\n// None Type (legacy - kept for backward compatibility)\n// ============================================================================\n\n/**\n * Marker type for Option's absence in the Do computation context.\n * @deprecated Use NoSuchElementError instead for Fx.gen() error handling.\n */\nexport type None = { readonly _tag: \"None\" }\n\n/**\n * Singleton None value.\n * @deprecated Use NoSuchElementError instead for Fx.gen() error handling.\n */\nexport const None: None = { _tag: \"None\" }\n\n// ============================================================================\n// Option Type\n// ============================================================================\n\n/**\n * A discriminated union representing either a value (some) or absence (none).\n * Compatible with ts-pattern for exhaustive matching.\n *\n * Implements Fx protocol: Option<T> is Fx<T, NoSuchElementError, never>\n * - Yielding Some in Fx.gen() returns the value\n * - Yielding None in Fx.gen() short-circuits with NoSuchElementError\n *\n * When yielded in a generator, yields NoSuchElementError (which implements Fx)\n * for proper type inference in both gen() and Fx.gen().\n */\nexport type Option<T> = Fx<T, NoSuchElementError, never> &\n Pipeable &\n ({ readonly some: true; readonly value: T } | { readonly some: false }) & {\n [Symbol.iterator](): Generator<NoSuchElementError, T, unknown>\n }\n\n/**\n * Compute the return type of `fromTry` based on whether fn returns a Promise.\n * - If fn returns Promise<T>, result is Promise<Option<T>>\n * - If fn returns T, result is Option<T>\n */\nexport type FromTryReturn<T> = T extends Promise<infer U> ? Promise<Option<U>> : Option<T>\n\n// ============================================================================\n// All/Combine types\n// ============================================================================\n\n/**\n * Extract the value type from an Option.\n * Uses structural matching to extract the value type from the some branch.\n */\ntype OptionValue<O> = O extends { readonly some: true; readonly value: infer T } ? T : never\n\n/**\n * Overloaded all() type with explicit tuple arities for better inference.\n * Provides tuple overloads for 1-6 elements so `as const` is not required.\n */\nexport type OptionAll = {\n // Tuple overloads (1-6 elements)\n <A>(options: readonly [Option<A>]): Option<[A]>\n <A, B>(options: readonly [Option<A>, Option<B>]): Option<[A, B]>\n <A, B, C>(options: readonly [Option<A>, Option<B>, Option<C>]): Option<[A, B, C]>\n <A, B, C, D>(options: readonly [Option<A>, Option<B>, Option<C>, Option<D>]): Option<[A, B, C, D]>\n <A, B, C, D, E>(options: readonly [Option<A>, Option<B>, Option<C>, Option<D>, Option<E>]): Option<[A, B, C, D, E]>\n <A, B, C, D, E, F>(\n options: readonly [Option<A>, Option<B>, Option<C>, Option<D>, Option<E>, Option<F>],\n ): Option<[A, B, C, D, E, F]>\n\n // Array fallback (longer tuples need `as const`)\n <T extends readonly Option<unknown>[]>(options: T): Option<{ -readonly [K in keyof T]: OptionValue<T[K]> }>\n\n // Object form\n <T extends Record<string, Option<unknown>>>(options: T): Option<{ -readonly [K in keyof T]: OptionValue<T[K]> }>\n}\n\n// ============================================================================\n// Function Interfaces for improved pipe inference\n// ============================================================================\n\n/**\n * Interface for flatMap - using method syntax improves generic inference in pipe chains.\n * Supports both data-first and data-last (curried) calling styles via dual().\n * Note: Async overload must come first for proper overload resolution.\n */\nexport type OptionFlatMap = {\n // Data-first overloads (async first)\n <A, B>(option: Option<A>, fn: (value: A) => Promise<Option<B>>): Promise<Option<B>>\n <A, B>(option: Option<A>, fn: (value: A) => Option<B>): Option<B>\n // Data-last overloads (curried for pipe)\n <A, B>(fn: (value: A) => Promise<Option<B>>): (option: Option<A>) => Promise<Option<B>>\n <A, B>(fn: (value: A) => Option<B>): (option: Option<A>) => Option<B>\n}\n\n/**\n * Interface for map function.\n * Supports both data-first and data-last (curried) calling styles via dual().\n * Note: Async overload must come first for proper overload resolution.\n */\nexport type OptionMap = {\n // Data-first overloads (async first)\n <A, B>(option: Option<A>, fn: (value: A) => Promise<B>): Promise<Option<B>>\n <A, B>(option: Option<A>, fn: (value: A) => B): Option<B>\n // Data-last overloads (curried for pipe)\n <A, B>(fn: (value: A) => Promise<B>): (option: Option<A>) => Promise<Option<B>>\n <A, B>(fn: (value: A) => B): (option: Option<A>) => Option<B>\n}\n\n/**\n * Interface for tap function.\n * Supports both data-first and data-last (curried) calling styles via dual().\n */\nexport type OptionTap = {\n // Data-first overload\n <A, R>(option: Option<A>, fn: (value: A) => R): R extends Promise<unknown> ? Promise<Option<A>> : Option<A>\n // Data-last overload (curried for pipe)\n <A, R>(fn: (value: A) => R): (option: Option<A>) => R extends Promise<unknown> ? Promise<Option<A>> : Option<A>\n}\n\n/**\n * Interface for orElse function.\n * Supports both data-first and data-last (curried) calling styles via dual().\n * Note: Async overload must come first for proper overload resolution.\n */\nexport type OptionOrElse = {\n // Data-first overloads (async first)\n <A, B>(option: Option<A>, fn: () => Promise<Option<B>>): Promise<Option<A | B>>\n <A, B>(option: Option<A>, fn: () => Option<B>): Option<A | B>\n // Data-last overloads (curried for pipe)\n <A, B>(fn: () => Promise<Option<B>>): (option: Option<A>) => Promise<Option<A | B>>\n <A, B>(fn: () => Option<B>): (option: Option<A>) => Option<A | B>\n}\n\n/**\n * Interface for filter function.\n * Supports both data-first and data-last (curried) calling styles via dual().\n */\nexport type OptionFilter = {\n // Data-first overload\n <A>(option: Option<A>, predicate: (value: A) => boolean): Option<A>\n // Data-last overload (curried for pipe)\n <A>(predicate: (value: A) => boolean): (option: Option<A>) => Option<A>\n}\n\n/**\n * Interface for unwrapOr function.\n * Supports both data-first and data-last (curried) calling styles via dual().\n * Uses NoInfer to prevent type inference from the default value.\n */\nexport type OptionUnwrapOr = {\n // Data-first overload\n <T>(option: Option<T>, defaultValue: NoInfer<T>): T\n // Data-last overload (curried for pipe)\n <T>(defaultValue: NoInfer<T>): (option: Option<T>) => T\n}\n\n/**\n * Interface for unwrapOrElse function.\n * Supports both data-first and data-last (curried) calling styles via dual().\n */\nexport type OptionUnwrapOrElse = {\n // Data-first overload\n <T>(option: Option<T>, fn: () => T): T\n // Data-last overload (curried for pipe)\n <T>(fn: () => T): (option: Option<T>) => T\n}\n\n/**\n * Interface for match function.\n * Supports both data-first and data-last (curried) calling styles via dual().\n */\nexport type OptionMatch = {\n // Data-first overload\n <T, U>(option: Option<T>, handlers: { some: (value: T) => U; none: () => U }): U\n // Data-last overload (curried for pipe)\n <T, U>(handlers: { some: (value: T) => U; none: () => U }): (option: Option<T>) => U\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAa,qBAAb,cAAwC,MAAsD;CAC5F,AAAS,OAAO;CAEhB,CAAU,YAAY;EACpB,UAAU;EACV,UAAU;EACV,UAAU;EACX;CAED,cAAc;AACZ,QAAM,sCAAsC;AAC5C,OAAK,OAAO;;;;;;;AAkBhB,MAAa,OAAa,EAAE,MAAM,QAAQ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AAA,EAyE+C,MAzE/C,CAyEsD,CAzEtD,CAAA,EAAA,GAyE6D,GAzE7D;CAAP"}
@@ -1,10 +0,0 @@
1
- import { t as flow } from "./flow-D4cE0EAg.mjs";
2
-
3
- //#region src/pipe/pipe.ts
4
- function pipe(arg, ...fns) {
5
- return flow(...fns)(arg);
6
- }
7
-
8
- //#endregion
9
- export { pipe as t };
10
- //# sourceMappingURL=pipe-BF4G4SLo.mjs.map