unthrown 3.1.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +221 -51
- package/dist/index.d.cts +336 -71
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +336 -71
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +219 -52
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/constructors.ts","../src/core.ts","../src/do.ts","../src/defect.ts","../src/interop.ts","../src/facade.ts","../src/tagged.ts"],"mappings":";;AAQA;;;;;KAAY,QAAA,oBAA4B,CAAA,GAAI,CAAA,CAAE,CAAA;;;;;;;AAAC;AAU/C;KAAY,KAAA,2BAAgC,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,qBAAsB,CAAA,GAAI,CAAA;;;;;;;;;;;;;;;;;KAkB3E,WAAA,OAAkB,CAAA,WAAY,WAAW;;AAlBmC;AAkBxF;;;;;;;;AAAqD;AAoBrD;;;;;KAAY,aAAA;EAYkB;;;;;;;;;;;EAA5B,GAAA,IAAO,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,CAAA,GAAI,WAAA,CAAY,CAAA,IAAK,QAAA,CAAO,CAAA,EAAG,CAAA;EAqBrC;;;;;;;;;;EAVlB,OAAA,QAAe,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,QAAA,CAAO,CAAA,EAAG,EAAA,IAAM,QAAA,CAAO,CAAA,EAAG,CAAA,GAAI,EAAA;EA2BD;;;;;;;;;EAjB7D,GAAA,IAAO,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,CAAA,GAAI,WAAA,CAAY,CAAA,IAAK,QAAA,CAAO,CAAA,EAAG,CAAA;EAwCjC;;;;;;;;;;;;;;;;EAvBtB,OAAA,KAAY,CAAA,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AA,CAAoB,GAAA,EAAK,CAAA;AAAA;;;;;APnB0D;AAkBxF;;;;;;;;AAAqD;AAoBrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBO6BgB,WAAA,qBACd,GAAA,EAAK,GAAA,EACL,OAAA;EAAA,SAAqB,IAAA;AAAA,IACpB,sBAAA,CAAuB,GAAA;;;;;;;;;;;;KA8Bd,WAAA;EAA2B,IAAA;AAAA;EACrC,EAAA,GAAK,KAAA,EAAO,CAAA,KAAM,CAAA;EAClB,MAAA,GAAS,KAAA,cAAmB,CAAA;AAAA,YAClB,CAAA,YAAa,KAAA,EAAO,OAAA,CAAQ,CAAA;EAAK,IAAA,EAAM,CAAA;AAAA,OAAS,CAAA;;;;;;;;KASvD,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2CW,SAAA;EAAyB,IAAA;AAAA,MACvC,MAAA,EAAQ,QAAA,CAAO,CAAA,EAAG,CAAA,GAClB,QAAA,EAAU,WAAA,CAAY,CAAA,EAAG,CAAA,EAAG,CAAA,MACxB,OAAA,CAAQ,CAAA,wDAAyD,gBAAA,IACpE,CAAA;AAAA,iBACa,SAAA;EAAyB,IAAA;AAAA,MACvC,MAAA,EAAQ,aAAA,CAAY,CAAA,EAAG,CAAA,GACvB,QAAA,EAAU,WAAA,CAAY,CAAA,EAAG,CAAA,EAAG,CAAA,MACxB,OAAA,CAAQ,CAAA,wDAAyD,gBAAA,IACpE,OAAA,CAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/constructors.ts","../src/core.ts","../src/do.ts","../src/defect.ts","../src/interop.ts","../src/facade.ts","../src/tagged.ts"],"mappings":";;AAQA;;;;;KAAY,QAAA,oBAA4B,CAAA,GAAI,CAAA,CAAE,CAAA;;;;;;;AAAC;AAU/C;KAAY,KAAA,2BAAgC,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,qBAAsB,CAAA,GAAI,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*modeled* result — `
|
|
3
|
+
* Thrown by a {@link Result}'s `get` / `getErr` when the assertion is
|
|
4
|
+
* wrong on a *modeled* result — `get()` on an `Err`, or `getErr()` on an
|
|
5
5
|
* `Ok`.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
@@ -13,14 +13,19 @@
|
|
|
13
13
|
* A `Defect` is never wrapped in an `UnwrapError`: its original cause is
|
|
14
14
|
* re-thrown (with its original stack) instead.
|
|
15
15
|
*
|
|
16
|
+
* `get()` and `getErr()` are type-gated (`this: Result<T, never>` /
|
|
17
|
+
* `Result<never, E>`), so the wrong-variant branch that throws this is
|
|
18
|
+
* unreachable through well-typed code — it remains only as a defensive guard
|
|
19
|
+
* against unsound runtime misuse (e.g. an `as` cast past the gate).
|
|
20
|
+
*
|
|
16
21
|
* @typeParam E - the type of the {@link UnwrapError.error} it carries.
|
|
17
22
|
*
|
|
18
23
|
* @category Errors
|
|
19
24
|
*/
|
|
20
25
|
var UnwrapError = class extends Error {
|
|
21
26
|
/**
|
|
22
|
-
* The offending value: the `Err` error for `
|
|
23
|
-
* `
|
|
27
|
+
* The offending value: the `Err` error for `get()`, or the `Ok` value for
|
|
28
|
+
* `getErr()`.
|
|
24
29
|
*/
|
|
25
30
|
error;
|
|
26
31
|
constructor(error) {
|
|
@@ -108,7 +113,7 @@ var Res = class {
|
|
|
108
113
|
return defectRes(cause);
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
|
-
|
|
116
|
+
flatMapErr(f) {
|
|
112
117
|
if (this.tag !== "Err") return passThrough(this);
|
|
113
118
|
try {
|
|
114
119
|
return f(this.error);
|
|
@@ -116,7 +121,11 @@ var Res = class {
|
|
|
116
121
|
return defectRes(cause);
|
|
117
122
|
}
|
|
118
123
|
}
|
|
119
|
-
|
|
124
|
+
/** @deprecated Use {@link Res.flatMapErr}. */
|
|
125
|
+
orElse(f) {
|
|
126
|
+
return this.flatMapErr(f);
|
|
127
|
+
}
|
|
128
|
+
recoverErr(f) {
|
|
120
129
|
if (this.tag !== "Err") return passThrough(this);
|
|
121
130
|
try {
|
|
122
131
|
return okRes(f(this.error));
|
|
@@ -124,6 +133,10 @@ var Res = class {
|
|
|
124
133
|
return defectRes(cause);
|
|
125
134
|
}
|
|
126
135
|
}
|
|
136
|
+
/** @deprecated Use {@link Res.recoverErr}. */
|
|
137
|
+
recover(f) {
|
|
138
|
+
return this.recoverErr(f);
|
|
139
|
+
}
|
|
127
140
|
tapErr(f) {
|
|
128
141
|
if (this.tag !== "Err") return this;
|
|
129
142
|
try {
|
|
@@ -166,30 +179,46 @@ var Res = class {
|
|
|
166
179
|
case "Defect": return cases.defect(this.cause);
|
|
167
180
|
}
|
|
168
181
|
}
|
|
169
|
-
|
|
182
|
+
get() {
|
|
170
183
|
switch (this.tag) {
|
|
171
184
|
case "Ok": return this.value;
|
|
172
185
|
case "Err": throw new UnwrapError(this.error);
|
|
173
186
|
case "Defect": throw this.cause;
|
|
174
187
|
}
|
|
175
188
|
}
|
|
176
|
-
|
|
189
|
+
/** @deprecated Use {@link Res.get}. */
|
|
190
|
+
unwrap() {
|
|
191
|
+
return this.get();
|
|
192
|
+
}
|
|
193
|
+
getErr() {
|
|
177
194
|
switch (this.tag) {
|
|
178
195
|
case "Err": return this.error;
|
|
179
196
|
case "Ok": throw new UnwrapError(this.value);
|
|
180
197
|
case "Defect": throw this.cause;
|
|
181
198
|
}
|
|
182
199
|
}
|
|
183
|
-
|
|
200
|
+
/** @deprecated Use {@link Res.getErr}. */
|
|
201
|
+
unwrapErr() {
|
|
202
|
+
return this.getErr();
|
|
203
|
+
}
|
|
204
|
+
getOr(fallback) {
|
|
184
205
|
if (this.tag === "Ok") return this.value;
|
|
185
206
|
if (this.tag === "Defect") throw this.cause;
|
|
186
207
|
return fallback;
|
|
187
208
|
}
|
|
188
|
-
|
|
209
|
+
/** @deprecated Use {@link Res.getOr}. */
|
|
210
|
+
unwrapOr(fallback) {
|
|
211
|
+
return this.getOr(fallback);
|
|
212
|
+
}
|
|
213
|
+
getOrElse(f) {
|
|
189
214
|
if (this.tag === "Ok") return this.value;
|
|
190
215
|
if (this.tag === "Defect") throw this.cause;
|
|
191
216
|
return f(this.error);
|
|
192
217
|
}
|
|
218
|
+
/** @deprecated Use {@link Res.getOrElse}. */
|
|
219
|
+
unwrapOrElse(f) {
|
|
220
|
+
return this.getOrElse(f);
|
|
221
|
+
}
|
|
193
222
|
getOrNull() {
|
|
194
223
|
if (this.tag === "Ok") return this.value;
|
|
195
224
|
if (this.tag === "Defect") throw this.cause;
|
|
@@ -199,6 +228,11 @@ var Res = class {
|
|
|
199
228
|
if (this.tag === "Ok") return this.value;
|
|
200
229
|
if (this.tag === "Defect") throw this.cause;
|
|
201
230
|
}
|
|
231
|
+
getOrThrow() {
|
|
232
|
+
if (this.tag === "Ok") return this.value;
|
|
233
|
+
if (this.tag === "Defect") throw this.cause;
|
|
234
|
+
throw this.error;
|
|
235
|
+
}
|
|
202
236
|
isOk() {
|
|
203
237
|
return this.tag === "Ok";
|
|
204
238
|
}
|
|
@@ -420,7 +454,7 @@ var AsyncRes = class AsyncRes {
|
|
|
420
454
|
}
|
|
421
455
|
}));
|
|
422
456
|
}
|
|
423
|
-
|
|
457
|
+
flatMapErr(f) {
|
|
424
458
|
return new AsyncRes(this.promise.then(async (r) => {
|
|
425
459
|
if (r.tag !== "Err") return passThrough(r);
|
|
426
460
|
try {
|
|
@@ -430,7 +464,11 @@ var AsyncRes = class AsyncRes {
|
|
|
430
464
|
}
|
|
431
465
|
}));
|
|
432
466
|
}
|
|
433
|
-
|
|
467
|
+
/** @deprecated Use {@link AsyncRes.flatMapErr}. */
|
|
468
|
+
orElse(f) {
|
|
469
|
+
return this.flatMapErr(f);
|
|
470
|
+
}
|
|
471
|
+
recoverErr(f) {
|
|
434
472
|
return new AsyncRes(this.promise.then((r) => {
|
|
435
473
|
if (r.tag !== "Err") return passThrough(r);
|
|
436
474
|
try {
|
|
@@ -440,6 +478,10 @@ var AsyncRes = class AsyncRes {
|
|
|
440
478
|
}
|
|
441
479
|
}));
|
|
442
480
|
}
|
|
481
|
+
/** @deprecated Use {@link AsyncRes.recoverErr}. */
|
|
482
|
+
recover(f) {
|
|
483
|
+
return this.recoverErr(f);
|
|
484
|
+
}
|
|
443
485
|
tapErr(f) {
|
|
444
486
|
return new AsyncRes(this.promise.then((r) => {
|
|
445
487
|
if (r.tag !== "Err") return r;
|
|
@@ -486,17 +528,33 @@ var AsyncRes = class AsyncRes {
|
|
|
486
528
|
match(cases) {
|
|
487
529
|
return this.promise.then((r) => r.match(cases));
|
|
488
530
|
}
|
|
531
|
+
get() {
|
|
532
|
+
return this.promise.then((r) => r.get());
|
|
533
|
+
}
|
|
534
|
+
/** @deprecated Use {@link AsyncRes.get}. */
|
|
489
535
|
unwrap() {
|
|
490
|
-
return this.
|
|
536
|
+
return this.get();
|
|
537
|
+
}
|
|
538
|
+
getErr() {
|
|
539
|
+
return this.promise.then((r) => r.getErr());
|
|
491
540
|
}
|
|
541
|
+
/** @deprecated Use {@link AsyncRes.getErr}. */
|
|
492
542
|
unwrapErr() {
|
|
493
|
-
return this.
|
|
543
|
+
return this.getErr();
|
|
544
|
+
}
|
|
545
|
+
getOr(fallback) {
|
|
546
|
+
return this.promise.then((r) => r.getOr(fallback));
|
|
494
547
|
}
|
|
548
|
+
/** @deprecated Use {@link AsyncRes.getOr}. */
|
|
495
549
|
unwrapOr(fallback) {
|
|
496
|
-
return this.
|
|
550
|
+
return this.getOr(fallback);
|
|
497
551
|
}
|
|
552
|
+
getOrElse(f) {
|
|
553
|
+
return this.promise.then((r) => r.getOrElse(f));
|
|
554
|
+
}
|
|
555
|
+
/** @deprecated Use {@link AsyncRes.getOrElse}. */
|
|
498
556
|
unwrapOrElse(f) {
|
|
499
|
-
return this.
|
|
557
|
+
return this.getOrElse(f);
|
|
500
558
|
}
|
|
501
559
|
getOrNull() {
|
|
502
560
|
return this.promise.then((r) => r.getOrNull());
|
|
@@ -504,6 +562,9 @@ var AsyncRes = class AsyncRes {
|
|
|
504
562
|
getOrUndefined() {
|
|
505
563
|
return this.promise.then((r) => r.getOrUndefined());
|
|
506
564
|
}
|
|
565
|
+
getOrThrow() {
|
|
566
|
+
return this.promise.then((r) => r.getOrThrow());
|
|
567
|
+
}
|
|
507
568
|
};
|
|
508
569
|
//#endregion
|
|
509
570
|
//#region src/constructors.ts
|
|
@@ -518,7 +579,7 @@ var AsyncRes = class AsyncRes {
|
|
|
518
579
|
* import { Ok } from "unthrown";
|
|
519
580
|
*
|
|
520
581
|
* Ok(2).map((n) => n + 1); // => Ok(3)
|
|
521
|
-
* Ok(42).
|
|
582
|
+
* Ok(42).get(); // => 42
|
|
522
583
|
* ```
|
|
523
584
|
*
|
|
524
585
|
* @category Constructors
|
|
@@ -537,7 +598,7 @@ function Ok(value) {
|
|
|
537
598
|
* import { Err } from "unthrown";
|
|
538
599
|
*
|
|
539
600
|
* Err("not_found").map((n) => n + 1); // => Err("not_found") (map skipped)
|
|
540
|
-
* Err("not_found").
|
|
601
|
+
* Err("not_found").getErr(); // => "not_found"
|
|
541
602
|
* ```
|
|
542
603
|
*
|
|
543
604
|
* @category Constructors
|
|
@@ -546,6 +607,58 @@ function Err(error) {
|
|
|
546
607
|
return errRes(error);
|
|
547
608
|
}
|
|
548
609
|
/**
|
|
610
|
+
* Construct a successful {@link AsyncResult} from a pure value — the pre-lifted
|
|
611
|
+
* form of {@link Ok}, sparing you `Ok(value).toAsync()`.
|
|
612
|
+
*
|
|
613
|
+
* @remarks
|
|
614
|
+
* Reach for this on the synchronous/early branch of an `AsyncResult`-returning
|
|
615
|
+
* function, so both branches share one return type without a trailing
|
|
616
|
+
* `.toAsync()`. Named with the `Async` suffix the async free functions carry
|
|
617
|
+
* (`allAsync`, `allFromDictAsync`); the {@link AsyncResult} companion aliases it
|
|
618
|
+
* as `AsyncResult.Ok` (the namespace already says "async", so the suffix drops).
|
|
619
|
+
*
|
|
620
|
+
* @typeParam T - the success value type.
|
|
621
|
+
* @param value - the success value to wrap.
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```ts
|
|
625
|
+
* import { OkAsync, type AsyncResult } from "unthrown";
|
|
626
|
+
*
|
|
627
|
+
* function loadItems(ids: string[]): AsyncResult<Item[], never> {
|
|
628
|
+
* if (ids.length === 0) return OkAsync([]); // no more Ok([]).toAsync()
|
|
629
|
+
* return itemRepository.load(ids);
|
|
630
|
+
* }
|
|
631
|
+
* ```
|
|
632
|
+
*
|
|
633
|
+
* @category Constructors
|
|
634
|
+
*/
|
|
635
|
+
function OkAsync(value) {
|
|
636
|
+
return Ok(value).toAsync();
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Construct a failed {@link AsyncResult} carrying a **modeled** error — the
|
|
640
|
+
* pre-lifted form of {@link Err}, sparing you `Err(error).toAsync()`.
|
|
641
|
+
*
|
|
642
|
+
* @remarks
|
|
643
|
+
* The error-channel mirror of {@link OkAsync}; see it for the naming and the
|
|
644
|
+
* `AsyncResult.Err` companion alias.
|
|
645
|
+
*
|
|
646
|
+
* @typeParam E - the modeled error type.
|
|
647
|
+
* @param error - the domain error to wrap.
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* ```ts
|
|
651
|
+
* import { ErrAsync } from "unthrown";
|
|
652
|
+
*
|
|
653
|
+
* ErrAsync("not_found"); // AsyncResult<never, string>
|
|
654
|
+
* ```
|
|
655
|
+
*
|
|
656
|
+
* @category Constructors
|
|
657
|
+
*/
|
|
658
|
+
function ErrAsync(error) {
|
|
659
|
+
return Err(error).toAsync();
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
549
662
|
* Type guard: narrow a {@link Result} to its `Ok` variant, exposing `.value`.
|
|
550
663
|
*
|
|
551
664
|
* @returns `true` when `r` is `Ok`.
|
|
@@ -712,9 +825,9 @@ function isDefectMarker(x) {
|
|
|
712
825
|
* import { fromNullable } from "unthrown";
|
|
713
826
|
*
|
|
714
827
|
* const map = new Map([["a", 1]]);
|
|
715
|
-
* fromNullable(map.get("a"), () => "absent").
|
|
828
|
+
* fromNullable(map.get("a"), () => "absent").getOr(0); // => 1
|
|
716
829
|
* fromNullable(map.get("z"), () => "absent"); // => Err("absent")
|
|
717
|
-
* fromNullable(0, () => "absent").
|
|
830
|
+
* fromNullable(0, () => "absent").getOr(-1); // => 0 (falsy but present)
|
|
718
831
|
* ```
|
|
719
832
|
*/
|
|
720
833
|
function fromNullable(value, onAbsent) {
|
|
@@ -734,7 +847,7 @@ function fromNullable(value, onAbsent) {
|
|
|
734
847
|
* `qualify`'s return is **subtracted** from `E`, never inferred into it. So a
|
|
735
848
|
* `qualify` that returns *only* `defect(cause)` yields `E = never` (a Defect is
|
|
736
849
|
* out-of-band and must not pollute the error channel); reach for
|
|
737
|
-
* {@link
|
|
850
|
+
* {@link fromSafeThrowable} when every throw is a Defect.
|
|
738
851
|
*
|
|
739
852
|
* @typeParam A - the wrapped function's argument tuple.
|
|
740
853
|
* @typeParam T - the wrapped function's return type.
|
|
@@ -758,7 +871,7 @@ function fromNullable(value, onAbsent) {
|
|
|
758
871
|
* cause instanceof SyntaxError ? ("invalid_json" as const) : defect(cause),
|
|
759
872
|
* );
|
|
760
873
|
*
|
|
761
|
-
* parse('{"ok":true}').
|
|
874
|
+
* parse('{"ok":true}').getOr(null); // => { ok: true }
|
|
762
875
|
* parse("nope"); // => Err("invalid_json")
|
|
763
876
|
* ```
|
|
764
877
|
*/
|
|
@@ -773,6 +886,44 @@ function fromThrowable(fn, qualify) {
|
|
|
773
886
|
};
|
|
774
887
|
}
|
|
775
888
|
/**
|
|
889
|
+
* Wrap a throwing synchronous function asserted **not** to fail in any modeled
|
|
890
|
+
* way: any throw becomes a `Defect`.
|
|
891
|
+
*
|
|
892
|
+
* @remarks
|
|
893
|
+
* The synchronous counterpart of {@link fromSafePromise}. Use it only when a
|
|
894
|
+
* throw genuinely indicates a bug rather than an anticipated outcome — the
|
|
895
|
+
* error channel is `never`, so there is nothing to triage; there is no
|
|
896
|
+
* `qualify`. When some throws *are* anticipated, reach for
|
|
897
|
+
* {@link fromThrowable} and triage them.
|
|
898
|
+
*
|
|
899
|
+
* @typeParam A - the wrapped function's argument tuple.
|
|
900
|
+
* @typeParam T - the wrapped function's return type.
|
|
901
|
+
* @param fn - the throwing function to wrap.
|
|
902
|
+
* @returns a function with the same arguments returning `Result<T, never>`.
|
|
903
|
+
*
|
|
904
|
+
* @category Interop
|
|
905
|
+
*
|
|
906
|
+
* @example
|
|
907
|
+
* ```ts
|
|
908
|
+
* import { fromSafeThrowable } from "unthrown";
|
|
909
|
+
*
|
|
910
|
+
* // A decode failure here is a bug (the row came from our own schema), so
|
|
911
|
+
* // every throw is a defect — no throwaway `(cause, defect) => defect(cause)`.
|
|
912
|
+
* const decode = fromSafeThrowable((row: Row) => userSchema.parse(row));
|
|
913
|
+
*
|
|
914
|
+
* decode(row); // => Result<User, never> — a throw becomes a Defect
|
|
915
|
+
* ```
|
|
916
|
+
*/
|
|
917
|
+
function fromSafeThrowable(fn) {
|
|
918
|
+
return (...args) => {
|
|
919
|
+
try {
|
|
920
|
+
return Ok(fn(...args));
|
|
921
|
+
} catch (cause) {
|
|
922
|
+
return defectRes(cause);
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
776
927
|
* Wrap a `Promise` (or a thunk producing one) as an {@link AsyncResult}, forcing
|
|
777
928
|
* every rejection to be triaged.
|
|
778
929
|
*
|
|
@@ -805,8 +956,8 @@ function fromThrowable(fn, qualify) {
|
|
|
805
956
|
* cause instanceof NotFoundError ? ("not_found" as const) : defect(cause),
|
|
806
957
|
* );
|
|
807
958
|
*
|
|
808
|
-
* user.
|
|
809
|
-
* // when fetchUser rejects with NotFoundError:
|
|
959
|
+
* if (user.isOk()) user.value; // => the fetched user
|
|
960
|
+
* // when fetchUser rejects with NotFoundError: user is Err("not_found")
|
|
810
961
|
* ```
|
|
811
962
|
*/
|
|
812
963
|
function fromPromise(promise, qualify) {
|
|
@@ -820,7 +971,8 @@ function fromPromise(promise, qualify) {
|
|
|
820
971
|
* @remarks
|
|
821
972
|
* Use this only when a rejection genuinely indicates a bug rather than an
|
|
822
973
|
* anticipated outcome — the error channel is `never`, so there is nothing to
|
|
823
|
-
* triage. (`await`-ing still yields a `Result`; it never throws.)
|
|
974
|
+
* triage. (`await`-ing still yields a `Result`; it never throws.) The
|
|
975
|
+
* synchronous counterpart is {@link fromSafeThrowable}.
|
|
824
976
|
*
|
|
825
977
|
* @typeParam T - the resolved value type.
|
|
826
978
|
* @param promise - the promise, or a thunk returning one.
|
|
@@ -831,7 +983,7 @@ function fromPromise(promise, qualify) {
|
|
|
831
983
|
* ```ts
|
|
832
984
|
* import { fromSafePromise } from "unthrown";
|
|
833
985
|
*
|
|
834
|
-
* (await fromSafePromise(Promise.resolve(3))).
|
|
986
|
+
* (await fromSafePromise(Promise.resolve(3))).get(); // => 3
|
|
835
987
|
* // a rejection becomes a Defect (never a modeled Err):
|
|
836
988
|
* await fromSafePromise(Promise.reject(new Error("boom"))); // => Defect(Error("boom"))
|
|
837
989
|
* ```
|
|
@@ -905,7 +1057,7 @@ function foldRecord(results) {
|
|
|
905
1057
|
* ```ts
|
|
906
1058
|
* import { all, Ok, Err } from "unthrown";
|
|
907
1059
|
*
|
|
908
|
-
* all([Ok(1), Ok("a"), Ok(true)]).
|
|
1060
|
+
* all([Ok(1), Ok("a"), Ok(true)]).get(); // => [1, "a", true] (typed [number, string, boolean])
|
|
909
1061
|
* all([Ok(1), Err("e"), Ok(3)]); // => Err("e") (short-circuits on the first Err)
|
|
910
1062
|
* ```
|
|
911
1063
|
*/
|
|
@@ -928,7 +1080,7 @@ function all(results) {
|
|
|
928
1080
|
* ```ts
|
|
929
1081
|
* import { allFromDict, Ok, Err } from "unthrown";
|
|
930
1082
|
*
|
|
931
|
-
* allFromDict({ id: Ok(1), name: Ok("ada") }).
|
|
1083
|
+
* allFromDict({ id: Ok(1), name: Ok("ada") }).get(); // => { id: 1, name: "ada" }
|
|
932
1084
|
* allFromDict({ id: Ok(1), name: Err("missing") }); // => Err("missing")
|
|
933
1085
|
* ```
|
|
934
1086
|
*/
|
|
@@ -952,7 +1104,7 @@ function allFromDict(results) {
|
|
|
952
1104
|
* import { allAsync, fromSafePromise } from "unthrown";
|
|
953
1105
|
*
|
|
954
1106
|
* const both = allAsync([fromSafePromise(Promise.resolve(1)), fromSafePromise(Promise.resolve(2))]);
|
|
955
|
-
* (await both).
|
|
1107
|
+
* (await both).get(); // => [1, 2]
|
|
956
1108
|
* ```
|
|
957
1109
|
*/
|
|
958
1110
|
function allAsync(results) {
|
|
@@ -976,7 +1128,7 @@ function allAsync(results) {
|
|
|
976
1128
|
* a: fromSafePromise(Promise.resolve(1)),
|
|
977
1129
|
* b: fromSafePromise(Promise.resolve("x")),
|
|
978
1130
|
* });
|
|
979
|
-
* (await both).
|
|
1131
|
+
* (await both).get(); // => { a: 1, b: "x" }
|
|
980
1132
|
* ```
|
|
981
1133
|
*/
|
|
982
1134
|
function allFromDictAsync(results) {
|
|
@@ -995,8 +1147,9 @@ function allFromDictAsync(results) {
|
|
|
995
1147
|
* Companion object grouping the **`Result`-producing** entry points under a
|
|
996
1148
|
* single, discoverable namespace: {@link Result.Ok}, {@link Result.Err},
|
|
997
1149
|
* {@link Result.Do}, {@link Result.fromNullable}, {@link Result.fromThrowable},
|
|
998
|
-
* {@link Result.
|
|
999
|
-
* {@link Result.
|
|
1150
|
+
* {@link Result.fromSafeThrowable}, {@link Result.all},
|
|
1151
|
+
* {@link Result.allFromDict}, {@link Result.isOk}, {@link Result.isErr},
|
|
1152
|
+
* {@link Result.isDefect}, {@link Result.isResult}.
|
|
1000
1153
|
*
|
|
1001
1154
|
* @remarks
|
|
1002
1155
|
* Purely additive sugar — each member **is** the corresponding free function.
|
|
@@ -1013,7 +1166,7 @@ function allFromDictAsync(results) {
|
|
|
1013
1166
|
* @example
|
|
1014
1167
|
* ```ts
|
|
1015
1168
|
* import { Result } from "unthrown";
|
|
1016
|
-
* Result.Ok(1).flatMap((n) => Result.Ok(n + 1)).
|
|
1169
|
+
* Result.Ok(1).flatMap((n) => Result.Ok(n + 1)).get(); // => 2
|
|
1017
1170
|
* ```
|
|
1018
1171
|
*/
|
|
1019
1172
|
const Result = {
|
|
@@ -1022,6 +1175,7 @@ const Result = {
|
|
|
1022
1175
|
Do,
|
|
1023
1176
|
fromNullable,
|
|
1024
1177
|
fromThrowable,
|
|
1178
|
+
fromSafeThrowable,
|
|
1025
1179
|
all,
|
|
1026
1180
|
allFromDict,
|
|
1027
1181
|
isOk,
|
|
@@ -1031,18 +1185,20 @@ const Result = {
|
|
|
1031
1185
|
};
|
|
1032
1186
|
/**
|
|
1033
1187
|
* Companion object grouping the **`AsyncResult`-producing** entry points under
|
|
1034
|
-
* the matching namespace: {@link AsyncResult.
|
|
1035
|
-
* {@link AsyncResult.
|
|
1036
|
-
* {@link AsyncResult.allFromDict}.
|
|
1188
|
+
* the matching namespace: {@link AsyncResult.Ok}, {@link AsyncResult.Err},
|
|
1189
|
+
* {@link AsyncResult.fromPromise}, {@link AsyncResult.fromSafePromise},
|
|
1190
|
+
* {@link AsyncResult.all}, {@link AsyncResult.allFromDict}.
|
|
1037
1191
|
*
|
|
1038
1192
|
* @remarks
|
|
1039
1193
|
* The async sibling of {@link Result}. Statics are grouped by what they
|
|
1040
|
-
* **return**, so `fromPromise`/`fromSafePromise
|
|
1041
|
-
* here rather than on {@link Result}; the namespace
|
|
1042
|
-
* the
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1045
|
-
*
|
|
1194
|
+
* **return**, so the pre-lifted constructors, `fromPromise`/`fromSafePromise`,
|
|
1195
|
+
* and the async aggregates sit here rather than on {@link Result}; the namespace
|
|
1196
|
+
* already conveys "async", so the members drop the `Async` suffix their free
|
|
1197
|
+
* functions carry (`AsyncResult.Ok` is `OkAsync`; `AsyncResult.Err` is
|
|
1198
|
+
* `ErrAsync`; `AsyncResult.all` is `allAsync`; `AsyncResult.allFromDict` is
|
|
1199
|
+
* `allFromDictAsync`). Like {@link Result}, the free functions remain the
|
|
1200
|
+
* primary, tree-shakeable API; the value `AsyncResult` and the type
|
|
1201
|
+
* {@link AsyncResult} share one name.
|
|
1046
1202
|
*
|
|
1047
1203
|
* @category Facade
|
|
1048
1204
|
*
|
|
@@ -1050,10 +1206,12 @@ const Result = {
|
|
|
1050
1206
|
* ```ts
|
|
1051
1207
|
* import { AsyncResult } from "unthrown";
|
|
1052
1208
|
* const user = await AsyncResult.fromPromise(fetchUser(id), (c, defect) => defect(c));
|
|
1053
|
-
* user.
|
|
1209
|
+
* user.get(); // => the fetched user (on success)
|
|
1054
1210
|
* ```
|
|
1055
1211
|
*/
|
|
1056
1212
|
const AsyncResult = {
|
|
1213
|
+
Ok: OkAsync,
|
|
1214
|
+
Err: ErrAsync,
|
|
1057
1215
|
fromPromise,
|
|
1058
1216
|
fromSafePromise,
|
|
1059
1217
|
all: allAsync,
|
|
@@ -1067,8 +1225,13 @@ const AsyncResult = {
|
|
|
1067
1225
|
*
|
|
1068
1226
|
* @remarks
|
|
1069
1227
|
* Extend the returned class to declare a concrete error. Supply the payload with
|
|
1070
|
-
* an instantiation expression; omit it for a payload-less error.
|
|
1071
|
-
*
|
|
1228
|
+
* an instantiation expression; omit it for a payload-less error. The `message`
|
|
1229
|
+
* is **not** a payload field — it is the human string owned by `Error`, not
|
|
1230
|
+
* structured data, so it is reserved. Define it once per subclass the standard
|
|
1231
|
+
* way, `override message = "…"` (it may interpolate the payload via `this`,
|
|
1232
|
+
* which the base populates before the subclass field initialiser runs); a
|
|
1233
|
+
* payload `message` is rejected at compile time, so contextual detail lives in
|
|
1234
|
+
* typed fields, never baked into per-call prose. The `_tag` always reflects
|
|
1072
1235
|
* `tag` and cannot be overridden by the payload. `name` is likewise reserved —
|
|
1073
1236
|
* it is the display label (set it with `options.name`); a payload `name` is
|
|
1074
1237
|
* rejected at compile time (and excluded from the instance type), so it can't
|
|
@@ -1083,11 +1246,14 @@ const AsyncResult = {
|
|
|
1083
1246
|
* ```ts
|
|
1084
1247
|
* class RetryableError extends TaggedError("@my-lib/RetryableError", {
|
|
1085
1248
|
* name: "RetryableError",
|
|
1086
|
-
* })
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
* e
|
|
1249
|
+
* }) {
|
|
1250
|
+
* override message = "operation failed; safe to retry";
|
|
1251
|
+
* }
|
|
1252
|
+
*
|
|
1253
|
+
* const e = new RetryableError();
|
|
1254
|
+
* e._tag; // "@my-lib/RetryableError" — namespaced discriminant
|
|
1255
|
+
* e.name; // "RetryableError" — clean display name
|
|
1256
|
+
* e.message; // "operation failed; safe to retry" — the standard Error.message
|
|
1091
1257
|
* ```
|
|
1092
1258
|
*
|
|
1093
1259
|
* @typeParam Tag - the string literal discriminant.
|
|
@@ -1111,10 +1277,11 @@ function TaggedError(tag, options) {
|
|
|
1111
1277
|
class TaggedErrorBase extends Error {
|
|
1112
1278
|
_tag;
|
|
1113
1279
|
constructor(props) {
|
|
1114
|
-
super(
|
|
1280
|
+
super();
|
|
1115
1281
|
if (props) Object.assign(this, props);
|
|
1116
1282
|
this._tag = tag;
|
|
1117
1283
|
this.name = displayName;
|
|
1284
|
+
delete this.message;
|
|
1118
1285
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
1119
1286
|
}
|
|
1120
1287
|
}
|
|
@@ -1133,6 +1300,6 @@ function matchTags(result, handlers) {
|
|
|
1133
1300
|
});
|
|
1134
1301
|
}
|
|
1135
1302
|
//#endregion
|
|
1136
|
-
export { AsyncResult, Do, Err, Ok, Result, TaggedError, UnwrapError, all, allAsync, allFromDict, allFromDictAsync, fromNullable, fromPromise, fromSafePromise, fromThrowable, isDefect, isErr, isOk, isResult, matchTags };
|
|
1303
|
+
export { AsyncResult, Do, Err, ErrAsync, Ok, OkAsync, Result, TaggedError, UnwrapError, all, allAsync, allFromDict, allFromDictAsync, fromNullable, fromPromise, fromSafePromise, fromSafeThrowable, fromThrowable, isDefect, isErr, isOk, isResult, matchTags };
|
|
1137
1304
|
|
|
1138
1305
|
//# sourceMappingURL=index.mjs.map
|