@nicolastoulemont/std 0.4.0 → 0.5.1

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-Cydt5ocm.d.mts → index-DjjJIDaA.d.mts} +2 -2
  54. package/dist/{index-Cydt5ocm.d.mts.map → index-DjjJIDaA.d.mts.map} +1 -1
  55. package/dist/{index-EmWRCTY3.d.mts → index-DtAPrec7.d.mts} +2 -2
  56. package/dist/{index-EmWRCTY3.d.mts.map → index-DtAPrec7.d.mts.map} +1 -1
  57. package/dist/{index-CLlcoy8B.d.mts → index-IdejL485.d.mts} +2 -2
  58. package/dist/{index-CLlcoy8B.d.mts.map → index-IdejL485.d.mts.map} +1 -1
  59. package/dist/{index-CLspOlBH.d.mts → index-UYodvXes.d.mts} +200 -91
  60. package/dist/index-UYodvXes.d.mts.map +1 -0
  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,542 +0,0 @@
1
- import { t as FxTypeId } from "./fx.types-DpIQILok.mjs";
2
- import { n as dual, t as pipeMethod } from "./pipeable-DYNrUps7.mjs";
3
- import { n as isPromise } from "./flow-D4cE0EAg.mjs";
4
-
5
- //#region src/result/result.ts
6
- /**
7
- * Create a successful Result.
8
- *
9
- * @param value - The success value
10
- * @returns A Result with ok: true
11
- *
12
- * @example
13
- * ```ts
14
- * ok(42) // { ok: true, value: 42 }
15
- * ```
16
- */
17
- const ok = (value) => {
18
- return {
19
- ok: true,
20
- value,
21
- pipe: pipeMethod,
22
- [FxTypeId]: {
23
- _A: () => value,
24
- _E: () => void 0,
25
- _R: () => void 0
26
- },
27
- *[Symbol.iterator]() {
28
- return value;
29
- }
30
- };
31
- };
32
- /**
33
- * Create an error Result.
34
- *
35
- * @param error - The error value
36
- * @returns A Result with ok: false
37
- *
38
- * @example
39
- * ```ts
40
- * err('something went wrong') // { ok: false, error: 'something went wrong' }
41
- * ```
42
- */
43
- const err = (error) => {
44
- const result = {
45
- ok: false,
46
- error,
47
- pipe: pipeMethod,
48
- [FxTypeId]: {
49
- _A: () => void 0,
50
- _E: () => error,
51
- _R: () => void 0
52
- },
53
- *[Symbol.iterator]() {
54
- yield result;
55
- throw new Error("Unreachable: Do should short-circuit on error");
56
- }
57
- };
58
- return result;
59
- };
60
- /**
61
- * Check if a Result is successful.
62
- *
63
- * @param result - The Result to check
64
- * @returns true if the Result is ok
65
- *
66
- * @example
67
- * ```ts
68
- * const result = ok(42)
69
- * if (isOk(result)) {
70
- * console.log(result.value) // TypeScript knows value exists
71
- * }
72
- * ```
73
- */
74
- const isOk = (result) => result.ok;
75
- /**
76
- * Check if a Result is an error.
77
- *
78
- * @param result - The Result to check
79
- * @returns true if the Result is an error
80
- *
81
- * @example
82
- * ```ts
83
- * const result = err('oops')
84
- * if (isErr(result)) {
85
- * console.log(result.error) // TypeScript knows error exists
86
- * }
87
- * ```
88
- */
89
- const isErr = (result) => !result.ok;
90
- /**
91
- * Transform the success value of a Result.
92
- * If the Result is an error, it passes through unchanged.
93
- *
94
- * Supports both data-first and data-last calling styles:
95
- * - Data-first: `map(result, fn)`
96
- * - Data-last: `pipe(result, map(fn))`
97
- *
98
- * Supports both sync and async functions:
99
- * - Sync fn: returns Result<U, E>
100
- * - Async fn: returns Promise<Result<U, E>>
101
- *
102
- * @param fn - Function to transform the success value
103
- * @returns A function that takes a Result and returns a new Result
104
- *
105
- * @example
106
- * ```ts
107
- * // Data-first (direct call)
108
- * map(ok(5), n => n * 2) // { ok: true, value: 10 }
109
- *
110
- * // Data-last (curried for pipe)
111
- * pipe(
112
- * ok(5),
113
- * map(n => n * 2)
114
- * ) // { ok: true, value: 10 }
115
- *
116
- * // Async usage
117
- * await pipe(
118
- * ok(userId),
119
- * map(async id => await fetchName(id))
120
- * ) // Promise<Result<string, E>>
121
- * ```
122
- */
123
- const map = dual(2, (result, fn) => {
124
- if (!result.ok) return result;
125
- const mapped = fn(result.value);
126
- if (mapped instanceof Promise) return mapped.then(ok);
127
- return ok(mapped);
128
- });
129
- /**
130
- * Transform the error value of a Result.
131
- * If the Result is successful, it passes through unchanged.
132
- *
133
- * Supports both data-first and data-last calling styles:
134
- * - Data-first: `mapErr(result, fn)`
135
- * - Data-last: `pipe(result, mapErr(fn))`
136
- *
137
- * Supports both sync and async functions:
138
- * - Sync fn: returns Result<T, F>
139
- * - Async fn: returns Promise<Result<T, F>>
140
- *
141
- * @param fn - Function to transform the error value
142
- * @returns A function that takes a Result and returns a new Result
143
- *
144
- * @example
145
- * ```ts
146
- * // Data-first (direct call)
147
- * mapErr(err({ code: 404 }), e => `Error: ${e.code}`)
148
- * // { ok: false, error: 'Error: 404' }
149
- *
150
- * // Data-last (curried for pipe)
151
- * pipe(
152
- * err({ code: 404 }),
153
- * mapErr(e => `Error: ${e.code}`)
154
- * ) // { ok: false, error: 'Error: 404' }
155
- *
156
- * // Async usage
157
- * await pipe(
158
- * err(errorCode),
159
- * mapErr(async code => await translateError(code))
160
- * ) // Promise<Result<T, string>>
161
- * ```
162
- */
163
- const mapErr = dual(2, (result, fn) => {
164
- if (result.ok) return result;
165
- const mapped = fn(result.error);
166
- if (mapped instanceof Promise) return mapped.then(err);
167
- return err(mapped);
168
- });
169
- /**
170
- * Chain operations that return Results.
171
- * If the Result is an error, it passes through unchanged.
172
- *
173
- * Supports both data-first and data-last calling styles:
174
- * - Data-first: `flatMap(result, fn)`
175
- * - Data-last: `pipe(result, flatMap(fn))`
176
- *
177
- * Supports both sync and async functions:
178
- * - Sync fn: returns Result<U, E | E2>
179
- * - Async fn: returns Promise<Result<U, E | E2>>
180
- *
181
- * @param fn - Function that takes a value and returns a Result (or Promise<Result>)
182
- * @returns A function that takes a Result and returns a new Result
183
- *
184
- * @example
185
- * ```ts
186
- * const divide = (a: number, b: number) =>
187
- * b === 0 ? err('division by zero') : ok(a / b)
188
- *
189
- * // Data-first (direct call)
190
- * flatMap(ok(10), n => divide(n, 2)) // { ok: true, value: 5 }
191
- *
192
- * // Data-last (curried for pipe)
193
- * pipe(
194
- * ok(10),
195
- * flatMap(n => divide(n, 2))
196
- * ) // { ok: true, value: 5 }
197
- *
198
- * // Async usage
199
- * await pipe(
200
- * ok(userId),
201
- * flatMap(async id => ok(await fetchUser(id)))
202
- * ) // Promise<Result<User, E>>
203
- * ```
204
- */
205
- const flatMap = dual(2, (result, fn) => result.ok ? fn(result.value) : result);
206
- /**
207
- * Perform a side effect on the success value without modifying the Result.
208
- * Useful for debugging, logging, or other side effects in a pipeline.
209
- * If the Result is an error, the function is not called.
210
- *
211
- * Supports both data-first and data-last calling styles:
212
- * - Data-first: `tap(result, fn)`
213
- * - Data-last: `pipe(result, tap(fn))`
214
- *
215
- * Supports both sync and async functions:
216
- * - Sync fn: returns Result<T, E>
217
- * - Async fn: returns Promise<Result<T, E>>
218
- *
219
- * @param fn - Function to call with the success value (return value is ignored)
220
- * @returns A function that takes a Result and returns the same Result
221
- *
222
- * @example
223
- * ```ts
224
- * // Data-first (direct call)
225
- * tap(ok(42), console.log) // logs 42, returns { ok: true, value: 42 }
226
- *
227
- * // Data-last (curried for pipe)
228
- * pipe(
229
- * ok(42),
230
- * tap(console.log), // logs 42
231
- * map(n => n * 2)
232
- * ) // { ok: true, value: 84 }
233
- *
234
- * // Async usage
235
- * await pipe(
236
- * ok(42),
237
- * tap(async v => await logToServer(v)),
238
- * map(n => n * 2)
239
- * ) // Promise<Result<84, E>>
240
- * ```
241
- */
242
- const tap = dual(2, (result, fn) => {
243
- if (!result.ok) return result;
244
- const sideEffect = fn(result.value);
245
- if (sideEffect instanceof Promise) return sideEffect.then(() => result);
246
- return result;
247
- });
248
- /**
249
- * Recover from an error by providing an alternative Result.
250
- * If the Result is successful, it passes through unchanged.
251
- *
252
- * Supports both data-first and data-last calling styles:
253
- * - Data-first: `orElse(result, fn)`
254
- * - Data-last: `pipe(result, orElse(fn))`
255
- *
256
- * Supports both sync and async functions:
257
- * - Sync fn: returns Result<T | U, E2>
258
- * - Async fn: returns Promise<Result<T | U, E2>>
259
- *
260
- * @param fn - Function that takes the error and returns an alternative Result
261
- * @returns A function that takes a Result and returns a new Result
262
- *
263
- * @example
264
- * ```ts
265
- * // Data-first (direct call)
266
- * orElse(err('cache miss'), () => ok(defaultValue))
267
- * // { ok: true, value: defaultValue }
268
- *
269
- * // Data-last (curried for pipe)
270
- * pipe(
271
- * err('cache miss'),
272
- * orElse(() => ok(defaultValue))
273
- * ) // { ok: true, value: defaultValue }
274
- *
275
- * // Async recovery
276
- * await pipe(
277
- * err('cache miss'),
278
- * orElse(async () => ok(await fetchFromAPI()))
279
- * ) // Promise<Result<T, E2>>
280
- *
281
- * // Chain multiple fallbacks
282
- * pipe(
283
- * err('not found'),
284
- * orElse(() => tryCache()),
285
- * orElse(() => tryAPI()),
286
- * orElse(() => ok(fallback))
287
- * )
288
- * ```
289
- */
290
- const orElse = dual(2, (result, fn) => result.ok ? result : fn(result.error));
291
- /**
292
- * Filter a successful Result based on a predicate.
293
- * If the predicate returns false, converts the success to an error.
294
- * If the Result is already an error, it passes through unchanged.
295
- *
296
- * Supports both data-first and data-last calling styles:
297
- * - Data-first: `filter(result, predicate, onFail)`
298
- * - Data-last: `pipe(result, filter(predicate, onFail))`
299
- *
300
- * @param predicate - Function that returns true to keep the value
301
- * @param onFail - Function that creates the error when predicate fails
302
- * @returns A function that takes a Result and returns a new Result
303
- *
304
- * @example
305
- * ```ts
306
- * // Data-first (direct call)
307
- * filter(ok(5), n => n > 10, n => `${n} is too small`)
308
- * // { ok: false, error: '5 is too small' }
309
- *
310
- * // Data-last (curried for pipe)
311
- * pipe(
312
- * ok(5),
313
- * filter(n => n > 10, n => `${n} is too small`)
314
- * ) // { ok: false, error: '5 is too small' }
315
- *
316
- * pipe(
317
- * ok(15),
318
- * filter(n => n > 10, n => `${n} is too small`)
319
- * ) // { ok: true, value: 15 }
320
- *
321
- * // With complex validation
322
- * pipe(
323
- * ok(user),
324
- * filter(u => u.age >= 18, u => ({ code: 'UNDERAGE', user: u }))
325
- * )
326
- * ```
327
- */
328
- const filter = dual(3, (result, predicate, onFail) => {
329
- if (!result.ok) return result;
330
- return predicate(result.value) ? result : err(onFail(result.value));
331
- });
332
- /**
333
- * Combine multiple Results into a single Result.
334
- * Supports both array and object inputs.
335
- *
336
- * - If all Results are ok, returns ok with all values
337
- * - If any Result is an error, returns the first error (short-circuits)
338
- *
339
- * For arrays of 1-6 elements, tuple types are inferred automatically.
340
- * For longer arrays, use `as const` to preserve tuple structure.
341
- *
342
- * @example
343
- * ```ts
344
- * // Array form - tuple types inferred automatically for up to 6 elements
345
- * const [num, str] = pipe(
346
- * Result.all([parseNumber(input), parseString(other)]),
347
- * Result.unwrapOr([0, ''])
348
- * )
349
- *
350
- * // Object form - returns Result<{ user: User, config: Config }, E>
351
- * pipe(
352
- * Result.all({ user: fetchUser(id), config: loadConfig() }),
353
- * Result.tap(({ user, config }) => console.log(user.name, config.theme))
354
- * )
355
- * ```
356
- */
357
- const all = (results) => {
358
- if (Array.isArray(results)) {
359
- const values$1 = [];
360
- for (const result of results) {
361
- if (!result.ok) return result;
362
- values$1.push(result.value);
363
- }
364
- return ok(values$1);
365
- }
366
- const values = {};
367
- for (const [key, result] of Object.entries(results)) {
368
- const r = result;
369
- if (!r.ok) return result;
370
- values[key] = r.value;
371
- }
372
- return ok(values);
373
- };
374
- /**
375
- * Get the success value or a default value.
376
- *
377
- * Supports both data-first and data-last calling styles:
378
- * - Data-first: `unwrapOr(result, defaultValue)`
379
- * - Data-last: `pipe(result, unwrapOr(defaultValue))`
380
- *
381
- * Uses NoInfer to prevent type inference from the default value.
382
- *
383
- * @param defaultValue - Value to return if the Result is an error
384
- * @returns A function that takes a Result and returns the value or default
385
- *
386
- * @example
387
- * ```ts
388
- * // Data-first (direct call)
389
- * unwrapOr(ok(42), 0) // 42
390
- * unwrapOr(err('oops'), 0) // 0
391
- *
392
- * // Data-last (curried for pipe)
393
- * pipe(ok(42), unwrapOr(0)) // 42
394
- * pipe(err('oops'), unwrapOr(0)) // 0
395
- * ```
396
- */
397
- const unwrapOr = dual(2, (result, defaultValue) => result.ok ? result.value : defaultValue);
398
- /**
399
- * Get the success value or compute a value from the error.
400
- *
401
- * Supports both data-first and data-last calling styles:
402
- * - Data-first: `unwrapOrElse(result, fn)`
403
- * - Data-last: `pipe(result, unwrapOrElse(fn))`
404
- *
405
- * @param fn - Function to compute a value from the error
406
- * @returns A function that takes a Result and returns the value or computed value
407
- *
408
- * @example
409
- * ```ts
410
- * // Data-first (direct call)
411
- * unwrapOrElse(err({ code: 404 }), e => `Error ${e.code}`) // 'Error 404'
412
- *
413
- * // Data-last (curried for pipe)
414
- * pipe(
415
- * err({ code: 404 }),
416
- * unwrapOrElse(e => `Error ${e.code}`)
417
- * ) // 'Error 404'
418
- * ```
419
- */
420
- const unwrapOrElse = dual(2, (result, fn) => result.ok ? result.value : fn(result.error));
421
- /**
422
- * Pattern match on a Result, handling both success and error cases.
423
- *
424
- * Supports both data-first and data-last calling styles:
425
- * - Data-first: `match(result, { ok: ..., err: ... })`
426
- * - Data-last: `pipe(result, match({ ok: ..., err: ... }))`
427
- *
428
- * @param handlers - Object with ok and err handlers
429
- * @returns A function that takes a Result and returns the handler result
430
- *
431
- * @example
432
- * ```ts
433
- * // Data-first (direct call)
434
- * match(ok(42), {
435
- * ok: n => `Got ${n}`,
436
- * err: e => `Error: ${e}`
437
- * }) // 'Got 42'
438
- *
439
- * // Data-last (curried for pipe)
440
- * pipe(
441
- * ok(42),
442
- * match({
443
- * ok: n => `Got ${n}`,
444
- * err: e => `Error: ${e}`
445
- * })
446
- * ) // 'Got 42'
447
- * ```
448
- */
449
- const match = dual(2, (result, handlers) => result.ok ? handlers.ok(result.value) : handlers.err(result.error));
450
- /**
451
- * Wrap a function that might throw into a Result.
452
- * Supports both sync and async functions with automatic type inference.
453
- *
454
- * - Sync fn: returns Result<T, Error>
455
- * - Async fn: returns Promise<Result<T, Error>>
456
- *
457
- * **Note on `any` return types:** If your function returns `any` (e.g., `JSON.parse`),
458
- * you should add an explicit return type annotation. This is because TypeScript's
459
- * conditional types cannot determine if `any` is a Promise or not, resulting in a
460
- * union type `Promise<Result<unknown, Error>> | Result<any, Error>` that won't work
461
- * with Result utilities like `isOk` or `isErr`.
462
- *
463
- * @param fn - Function that might throw (sync or async)
464
- * @returns A Result with the return value or the caught error
465
- *
466
- * @example
467
- * ```ts
468
- * // Sync usage
469
- * fromTry(() => JSON.parse('{"valid": true}'))
470
- * // { ok: true, value: { valid: true } }
471
- *
472
- * fromTry(() => JSON.parse('not json'))
473
- * // { ok: false, error: SyntaxError }
474
- *
475
- * // When fn returns `any`, add explicit return type:
476
- * fromTry((): unknown => JSON.parse(input))
477
- * fromTry((): MyType => JSON.parse(input))
478
- *
479
- * // Async usage
480
- * await fromTry(async () => await fetch('/api/user'))
481
- * // Promise<Result<Response, Error>>
482
- *
483
- * await fromTry(async () => {
484
- * throw new Error('network error')
485
- * })
486
- * // Promise<{ ok: false, error: Error }>
487
- * ```
488
- */
489
- const fromTry = (fn) => {
490
- try {
491
- const result = fn();
492
- if (isPromise(result)) return result.then(ok).catch((e) => err(e instanceof Error ? e : new Error(String(e))));
493
- return ok(result);
494
- } catch (e) {
495
- return err(e instanceof Error ? e : new Error(String(e)));
496
- }
497
- };
498
- /**
499
- * Result namespace containing all utility functions for working with Result types.
500
- *
501
- * Result represents either success (ok) or failure (err). Use this for operations
502
- * that can fail with typed errors.
503
- *
504
- * @see {@link Option} for presence/absence semantics (no error information)
505
- * @see {@link Either} for two valid outcomes (not just success/failure)
506
- *
507
- * @example
508
- * ```ts
509
- * import { Result, pipe } from '@repo/std'
510
- * import type { Result as ResultType } from '@repo/std'
511
- *
512
- * const divide = (a: number, b: number): ResultType<number, string> =>
513
- * b === 0 ? Result.err('division by zero') : Result.ok(a / b)
514
- *
515
- * const result = pipe(
516
- * divide(10, 2),
517
- * Result.map(n => n * 2),
518
- * Result.unwrapOr(0)
519
- * )
520
- * ```
521
- */
522
- const Result = {
523
- ok,
524
- err,
525
- isOk,
526
- isErr,
527
- map,
528
- mapErr,
529
- flatMap,
530
- tap,
531
- orElse,
532
- filter,
533
- all,
534
- unwrapOr,
535
- unwrapOrElse,
536
- match,
537
- fromTry
538
- };
539
-
540
- //#endregion
541
- export { flatMap as a, isOk as c, match as d, ok as f, unwrapOrElse as g, unwrapOr as h, filter as i, map as l, tap as m, all as n, fromTry as o, orElse as p, err as r, isErr as s, Result as t, mapErr as u };
542
- //# sourceMappingURL=result-DhYA-J-M.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"result-DhYA-J-M.mjs","names":["values"],"sources":["../src/result/result.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 type {\n FromTryReturn,\n Result as ResultType,\n ResultAll,\n ResultFlatMap,\n ResultMap,\n ResultMapErr,\n ResultMatch,\n ResultTap,\n ResultOrElse,\n ResultFilter,\n ResultUnwrapOr,\n ResultUnwrapOrElse,\n} from \"./result.types\"\n\n// ============================================================================\n// Constructors\n// ============================================================================\n\n/**\n * Create a successful Result.\n *\n * @param value - The success value\n * @returns A Result with ok: true\n *\n * @example\n * ```ts\n * ok(42) // { ok: true, value: 42 }\n * ```\n */\nexport const ok = <T>(value: T): ResultType<T, never> => {\n const result: ResultType<T, never> = {\n ok: true,\n value,\n pipe: pipeMethod,\n [FxTypeId]: {\n _A: () => value,\n _E: () => undefined as never,\n _R: () => undefined as never,\n },\n // oxlint-disable-next-line require-yield\n *[Symbol.iterator](): Generator<ResultType<T, never>, T, unknown> {\n return value\n },\n }\n return result\n}\n\n/**\n * Create an error Result.\n *\n * @param error - The error value\n * @returns A Result with ok: false\n *\n * @example\n * ```ts\n * err('something went wrong') // { ok: false, error: 'something went wrong' }\n * ```\n */\nexport const err = <E>(error: E): ResultType<never, E> => {\n const result: ResultType<never, E> = {\n ok: false,\n error,\n pipe: pipeMethod,\n [FxTypeId]: {\n _A: () => undefined as never,\n _E: () => error,\n _R: () => undefined as never,\n },\n *[Symbol.iterator](): Generator<ResultType<never, E>, never, unknown> {\n yield result\n throw new Error(\"Unreachable: Do should short-circuit on error\")\n },\n }\n return result\n}\n\n// ============================================================================\n// Type Guards\n// ============================================================================\n\n/**\n * Check if a Result is successful.\n *\n * @param result - The Result to check\n * @returns true if the Result is ok\n *\n * @example\n * ```ts\n * const result = ok(42)\n * if (isOk(result)) {\n * console.log(result.value) // TypeScript knows value exists\n * }\n * ```\n */\nexport const isOk = <T, E>(result: ResultType<T, E>): result is Extract<ResultType<T, E>, { ok: true }> => result.ok\n\n/**\n * Check if a Result is an error.\n *\n * @param result - The Result to check\n * @returns true if the Result is an error\n *\n * @example\n * ```ts\n * const result = err('oops')\n * if (isErr(result)) {\n * console.log(result.error) // TypeScript knows error exists\n * }\n * ```\n */\nexport const isErr = <T, E>(result: ResultType<T, E>): result is Extract<ResultType<T, E>, { ok: false }> => !result.ok\n\n// ============================================================================\n// Transformations (curried for pipe)\n// ============================================================================\n\n/**\n * Transform the success value of a Result.\n * If the Result is an error, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `map(result, fn)`\n * - Data-last: `pipe(result, map(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Result<U, E>\n * - Async fn: returns Promise<Result<U, E>>\n *\n * @param fn - Function to transform the success value\n * @returns A function that takes a Result and returns a new Result\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * map(ok(5), n => n * 2) // { ok: true, value: 10 }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * ok(5),\n * map(n => n * 2)\n * ) // { ok: true, value: 10 }\n *\n * // Async usage\n * await pipe(\n * ok(userId),\n * map(async id => await fetchName(id))\n * ) // Promise<Result<string, E>>\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: ResultMap = dual(2, (result: ResultType<unknown, unknown>, fn: (value: unknown) => unknown) => {\n if (!result.ok) return result as any\n const mapped = fn(result.value)\n if (mapped instanceof Promise) {\n return mapped.then(ok) as any\n }\n return ok(mapped) as any\n})\n/* oxlint-enable no-explicit-any, no-unsafe-return, no-unsafe-type-assertion */\n\n/**\n * Transform the error value of a Result.\n * If the Result is successful, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `mapErr(result, fn)`\n * - Data-last: `pipe(result, mapErr(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Result<T, F>\n * - Async fn: returns Promise<Result<T, F>>\n *\n * @param fn - Function to transform the error value\n * @returns A function that takes a Result and returns a new Result\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * mapErr(err({ code: 404 }), e => `Error: ${e.code}`)\n * // { ok: false, error: 'Error: 404' }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * err({ code: 404 }),\n * mapErr(e => `Error: ${e.code}`)\n * ) // { ok: false, error: 'Error: 404' }\n *\n * // Async usage\n * await pipe(\n * err(errorCode),\n * mapErr(async code => await translateError(code))\n * ) // Promise<Result<T, 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 mapErr: ResultMapErr = dual(2, (result: ResultType<unknown, unknown>, fn: (error: unknown) => unknown) => {\n if (result.ok) return result as any\n const mapped = fn(result.error)\n if (mapped instanceof Promise) {\n return mapped.then(err) as any\n }\n return err(mapped) as any\n})\n/* oxlint-enable no-explicit-any, no-unsafe-return, no-unsafe-type-assertion */\n\n/**\n * Chain operations that return Results.\n * If the Result is an error, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `flatMap(result, fn)`\n * - Data-last: `pipe(result, flatMap(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Result<U, E | E2>\n * - Async fn: returns Promise<Result<U, E | E2>>\n *\n * @param fn - Function that takes a value and returns a Result (or Promise<Result>)\n * @returns A function that takes a Result and returns a new Result\n *\n * @example\n * ```ts\n * const divide = (a: number, b: number) =>\n * b === 0 ? err('division by zero') : ok(a / b)\n *\n * // Data-first (direct call)\n * flatMap(ok(10), n => divide(n, 2)) // { ok: true, value: 5 }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * ok(10),\n * flatMap(n => divide(n, 2))\n * ) // { ok: true, value: 5 }\n *\n * // Async usage\n * await pipe(\n * ok(userId),\n * flatMap(async id => ok(await fetchUser(id)))\n * ) // Promise<Result<User, E>>\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: ResultFlatMap = dual(2, (result: ResultType<unknown, unknown>, fn: (value: unknown) => unknown) =>\n result.ok ? fn(result.value) : result,\n)\n\n/**\n * Perform a side effect on the success value without modifying the Result.\n * Useful for debugging, logging, or other side effects in a pipeline.\n * If the Result is an error, the function is not called.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `tap(result, fn)`\n * - Data-last: `pipe(result, tap(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Result<T, E>\n * - Async fn: returns Promise<Result<T, E>>\n *\n * @param fn - Function to call with the success value (return value is ignored)\n * @returns A function that takes a Result and returns the same Result\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * tap(ok(42), console.log) // logs 42, returns { ok: true, value: 42 }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * ok(42),\n * tap(console.log), // logs 42\n * map(n => n * 2)\n * ) // { ok: true, value: 84 }\n *\n * // Async usage\n * await pipe(\n * ok(42),\n * tap(async v => await logToServer(v)),\n * map(n => n * 2)\n * ) // Promise<Result<84, E>>\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: ResultTap = dual(2, (result: ResultType<unknown, unknown>, fn: (value: unknown) => unknown) => {\n if (!result.ok) return result as any\n const sideEffect = fn(result.value)\n if (sideEffect instanceof Promise) {\n return sideEffect.then(() => result) as any\n }\n return result as any\n})\n/* oxlint-enable no-explicit-any, no-unsafe-return, no-unsafe-type-assertion */\n\n/**\n * Recover from an error by providing an alternative Result.\n * If the Result is successful, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `orElse(result, fn)`\n * - Data-last: `pipe(result, orElse(fn))`\n *\n * Supports both sync and async functions:\n * - Sync fn: returns Result<T | U, E2>\n * - Async fn: returns Promise<Result<T | U, E2>>\n *\n * @param fn - Function that takes the error and returns an alternative Result\n * @returns A function that takes a Result and returns a new Result\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * orElse(err('cache miss'), () => ok(defaultValue))\n * // { ok: true, value: defaultValue }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * err('cache miss'),\n * orElse(() => ok(defaultValue))\n * ) // { ok: true, value: defaultValue }\n *\n * // Async recovery\n * await pipe(\n * err('cache miss'),\n * orElse(async () => ok(await fetchFromAPI()))\n * ) // Promise<Result<T, E2>>\n *\n * // Chain multiple fallbacks\n * pipe(\n * err('not found'),\n * orElse(() => tryCache()),\n * orElse(() => tryAPI()),\n * orElse(() => ok(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: ResultOrElse = dual(2, (result: ResultType<unknown, unknown>, fn: (error: unknown) => unknown) =>\n result.ok ? result : fn(result.error),\n)\n\n/**\n * Filter a successful Result based on a predicate.\n * If the predicate returns false, converts the success to an error.\n * If the Result is already an error, it passes through unchanged.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `filter(result, predicate, onFail)`\n * - Data-last: `pipe(result, filter(predicate, onFail))`\n *\n * @param predicate - Function that returns true to keep the value\n * @param onFail - Function that creates the error when predicate fails\n * @returns A function that takes a Result and returns a new Result\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * filter(ok(5), n => n > 10, n => `${n} is too small`)\n * // { ok: false, error: '5 is too small' }\n *\n * // Data-last (curried for pipe)\n * pipe(\n * ok(5),\n * filter(n => n > 10, n => `${n} is too small`)\n * ) // { ok: false, error: '5 is too small' }\n *\n * pipe(\n * ok(15),\n * filter(n => n > 10, n => `${n} is too small`)\n * ) // { ok: true, value: 15 }\n *\n * // With complex validation\n * pipe(\n * ok(user),\n * filter(u => u.age >= 18, u => ({ code: 'UNDERAGE', user: u }))\n * )\n * ```\n */\nexport const filter: ResultFilter = dual(\n 3,\n (\n result: ResultType<unknown, unknown>,\n predicate: (value: unknown) => boolean,\n onFail: (value: unknown) => unknown,\n ) => {\n if (!result.ok) return result\n return predicate(result.value) ? result : err(onFail(result.value))\n },\n)\n\n// ============================================================================\n// Combinators\n// ============================================================================\n\n/**\n * Combine multiple Results into a single Result.\n * Supports both array and object inputs.\n *\n * - If all Results are ok, returns ok with all values\n * - If any Result is an error, returns the first error (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 * Result.all([parseNumber(input), parseString(other)]),\n * Result.unwrapOr([0, ''])\n * )\n *\n * // Object form - returns Result<{ user: User, config: Config }, E>\n * pipe(\n * Result.all({ user: fetchUser(id), config: loadConfig() }),\n * Result.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: ResultAll = (results: any): any => {\n if (Array.isArray(results)) {\n const values: unknown[] = []\n for (const result of results) {\n if (!result.ok) return result\n values.push(result.value)\n }\n return ok(values)\n }\n\n const values: Record<string, unknown> = {}\n for (const [key, result] of Object.entries(results)) {\n const r = result as ResultType<unknown, unknown>\n if (!r.ok) return result\n values[key] = r.value\n }\n return ok(values)\n}\n/* oxlint-enable no-explicit-any, no-unsafe-return, no-unsafe-member-access, strict-boolean-expressions, no-unsafe-type-assertion, no-unsafe-argument */\n\n// ============================================================================\n// Extraction\n// ============================================================================\n\n/**\n * Get the success value or a default value.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `unwrapOr(result, defaultValue)`\n * - Data-last: `pipe(result, unwrapOr(defaultValue))`\n *\n * Uses NoInfer to prevent type inference from the default value.\n *\n * @param defaultValue - Value to return if the Result is an error\n * @returns A function that takes a Result and returns the value or default\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * unwrapOr(ok(42), 0) // 42\n * unwrapOr(err('oops'), 0) // 0\n *\n * // Data-last (curried for pipe)\n * pipe(ok(42), unwrapOr(0)) // 42\n * pipe(err('oops'), unwrapOr(0)) // 0\n * ```\n */\nexport const unwrapOr: ResultUnwrapOr = dual(\n 2,\n <T, E>(result: ResultType<T, E>, defaultValue: NoInfer<T>): T => (result.ok ? result.value : defaultValue),\n)\n\n/**\n * Get the success value or compute a value from the error.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `unwrapOrElse(result, fn)`\n * - Data-last: `pipe(result, unwrapOrElse(fn))`\n *\n * @param fn - Function to compute a value from the error\n * @returns A function that takes a Result and returns the value or computed value\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * unwrapOrElse(err({ code: 404 }), e => `Error ${e.code}`) // 'Error 404'\n *\n * // Data-last (curried for pipe)\n * pipe(\n * err({ code: 404 }),\n * unwrapOrElse(e => `Error ${e.code}`)\n * ) // 'Error 404'\n * ```\n */\nexport const unwrapOrElse: ResultUnwrapOrElse = dual(\n 2,\n <T, E>(result: ResultType<T, E>, fn: (error: E) => T): T => (result.ok ? result.value : fn(result.error)),\n)\n\n/**\n * Pattern match on a Result, handling both success and error cases.\n *\n * Supports both data-first and data-last calling styles:\n * - Data-first: `match(result, { ok: ..., err: ... })`\n * - Data-last: `pipe(result, match({ ok: ..., err: ... }))`\n *\n * @param handlers - Object with ok and err handlers\n * @returns A function that takes a Result and returns the handler result\n *\n * @example\n * ```ts\n * // Data-first (direct call)\n * match(ok(42), {\n * ok: n => `Got ${n}`,\n * err: e => `Error: ${e}`\n * }) // 'Got 42'\n *\n * // Data-last (curried for pipe)\n * pipe(\n * ok(42),\n * match({\n * ok: n => `Got ${n}`,\n * err: e => `Error: ${e}`\n * })\n * ) // 'Got 42'\n * ```\n */\nexport const match: ResultMatch = dual(\n 2,\n <T, E, U>(result: ResultType<T, E>, handlers: { ok: (value: T) => U; err: (error: E) => U }): U =>\n result.ok ? handlers.ok(result.value) : handlers.err(result.error),\n)\n\n// ============================================================================\n// Error Boundary\n// ============================================================================\n\n/**\n * Wrap a function that might throw into a Result.\n * Supports both sync and async functions with automatic type inference.\n *\n * - Sync fn: returns Result<T, Error>\n * - Async fn: returns Promise<Result<T, Error>>\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<Result<unknown, Error>> | Result<any, Error>` that won't work\n * with Result utilities like `isOk` or `isErr`.\n *\n * @param fn - Function that might throw (sync or async)\n * @returns A Result with the return value or the caught error\n *\n * @example\n * ```ts\n * // Sync usage\n * fromTry(() => JSON.parse('{\"valid\": true}'))\n * // { ok: true, value: { valid: true } }\n *\n * fromTry(() => JSON.parse('not json'))\n * // { ok: false, error: SyntaxError }\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<Result<Response, Error>>\n *\n * await fromTry(async () => {\n * throw new Error('network error')\n * })\n * // Promise<{ ok: false, error: Error }>\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\n .then(ok)\n .catch((e) => err(e instanceof Error ? e : new Error(String(e)))) as unknown as FromTryReturn<T>\n }\n return ok(result) as unknown as FromTryReturn<T>\n } catch (e) {\n return err(e instanceof Error ? e : new Error(String(e))) as unknown as FromTryReturn<T>\n }\n}\n/* oxlint-enable no-explicit-any, no-unsafe-type-assertion */\n\n// ============================================================================\n// Namespace\n// ============================================================================\n\n/**\n * Result namespace containing all utility functions for working with Result types.\n *\n * Result represents either success (ok) or failure (err). Use this for operations\n * that can fail with typed errors.\n *\n * @see {@link Option} for presence/absence semantics (no error information)\n * @see {@link Either} for two valid outcomes (not just success/failure)\n *\n * @example\n * ```ts\n * import { Result, pipe } from '@repo/std'\n * import type { Result as ResultType } from '@repo/std'\n *\n * const divide = (a: number, b: number): ResultType<number, string> =>\n * b === 0 ? Result.err('division by zero') : Result.ok(a / b)\n *\n * const result = pipe(\n * divide(10, 2),\n * Result.map(n => n * 2),\n * Result.unwrapOr(0)\n * )\n * ```\n */\nexport const Result = {\n ok,\n err,\n isOk,\n isErr,\n map,\n mapErr,\n flatMap,\n tap,\n orElse,\n filter,\n all,\n unwrapOr,\n unwrapOrElse,\n match,\n fromTry,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,MAAa,MAAS,UAAmC;AAevD,QAdqC;EACnC,IAAI;EACJ;EACA,MAAM;GACL,WAAW;GACV,UAAU;GACV,UAAU;GACV,UAAU;GACX;EAED,EAAE,OAAO,YAAyD;AAChE,UAAO;;EAEV;;;;;;;;;;;;;AAeH,MAAa,OAAU,UAAmC;CACxD,MAAM,SAA+B;EACnC,IAAI;EACJ;EACA,MAAM;GACL,WAAW;GACV,UAAU;GACV,UAAU;GACV,UAAU;GACX;EACD,EAAE,OAAO,YAA6D;AACpE,SAAM;AACN,SAAM,IAAI,MAAM,gDAAgD;;EAEnE;AACD,QAAO;;;;;;;;;;;;;;;;AAqBT,MAAa,QAAc,WAAgF,OAAO;;;;;;;;;;;;;;;AAgBlH,MAAa,SAAe,WAAiF,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCrH,MAAa,MAAiB,KAAK,IAAI,QAAsC,OAAoC;AAC/G,KAAI,CAAC,OAAO,GAAI,QAAO;CACvB,MAAM,SAAS,GAAG,OAAO,MAAM;AAC/B,KAAI,kBAAkB,QACpB,QAAO,OAAO,KAAK,GAAG;AAExB,QAAO,GAAG,OAAO;EACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCF,MAAa,SAAuB,KAAK,IAAI,QAAsC,OAAoC;AACrH,KAAI,OAAO,GAAI,QAAO;CACtB,MAAM,SAAS,GAAG,OAAO,MAAM;AAC/B,KAAI,kBAAkB,QACpB,QAAO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A+BnB,MAAa,WAA2B,KACtC,IACO,QAA0B,iBAAiC,OAAO,KAAK,OAAO,QAAQ,aAC9F;;;;;;;;;;;;;;;;;;;;;;;AAwBD,MAAa,eAAmC,KAC9C,IACO,QAA0B,OAA4B,OAAO,KAAK,OAAO,QAAQ,GAAG,OAAO,MAAM,CACzG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,MAAa,QAAqB,KAChC,IACU,QAA0B,aAClC,OAAO,KAAK,SAAS,GAAG,OAAO,MAAM,GAAG,SAAS,IAAI,OAAO,MAAM,CACrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CD,MAAa,WAAc,OAAkC;AAC3D,KAAI;EACF,MAAM,SAAS,IAAI;AACnB,MAAI,UAAU,OAAO,CACnB,QAAO,OACJ,KAAK,GAAG,CACR,OAAO,MAAM,IAAI,aAAa,QAAQ,IAAI,IAAI,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC;AAErE,SAAO,GAAG,OAAO;UACV,GAAG;AACV,SAAO,IAAI,aAAa,QAAQ,IAAI,IAAI,MAAM,OAAO,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiC7D,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"result.types-_W95221K.d.mts","names":[],"sources":["../src/result/result.types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;;AACQ,KADI,MACJ,CAAA,CAAA,EAAA,CAAA,CAAA,GAAA,CAAA;EAAN,SAAA,EAAA,EAAA,IAAA;EACA,SAAA,KAAA,EAF+D,CAE/D;CACwC,GAAA;EAAG,SAAA,EAAA,EAAA,KAAA;EAAV,SAAA,KAAA,EAH0E,CAG1E;CAAc,CAAA,GAF/C,EAE+C,CAF5C,CAE4C,EAFzC,CAEyC,CAAA,GAD/C,QAC+C,GAAA;EA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