@shirudo/result 1.1.0 → 1.2.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 (66) hide show
  1. package/README.md +90 -38
  2. package/dist/collections.cjs +181 -9
  3. package/dist/collections.cjs.map +1 -0
  4. package/dist/collections.d.cts +101 -3
  5. package/dist/collections.d.cts.map +1 -0
  6. package/dist/collections.d.mts +101 -3
  7. package/dist/collections.d.mts.map +1 -0
  8. package/dist/collections.mjs +175 -3
  9. package/dist/collections.mjs.map +1 -0
  10. package/dist/errors-CVgC7NII.cjs +278 -0
  11. package/dist/errors-CVgC7NII.cjs.map +1 -0
  12. package/dist/errors-MuakEcnM.mjs +146 -0
  13. package/dist/errors-MuakEcnM.mjs.map +1 -0
  14. package/dist/errors.cjs +22 -130
  15. package/dist/errors.d.cts +9 -9
  16. package/dist/errors.d.cts.map +1 -1
  17. package/dist/errors.d.mts +9 -9
  18. package/dist/errors.d.mts.map +1 -1
  19. package/dist/errors.mjs +2 -109
  20. package/dist/index.cjs +99 -69
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +87 -74
  23. package/dist/index.d.cts.map +1 -1
  24. package/dist/index.d.mts +87 -74
  25. package/dist/index.d.mts.map +1 -1
  26. package/dist/index.mjs +64 -34
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/operators.cjs +412 -31
  29. package/dist/operators.cjs.map +1 -0
  30. package/dist/operators.d.cts +211 -3
  31. package/dist/operators.d.cts.map +1 -0
  32. package/dist/operators.d.mts +211 -3
  33. package/dist/operators.d.mts.map +1 -0
  34. package/dist/operators.mjs +384 -3
  35. package/dist/operators.mjs.map +1 -0
  36. package/dist/{result-q9Na2bGa.mjs → result-DQCpkuOJ.mjs} +36 -17
  37. package/dist/result-DQCpkuOJ.mjs.map +1 -0
  38. package/dist/{result-BBOGxvSH.cjs → result-DoqQufvR.cjs} +36 -17
  39. package/dist/result-DoqQufvR.cjs.map +1 -0
  40. package/dist/{sequence-DDwePRLd.d.cts → sequence-CmugKPbu.d.cts} +105 -84
  41. package/dist/sequence-CmugKPbu.d.cts.map +1 -0
  42. package/dist/{sequence-DDwePRLd.d.mts → sequence-CmugKPbu.d.mts} +105 -84
  43. package/dist/sequence-CmugKPbu.d.mts.map +1 -0
  44. package/package.json +20 -12
  45. package/dist/errors.cjs.map +0 -1
  46. package/dist/errors.mjs.map +0 -1
  47. package/dist/flatten-B_XIkaOK.cjs +0 -208
  48. package/dist/flatten-B_XIkaOK.cjs.map +0 -1
  49. package/dist/flatten-C7D6Kttf.d.mts +0 -81
  50. package/dist/flatten-C7D6Kttf.d.mts.map +0 -1
  51. package/dist/flatten-ChTL5BfA.mjs +0 -167
  52. package/dist/flatten-ChTL5BfA.mjs.map +0 -1
  53. package/dist/flatten-D0K8UcQH.d.cts +0 -81
  54. package/dist/flatten-D0K8UcQH.d.cts.map +0 -1
  55. package/dist/result-BBOGxvSH.cjs.map +0 -1
  56. package/dist/result-q9Na2bGa.mjs.map +0 -1
  57. package/dist/sequence-DDwePRLd.d.cts.map +0 -1
  58. package/dist/sequence-DDwePRLd.d.mts.map +0 -1
  59. package/dist/swap-BnyMBdD_.cjs +0 -552
  60. package/dist/swap-BnyMBdD_.cjs.map +0 -1
  61. package/dist/swap-CFD2g1cB.mjs +0 -385
  62. package/dist/swap-CFD2g1cB.mjs.map +0 -1
  63. package/dist/swap-CrHQZIax.d.cts +0 -212
  64. package/dist/swap-CrHQZIax.d.cts.map +0 -1
  65. package/dist/swap-DT4LdRFV.d.mts +0 -212
  66. package/dist/swap-DT4LdRFV.d.mts.map +0 -1
@@ -1,34 +1,415 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_result = require('./result-BBOGxvSH.cjs');
3
- const require_swap = require('./swap-BnyMBdD_.cjs');
2
+ const require_result = require('./result-DoqQufvR.cjs');
3
+ const require_errors = require('./errors-CVgC7NII.cjs');
4
4
 
5
- exports.and = require_swap.and;
6
- exports.bimap = require_swap.bimap;
5
+ //#region src/core/map.ts
6
+ /**
7
+ * Transforms the value (Ok case).
8
+ * Corresponds to Rust `map`.
9
+ */
10
+ function map(project) {
11
+ return (source) => {
12
+ if (source.isOk()) return require_result.ok(project(source.value));
13
+ if (source.isErr()) return source;
14
+ throw new require_errors.InvalidResultStateError("map");
15
+ };
16
+ }
17
+
18
+ //#endregion
19
+ //#region src/core/mapErr.ts
20
+ /**
21
+ * Transforms the error (Err case).
22
+ * Corresponds to Rust `map_err`.
23
+ */
24
+ function mapErr(project) {
25
+ return (source) => {
26
+ if (source.isErr()) return require_result.err(project(source.error));
27
+ if (source.isOk()) return source;
28
+ throw new require_errors.InvalidResultStateError("mapErr");
29
+ };
30
+ }
31
+
32
+ //#endregion
33
+ //#region src/core/mapBoth.ts
34
+ /**
35
+ * Transforms both the Ok value and the Err error.
36
+ * Corresponds to FP `bimap` / `mapBoth`.
37
+ */
38
+ function mapBoth(mapOk, mapErr) {
39
+ return (source) => {
40
+ if (source.isOk()) return require_result.ok(mapOk(source.value));
41
+ if (source.isErr()) return require_result.err(mapErr(source.error));
42
+ throw new require_errors.InvalidResultStateError("mapBoth");
43
+ };
44
+ }
45
+ /**
46
+ * Alias for `mapBoth`.
47
+ */
48
+ const bimap = mapBoth;
49
+
50
+ //#endregion
51
+ //#region src/core/flatMap.ts
52
+ /**
53
+ * Chains another operation that returns a Result.
54
+ * Corresponds to Rust `and_then` or JS `flatMap`.
55
+ */
56
+ function flatMap(project) {
57
+ return (source) => {
58
+ if (source.isOk()) return project(source.value);
59
+ if (source.isErr()) return source;
60
+ throw new require_errors.InvalidResultStateError("flatMap");
61
+ };
62
+ }
63
+
64
+ //#endregion
65
+ //#region src/core/tap.ts
66
+ /**
67
+ * Executes a side effect (logging, debugging) without changing the Result.
68
+ * Corresponds to Rust `inspect` / `inspect_err`.
69
+ */
70
+ function tap(observer) {
71
+ return (source) => {
72
+ if (source.isOk()) {
73
+ if (observer.ok) observer.ok(source.value);
74
+ return source;
75
+ }
76
+ if (source.isErr()) {
77
+ if (observer.err) observer.err(source.error);
78
+ return source;
79
+ }
80
+ throw new require_errors.InvalidResultStateError("tap");
81
+ };
82
+ }
83
+
84
+ //#endregion
85
+ //#region src/core/filter.ts
86
+ /**
87
+ * Checks a condition. If false, the Result becomes Err.
88
+ * Corresponds to Rust `filter` (partially).
89
+ */
90
+ function filter(predicate, errorFn) {
91
+ return (source) => {
92
+ if (source.isOk()) {
93
+ if (predicate(source.value)) return source;
94
+ return require_result.err(errorFn());
95
+ }
96
+ if (source.isErr()) return source;
97
+ throw new require_errors.InvalidResultStateError("filter");
98
+ };
99
+ }
100
+
101
+ //#endregion
102
+ //#region src/core/fold.ts
103
+ /**
104
+ * Folds the Result into a single value by applying one of two functions.
105
+ * The end of the pipe.
106
+ *
107
+ * This is the pipe operator equivalent of the `.fold()` instance method.
108
+ */
109
+ function fold(handlers) {
110
+ return (source) => {
111
+ if (source.isOk()) return handlers.ok(source.value);
112
+ if (source.isErr()) return handlers.err(source.error);
113
+ throw new require_errors.InvalidResultStateError("fold");
114
+ };
115
+ }
116
+
117
+ //#endregion
118
+ //#region src/core/tryCatch.ts
119
+ function tryCatch(fn, errorMapper) {
120
+ return (source) => {
121
+ if (source.isErr()) return source;
122
+ try {
123
+ return require_result.ok(fn());
124
+ } catch (error) {
125
+ return require_result.err(errorMapper ? errorMapper(error) : error);
126
+ }
127
+ };
128
+ }
129
+
130
+ //#endregion
131
+ //#region src/core/tryMap.ts
132
+ function tryMap(project, errorMapper) {
133
+ return (source) => {
134
+ if (source.isErr()) return source;
135
+ if (!source.isOk()) throw new require_errors.InvalidResultStateError("tryMap");
136
+ try {
137
+ return require_result.ok(project(source.value));
138
+ } catch (error) {
139
+ return require_result.err(errorMapper ? errorMapper(error) : error);
140
+ }
141
+ };
142
+ }
143
+
144
+ //#endregion
145
+ //#region src/core/recover.ts
146
+ /**
147
+ * Recover: converts Err to Ok(defaultValue).
148
+ * Result is guaranteed to be Ok → Error type becomes `never`.
149
+ */
150
+ function recover(defaultValue) {
151
+ return (source) => {
152
+ if (source.isOk()) return source;
153
+ if (source.isErr()) return require_result.ok(defaultValue);
154
+ throw new require_errors.InvalidResultStateError("recover");
155
+ };
156
+ }
157
+ /**
158
+ * Like `recover`, but calculates the default value based on the error.
159
+ */
160
+ function recoverWith(fn) {
161
+ return (source) => {
162
+ if (source.isOk()) return source;
163
+ if (source.isErr()) return require_result.ok(fn(source.error));
164
+ throw new require_errors.InvalidResultStateError("recoverWith");
165
+ };
166
+ }
167
+
168
+ //#endregion
169
+ //#region src/core/match.ts
170
+ /**
171
+ * Resolves the Result. The end of the pipe.
172
+ * Corresponds to Rust `match`.
173
+ */
174
+ function match(handlers) {
175
+ return (source) => {
176
+ if (source.isOk()) return handlers.ok(source.value);
177
+ if (source.isErr()) return handlers.err(source.error);
178
+ throw new require_errors.InvalidResultStateError("match");
179
+ };
180
+ }
181
+
182
+ //#endregion
183
+ //#region src/core/mapAsync.ts
184
+ /**
185
+ * Async version of map.
186
+ */
187
+ function mapAsync(project) {
188
+ return async (source) => {
189
+ if (source.isOk()) return require_result.ok(await project(source.value));
190
+ if (source.isErr()) return source;
191
+ throw new require_errors.InvalidResultStateError("mapAsync");
192
+ };
193
+ }
194
+
195
+ //#endregion
196
+ //#region src/core/mapErrAsync.ts
197
+ /**
198
+ * Async version of mapErr.
199
+ */
200
+ function mapErrAsync(project) {
201
+ return async (source) => {
202
+ if (source.isErr()) return require_result.err(await project(source.error));
203
+ if (source.isOk()) return source;
204
+ throw new require_errors.InvalidResultStateError("mapErrAsync");
205
+ };
206
+ }
207
+
208
+ //#endregion
209
+ //#region src/core/flatMapAsync.ts
210
+ /**
211
+ * Async version of flatMap.
212
+ */
213
+ function flatMapAsync(project) {
214
+ return async (source) => {
215
+ if (source.isOk()) return await project(source.value);
216
+ if (source.isErr()) return source;
217
+ throw new require_errors.InvalidResultStateError("flatMapAsync");
218
+ };
219
+ }
220
+
221
+ //#endregion
222
+ //#region src/core/tapAsync.ts
223
+ /**
224
+ * Async version of tap.
225
+ */
226
+ function tapAsync(observer) {
227
+ return async (source) => {
228
+ if (source.isOk()) {
229
+ if (observer.ok) await observer.ok(source.value);
230
+ return source;
231
+ }
232
+ if (source.isErr()) {
233
+ if (observer.err) await observer.err(source.error);
234
+ return source;
235
+ }
236
+ throw new require_errors.InvalidResultStateError("tapAsync");
237
+ };
238
+ }
239
+
240
+ //#endregion
241
+ //#region src/core/filterAsync.ts
242
+ /**
243
+ * Async version of filter.
244
+ */
245
+ function filterAsync(predicate, errorFn) {
246
+ return async (source) => {
247
+ if (source.isOk()) {
248
+ if (await predicate(source.value)) return source;
249
+ return require_result.err(await errorFn());
250
+ }
251
+ if (source.isErr()) return source;
252
+ throw new require_errors.InvalidResultStateError("filterAsync");
253
+ };
254
+ }
255
+
256
+ //#endregion
257
+ //#region src/core/foldAsync.ts
258
+ /**
259
+ * Async version of `fold`. Folds the Result into a single value asynchronously.
260
+ * The end of the pipe.
261
+ *
262
+ * This is the async pipe operator equivalent of the `.fold()` instance method.
263
+ */
264
+ function foldAsync(handlers) {
265
+ return async (source) => {
266
+ if (source.isOk()) return await handlers.ok(source.value);
267
+ if (source.isErr()) return await handlers.err(source.error);
268
+ throw new require_errors.InvalidResultStateError("foldAsync");
269
+ };
270
+ }
271
+
272
+ //#endregion
273
+ //#region src/core/tryCatchAsync.ts
274
+ function tryCatchAsync(fn, errorMapper) {
275
+ return async (source) => {
276
+ if (source.isErr()) return source;
277
+ try {
278
+ return require_result.ok(await fn());
279
+ } catch (error) {
280
+ return require_result.err(errorMapper ? errorMapper(error) : error);
281
+ }
282
+ };
283
+ }
284
+
285
+ //#endregion
286
+ //#region src/core/tryMapAsync.ts
287
+ function tryMapAsync(project, errorMapper) {
288
+ return async (source) => {
289
+ if (source.isErr()) return source;
290
+ if (!source.isOk()) throw new require_errors.InvalidResultStateError("tryMapAsync");
291
+ try {
292
+ return require_result.ok(await project(source.value));
293
+ } catch (error) {
294
+ return require_result.err(errorMapper ? errorMapper(error) : error);
295
+ }
296
+ };
297
+ }
298
+
299
+ //#endregion
300
+ //#region src/core/matchAsync.ts
301
+ /**
302
+ * Async version of match.
303
+ */
304
+ function matchAsync(handlers) {
305
+ return async (source) => {
306
+ if (source.isOk()) return await handlers.ok(source.value);
307
+ if (source.isErr()) return await handlers.err(source.error);
308
+ throw new require_errors.InvalidResultStateError("matchAsync");
309
+ };
310
+ }
311
+
312
+ //#endregion
313
+ //#region src/core/and.ts
314
+ /**
315
+ * Combines two Results. Returns the second one only if the first is Ok.
316
+ * Corresponds to Rust `and`.
317
+ */
318
+ function and(result, other) {
319
+ if (result.isOk()) return other;
320
+ if (result.isErr()) return result;
321
+ throw new require_errors.InvalidResultStateError("and");
322
+ }
323
+
324
+ //#endregion
325
+ //#region src/core/or.ts
326
+ /**
327
+ * Fallback to another Result if the first is Err.
328
+ * Corresponds to Rust `or`.
329
+ */
330
+ function or(result, other) {
331
+ if (result.isOk()) return result;
332
+ if (result.isErr()) return other;
333
+ throw new require_errors.InvalidResultStateError("or");
334
+ }
335
+
336
+ //#endregion
337
+ //#region src/core/orElse.ts
338
+ /**
339
+ * Fallback with a function that returns a Result.
340
+ * Corresponds to Rust `or_else`.
341
+ */
342
+ function orElse(result, fn) {
343
+ if (result.isOk()) return result;
344
+ if (result.isErr()) return fn(result.error);
345
+ throw new require_errors.InvalidResultStateError("orElse");
346
+ }
347
+
348
+ //#endregion
349
+ //#region src/core/mapOr.ts
350
+ /**
351
+ * Transforms the value or returns a default value.
352
+ * Corresponds to Rust `map_or`.
353
+ */
354
+ function mapOr(result, defaultValue, fn) {
355
+ if (result.isOk()) return fn(result.value);
356
+ if (result.isErr()) return defaultValue;
357
+ throw new require_errors.InvalidResultStateError("mapOr");
358
+ }
359
+
360
+ //#endregion
361
+ //#region src/core/mapOrElse.ts
362
+ /**
363
+ * Transforms the value or calculates a default value using a function.
364
+ * Corresponds to Rust `map_or_else`.
365
+ */
366
+ function mapOrElse(result, defaultFn, fn) {
367
+ if (result.isOk()) return fn(result.value);
368
+ if (result.isErr()) return defaultFn(result.error);
369
+ throw new require_errors.InvalidResultStateError("mapOrElse");
370
+ }
371
+
372
+ //#endregion
373
+ //#region src/core/swap.ts
374
+ /**
375
+ * Swaps Ok and Err.
376
+ * Result<T, E> → Result<E, T>
377
+ */
378
+ function swap(result) {
379
+ if (result.isOk()) return require_result.err(result.value);
380
+ if (result.isErr()) return require_result.ok(result.error);
381
+ throw new require_errors.InvalidResultStateError("swap");
382
+ }
383
+
384
+ //#endregion
385
+ exports.and = and;
386
+ exports.bimap = bimap;
7
387
  exports.combine = require_result.combine;
8
- exports.filter = require_swap.filter;
9
- exports.filterAsync = require_swap.filterAsync;
10
- exports.flatMap = require_swap.flatMap;
11
- exports.flatMapAsync = require_swap.flatMapAsync;
12
- exports.fold = require_swap.fold;
13
- exports.foldAsync = require_swap.foldAsync;
14
- exports.map = require_swap.map;
15
- exports.mapAsync = require_swap.mapAsync;
16
- exports.mapBoth = require_swap.mapBoth;
17
- exports.mapErr = require_swap.mapErr;
18
- exports.mapErrAsync = require_swap.mapErrAsync;
19
- exports.mapOr = require_swap.mapOr;
20
- exports.mapOrElse = require_swap.mapOrElse;
21
- exports.match = require_swap.match;
22
- exports.matchAsync = require_swap.matchAsync;
23
- exports.or = require_swap.or;
24
- exports.orElse = require_swap.orElse;
25
- exports.recover = require_swap.recover;
26
- exports.recoverWith = require_swap.recoverWith;
27
- exports.swap = require_swap.swap;
28
- exports.tap = require_swap.tap;
29
- exports.tapAsync = require_swap.tapAsync;
30
- exports.tryCatch = require_swap.tryCatch;
31
- exports.tryCatchAsync = require_swap.tryCatchAsync;
32
- exports.tryMap = require_swap.tryMap;
33
- exports.tryMapAsync = require_swap.tryMapAsync;
34
- exports.zip = require_result.zip;
388
+ exports.filter = filter;
389
+ exports.filterAsync = filterAsync;
390
+ exports.flatMap = flatMap;
391
+ exports.flatMapAsync = flatMapAsync;
392
+ exports.fold = fold;
393
+ exports.foldAsync = foldAsync;
394
+ exports.map = map;
395
+ exports.mapAsync = mapAsync;
396
+ exports.mapBoth = mapBoth;
397
+ exports.mapErr = mapErr;
398
+ exports.mapErrAsync = mapErrAsync;
399
+ exports.mapOr = mapOr;
400
+ exports.mapOrElse = mapOrElse;
401
+ exports.match = match;
402
+ exports.matchAsync = matchAsync;
403
+ exports.or = or;
404
+ exports.orElse = orElse;
405
+ exports.recover = recover;
406
+ exports.recoverWith = recoverWith;
407
+ exports.swap = swap;
408
+ exports.tap = tap;
409
+ exports.tapAsync = tapAsync;
410
+ exports.tryCatch = tryCatch;
411
+ exports.tryCatchAsync = tryCatchAsync;
412
+ exports.tryMap = tryMap;
413
+ exports.tryMapAsync = tryMapAsync;
414
+ exports.zip = require_result.zip;
415
+ //# sourceMappingURL=operators.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operators.cjs","names":["ok","InvalidResultStateError","err","InvalidResultStateError","ok","err","InvalidResultStateError","InvalidResultStateError","InvalidResultStateError","err","InvalidResultStateError","InvalidResultStateError","ok","err","InvalidResultStateError","ok","err","ok","InvalidResultStateError","InvalidResultStateError","ok","InvalidResultStateError","err","InvalidResultStateError","InvalidResultStateError","InvalidResultStateError","err","InvalidResultStateError","InvalidResultStateError","ok","err","InvalidResultStateError","ok","err","InvalidResultStateError","InvalidResultStateError","InvalidResultStateError","InvalidResultStateError","InvalidResultStateError","InvalidResultStateError","err","ok","InvalidResultStateError"],"sources":["../src/core/map.ts","../src/core/mapErr.ts","../src/core/mapBoth.ts","../src/core/flatMap.ts","../src/core/tap.ts","../src/core/filter.ts","../src/core/fold.ts","../src/core/tryCatch.ts","../src/core/tryMap.ts","../src/core/recover.ts","../src/core/match.ts","../src/core/mapAsync.ts","../src/core/mapErrAsync.ts","../src/core/flatMapAsync.ts","../src/core/tapAsync.ts","../src/core/filterAsync.ts","../src/core/foldAsync.ts","../src/core/tryCatchAsync.ts","../src/core/tryMapAsync.ts","../src/core/matchAsync.ts","../src/core/and.ts","../src/core/or.ts","../src/core/orElse.ts","../src/core/mapOr.ts","../src/core/mapOrElse.ts","../src/core/swap.ts"],"sourcesContent":["import type { Result } from './result';\nimport { ok } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Transforms the value (Ok case).\n * Corresponds to Rust `map`.\n */\nexport function map<T, E, U>(project: (value: T) => U) {\n return (source: Result<T, E>): Result<U, E> => {\n if (source.isOk()) {\n return ok(project(source.value));\n }\n if (source.isErr()) return source as unknown as Result<U, E>;\n throw new InvalidResultStateError('map');\n };\n}\n","import type { Result } from './result';\nimport { err } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Transforms the error (Err case).\n * Corresponds to Rust `map_err`.\n */\nexport function mapErr<T, E, F>(project: (error: E) => F) {\n return (source: Result<T, E>): Result<T, F> => {\n if (source.isErr()) {\n return err(project(source.error));\n }\n if (source.isOk()) return source as unknown as Result<T, F>;\n throw new InvalidResultStateError('mapErr');\n };\n}\n","import type { Result } from './result';\nimport { err, ok } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Transforms both the Ok value and the Err error.\n * Corresponds to FP `bimap` / `mapBoth`.\n */\nexport function mapBoth<T, E, U, F>(mapOk: (value: T) => U, mapErr: (error: E) => F) {\n return (source: Result<T, E>): Result<U, F> => {\n if (source.isOk()) {\n return ok<U, F>(mapOk(source.value));\n }\n if (source.isErr()) {\n return err<F, U>(mapErr(source.error));\n }\n throw new InvalidResultStateError('mapBoth');\n };\n}\n\n/**\n * Alias for `mapBoth`.\n */\nexport const bimap: typeof mapBoth = mapBoth;\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Chains another operation that returns a Result.\n * Corresponds to Rust `and_then` or JS `flatMap`.\n */\nexport function flatMap<T, E, U, F>(project: (value: T) => Result<U, F>) {\n return (source: Result<T, E>): Result<U, E | F> => {\n if (source.isOk()) {\n return project(source.value);\n }\n if (source.isErr()) return source as unknown as Result<U, E | F>;\n throw new InvalidResultStateError('flatMap');\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Executes a side effect (logging, debugging) without changing the Result.\n * Corresponds to Rust `inspect` / `inspect_err`.\n */\nexport function tap<T, E>(observer: { ok?: (val: T) => void; err?: (e: E) => void }) {\n return (source: Result<T, E>): Result<T, E> => {\n if (source.isOk()) {\n if (observer.ok) observer.ok(source.value);\n return source;\n }\n if (source.isErr()) {\n if (observer.err) observer.err(source.error);\n return source;\n }\n throw new InvalidResultStateError('tap');\n };\n}\n","import type { Result } from './result';\nimport { err } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Checks a condition. If false, the Result becomes Err.\n * Corresponds to Rust `filter` (partially).\n */\nexport function filter<T, E>(predicate: (val: T) => boolean, errorFn: () => E) {\n return (source: Result<T, E>): Result<T, E> => {\n if (source.isOk()) {\n if (predicate(source.value)) {\n return source;\n }\n return err(errorFn());\n }\n if (source.isErr()) return source;\n throw new InvalidResultStateError('filter');\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Folds the Result into a single value by applying one of two functions.\n * The end of the pipe.\n *\n * This is the pipe operator equivalent of the `.fold()` instance method.\n */\nexport function fold<T, E, R>(handlers: { ok: (val: T) => R; err: (e: E) => R }) {\n return (source: Result<T, E>): R => {\n if (source.isOk()) {\n return handlers.ok(source.value);\n }\n if (source.isErr()) return handlers.err(source.error);\n throw new InvalidResultStateError('fold');\n };\n}\n","import type { Result } from './result';\nimport { ok, err } from './result';\n\n/**\n * Executes a function and catches exceptions.\n * Converts exceptions into Result<E>.\n * Corresponds to Rust `Result::from` for fallible operations.\n */\nexport function tryCatch<T>(fn: () => T): <SE>(source: Result<unknown, SE>) => Result<T, unknown>;\nexport function tryCatch<T, E>(\n fn: () => T,\n errorMapper: (error: unknown) => E\n): <SE>(source: Result<unknown, SE>) => Result<T, SE | E>;\nexport function tryCatch<T, E>(\n fn: () => T,\n errorMapper?: (error: unknown) => E\n): <SE>(source: Result<unknown, SE>) => Result<T, SE | E> {\n return <SE>(source: Result<unknown, SE>): Result<T, SE | E> => {\n if (source.isErr()) return source as unknown as Result<T, SE | E>;\n\n try {\n return ok<T, SE | E>(fn());\n } catch (error) {\n return err<SE | E, T>(errorMapper ? errorMapper(error) : error as E);\n }\n };\n}\n","import type { Result } from './result';\nimport { ok, err } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Like `map`, but catches exceptions and converts them to Err.\n */\nexport function tryMap<T, E, U>(project: (value: T) => U): (source: Result<T, E>) => Result<U, unknown>;\nexport function tryMap<T, E, U, F>(\n project: (value: T) => U,\n errorMapper: (error: unknown) => F\n): (source: Result<T, E>) => Result<U, E | F>;\nexport function tryMap<T, E, U, F>(\n project: (value: T) => U,\n errorMapper?: (error: unknown) => F\n): (source: Result<T, E>) => Result<U, E | F> {\n return (source: Result<T, E>): Result<U, E | F> => {\n if (source.isErr()) {\n return source as unknown as Result<U, E | F>;\n }\n if (!source.isOk()) throw new InvalidResultStateError('tryMap');\n\n try {\n return ok<U, E | F>(project(source.value));\n } catch (error) {\n return err<E | F, U>(errorMapper ? errorMapper(error) : error as F);\n }\n };\n}\n","import type { Result } from './result';\nimport { ok } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Recover: converts Err to Ok(defaultValue).\n * Result is guaranteed to be Ok → Error type becomes `never`.\n */\nexport function recover<T, E, F>(defaultValue: F) {\n return (source: Result<T, E>): Result<T | F, never> => {\n if (source.isOk()) return source as unknown as Result<T | F, never>;\n if (source.isErr()) return ok(defaultValue);\n throw new InvalidResultStateError('recover');\n };\n}\n\n/**\n * Like `recover`, but calculates the default value based on the error.\n */\nexport function recoverWith<T, E, F>(fn: (error: E) => F) {\n return (source: Result<T, E>): Result<T | F, never> => {\n if (source.isOk()) return source as unknown as Result<T | F, never>;\n if (source.isErr()) return ok(fn(source.error));\n throw new InvalidResultStateError('recoverWith');\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Resolves the Result. The end of the pipe.\n * Corresponds to Rust `match`.\n */\nexport function match<T, E, R>(handlers: { ok: (val: T) => R; err: (e: E) => R }) {\n return (source: Result<T, E>): R => {\n if (source.isOk()) {\n return handlers.ok(source.value);\n }\n if (source.isErr()) return handlers.err(source.error);\n throw new InvalidResultStateError('match');\n };\n}\n","import type { Result } from './result';\nimport { ok } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of map.\n */\nexport function mapAsync<T, E, U>(project: (value: T) => Promise<U>) {\n return async (source: Result<T, E>): Promise<Result<U, E>> => {\n if (source.isOk()) {\n return ok(await project(source.value));\n }\n if (source.isErr()) return source as unknown as Result<U, E>;\n throw new InvalidResultStateError('mapAsync');\n };\n}\n","import type { Result } from './result';\nimport { err } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of mapErr.\n */\nexport function mapErrAsync<T, E, F>(project: (error: E) => Promise<F>) {\n return async (source: Result<T, E>): Promise<Result<T, F>> => {\n if (source.isErr()) {\n return err(await project(source.error));\n }\n if (source.isOk()) return source as unknown as Result<T, F>;\n throw new InvalidResultStateError('mapErrAsync');\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of flatMap.\n */\nexport function flatMapAsync<T, E, U, F>(project: (value: T) => Promise<Result<U, F>>) {\n return async (source: Result<T, E>): Promise<Result<U, E | F>> => {\n if (source.isOk()) {\n return await project(source.value);\n }\n if (source.isErr()) return source as unknown as Result<U, E | F>;\n throw new InvalidResultStateError('flatMapAsync');\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of tap.\n */\nexport function tapAsync<T, E>(observer: { ok?: (val: T) => Promise<void>; err?: (e: E) => Promise<void> }) {\n return async (source: Result<T, E>): Promise<Result<T, E>> => {\n if (source.isOk()) {\n if (observer.ok) await observer.ok(source.value);\n return source;\n }\n if (source.isErr()) {\n if (observer.err) await observer.err(source.error);\n return source;\n }\n throw new InvalidResultStateError('tapAsync');\n };\n}\n","import type { Result } from './result';\nimport { err } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of filter.\n */\nexport function filterAsync<T, E>(predicate: (val: T) => Promise<boolean>, errorFn: () => Promise<E>) {\n return async (source: Result<T, E>): Promise<Result<T, E>> => {\n if (source.isOk()) {\n if (await predicate(source.value)) {\n return source;\n }\n return err(await errorFn());\n }\n if (source.isErr()) return source;\n throw new InvalidResultStateError('filterAsync');\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of `fold`. Folds the Result into a single value asynchronously.\n * The end of the pipe.\n *\n * This is the async pipe operator equivalent of the `.fold()` instance method.\n */\nexport function foldAsync<T, E, R>(handlers: { ok: (val: T) => Promise<R>; err: (e: E) => Promise<R> }) {\n return async (source: Result<T, E>): Promise<R> => {\n if (source.isOk()) {\n return await handlers.ok(source.value);\n }\n if (source.isErr()) return await handlers.err(source.error);\n throw new InvalidResultStateError('foldAsync');\n };\n}\n","import type { Result } from './result';\nimport { ok, err } from './result';\n\n/**\n * Async version of tryCatch.\n */\nexport function tryCatchAsync<T>(fn: () => Promise<T>): <SE>(source: Result<unknown, SE>) => Promise<Result<T, unknown>>;\nexport function tryCatchAsync<T, E>(\n fn: () => Promise<T>,\n errorMapper: (error: unknown) => E\n): <SE>(source: Result<unknown, SE>) => Promise<Result<T, SE | E>>;\nexport function tryCatchAsync<T, E>(\n fn: () => Promise<T>,\n errorMapper?: (error: unknown) => E\n): <SE>(source: Result<unknown, SE>) => Promise<Result<T, SE | E>> {\n return async <SE>(source: Result<unknown, SE>): Promise<Result<T, SE | E>> => {\n if (source.isErr()) return source as unknown as Result<T, SE | E>;\n\n try {\n return ok<T, SE | E>(await fn());\n } catch (error) {\n return err<SE | E, T>(errorMapper ? errorMapper(error) : error as E);\n }\n };\n}\n","import type { Result } from './result';\nimport { ok, err } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of tryMap.\n */\nexport function tryMapAsync<T, E, U>(project: (value: T) => Promise<U>): (source: Result<T, E>) => Promise<Result<U, unknown>>;\nexport function tryMapAsync<T, E, U, F>(\n project: (value: T) => Promise<U>,\n errorMapper: (error: unknown) => F\n): (source: Result<T, E>) => Promise<Result<U, E | F>>;\nexport function tryMapAsync<T, E, U, F>(\n project: (value: T) => Promise<U>,\n errorMapper?: (error: unknown) => F\n): (source: Result<T, E>) => Promise<Result<U, E | F>> {\n return async (source: Result<T, E>): Promise<Result<U, E | F>> => {\n if (source.isErr()) {\n return source as unknown as Result<U, E | F>;\n }\n if (!source.isOk()) throw new InvalidResultStateError('tryMapAsync');\n\n try {\n return ok<U, E | F>(await project(source.value));\n } catch (error) {\n return err<E | F, U>(errorMapper ? errorMapper(error) : error as F);\n }\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Async version of match.\n */\nexport function matchAsync<T, E, R>(handlers: { ok: (val: T) => Promise<R>; err: (e: E) => Promise<R> }) {\n return async (source: Result<T, E>): Promise<R> => {\n if (source.isOk()) {\n return await handlers.ok(source.value);\n }\n if (source.isErr()) return await handlers.err(source.error);\n throw new InvalidResultStateError('matchAsync');\n };\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Combines two Results. Returns the second one only if the first is Ok.\n * Corresponds to Rust `and`.\n */\nexport function and<T, E, U>(result: Result<T, E>, other: Result<U, E>): Result<U, E> {\n if (result.isOk()) return other;\n if (result.isErr()) return result as unknown as Result<U, E>;\n throw new InvalidResultStateError('and');\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Fallback to another Result if the first is Err.\n * Corresponds to Rust `or`.\n */\nexport function or<T, E, F>(result: Result<T, E>, other: Result<T, F>): Result<T, F> {\n if (result.isOk()) return result as unknown as Result<T, F>;\n if (result.isErr()) return other;\n throw new InvalidResultStateError('or');\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Fallback with a function that returns a Result.\n * Corresponds to Rust `or_else`.\n */\nexport function orElse<T, E, F>(result: Result<T, E>, fn: (error: E) => Result<T, F>): Result<T, F> {\n if (result.isOk()) return result as unknown as Result<T, F>;\n if (result.isErr()) return fn(result.error);\n throw new InvalidResultStateError('orElse');\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Transforms the value or returns a default value.\n * Corresponds to Rust `map_or`.\n */\nexport function mapOr<T, E, U>(result: Result<T, E>, defaultValue: U, fn: (value: T) => U): U {\n if (result.isOk()) return fn(result.value);\n if (result.isErr()) return defaultValue;\n throw new InvalidResultStateError('mapOr');\n}\n","import type { Result } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Transforms the value or calculates a default value using a function.\n * Corresponds to Rust `map_or_else`.\n */\nexport function mapOrElse<T, E, U>(result: Result<T, E>, defaultFn: (error: E) => U, fn: (value: T) => U): U {\n if (result.isOk()) return fn(result.value);\n if (result.isErr()) return defaultFn(result.error);\n throw new InvalidResultStateError('mapOrElse');\n}\n","import type { Result } from './result';\nimport { err, ok } from './result';\nimport { InvalidResultStateError } from '../errors';\n\n/**\n * Swaps Ok and Err.\n * Result<T, E> → Result<E, T>\n */\nexport function swap<T, E>(result: Result<T, E>): Result<E, T> {\n if (result.isOk()) {\n return err<T, E>(result.value);\n }\n if (result.isErr()) {\n return ok<E, T>(result.error);\n }\n throw new InvalidResultStateError('swap');\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,IAAa,SAA0B;CACnD,QAAQ,WAAuC;EAC3C,IAAI,OAAO,KAAK,GACZ,OAAOA,kBAAG,QAAQ,OAAO,KAAK,CAAC;EAEnC,IAAI,OAAO,MAAM,GAAG,OAAO;EAC3B,MAAM,IAAIC,uCAAwB,KAAK;CAC3C;AACJ;;;;;;;;ACRA,SAAgB,OAAgB,SAA0B;CACtD,QAAQ,WAAuC;EAC3C,IAAI,OAAO,MAAM,GACb,OAAOC,mBAAI,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