@pvorona/failable 0.0.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.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @pvorona/failable
2
+
3
+ A typed result type for expected failures. `Failable<T, E>` is a discriminated union of `Success<T>` and `Failure<E>`, with ergonomic accessors and structured-clone support.
4
+
5
+ ## Usage
6
+
7
+ ```ts
8
+ import { Failable } from '@pvorona/failable';
9
+
10
+ const result = Failable.from(() => JSON.parse(text));
11
+
12
+ if (result.isSuccess) {
13
+ console.log(result.data);
14
+ } else {
15
+ console.error(result.error);
16
+ }
17
+ ```
18
+
19
+ ### Factories
20
+
21
+ ```ts
22
+ const success = Failable.ofSuccess(42);
23
+ const failure = Failable.ofError(new Error('boom'));
24
+ ```
25
+
26
+ ### Fallbacks
27
+
28
+ ```ts
29
+ const value = failure.getOr('default'); // 'default'
30
+ const recovered = failure.or('fallback'); // Success<'fallback'>
31
+ ```
32
+
33
+ ### Wrapping async work
34
+
35
+ ```ts
36
+ const result = await Failable.from(fetch('/api'));
37
+ ```
38
+
39
+ ### Structured-clone transport
40
+
41
+ `Failable` instances use Symbols and prototype methods that do not survive structured cloning (`postMessage`, `chrome.runtime.sendMessage`, etc.). Convert to a plain object first:
42
+
43
+ ```ts
44
+ // sender
45
+ const wire = Failable.toFailableLike(result);
46
+ postMessage(wire);
47
+
48
+ // receiver
49
+ const hydrated = Failable.from(wire);
50
+ ```
@@ -0,0 +1,3 @@
1
+ export * from './lib/failable.js';
2
+ export * from './lib/constants.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,80 @@
1
+ import { isObject as s, isFunction as l } from "@pvorona/assert";
2
+ import { notImplemented as o } from "@pvorona/not-implemented";
3
+ const i = /* @__PURE__ */ Symbol("Failable"), u = /* @__PURE__ */ Symbol("Success"), a = /* @__PURE__ */ Symbol("Failure");
4
+ var b = /* @__PURE__ */ ((r) => (r.Success = "success", r.Failure = "failure", r))(b || {});
5
+ function O(r) {
6
+ return s(r) && Object.keys(r).length === 2 && Object.getOwnPropertyDescriptor(r, "status")?.value === "success" && Object.prototype.hasOwnProperty.call(r, "data");
7
+ }
8
+ function F(r) {
9
+ return s(r) && Object.keys(r).length === 2 && Object.getOwnPropertyDescriptor(r, "status")?.value === "failure" && Object.prototype.hasOwnProperty.call(r, "error");
10
+ }
11
+ const f = {
12
+ [i]: !0,
13
+ isSuccess: !1,
14
+ isError: !1,
15
+ data: null,
16
+ error: null,
17
+ or: o,
18
+ getOr: o,
19
+ getOrThrow: o
20
+ }, S = (() => {
21
+ const r = Object.create(f);
22
+ return r[u] = !0, r.status = "success", r.isSuccess = !0, r.or = function() {
23
+ return this;
24
+ }, r.getOr = function() {
25
+ return this.data;
26
+ }, r.getOrThrow = function() {
27
+ return this.data;
28
+ }, Object.freeze(r);
29
+ })(), g = (() => {
30
+ const r = Object.create(f);
31
+ return r[a] = !0, r.status = "failure", r.isError = !0, r.or = function(c) {
32
+ return t.ofSuccess(c);
33
+ }, r.getOr = function(c) {
34
+ return c;
35
+ }, r.getOrThrow = function() {
36
+ throw this.error;
37
+ }, Object.freeze(r);
38
+ })(), t = {
39
+ isFailable: (r) => s(r) && r[i] === !0,
40
+ isSuccess: (r) => s(r) && r[u] === !0,
41
+ isFailure: (r) => s(r) && r[a] === !0,
42
+ ofSuccess: (r) => {
43
+ const e = Object.create(S);
44
+ return e.data = r, Object.freeze(e);
45
+ },
46
+ ofError: (r) => {
47
+ const e = Object.create(g);
48
+ return e.error = r, Object.freeze(e);
49
+ },
50
+ toFailableLike: h,
51
+ isFailableLike: (r) => F(r) || O(r),
52
+ from: j
53
+ };
54
+ function h(r) {
55
+ return r.status === "failure" ? { status: "failure", error: r.error } : { status: "success", data: r.data };
56
+ }
57
+ function j(r) {
58
+ return t.isFailable(r) ? r : t.isFailableLike(r) ? n(r) : l(r) ? m(r) : p(r);
59
+ }
60
+ function n(r) {
61
+ return r.status === "success" ? t.ofSuccess(r.data) : t.ofError(r.error);
62
+ }
63
+ function m(r) {
64
+ try {
65
+ const e = r();
66
+ return t.isFailable(e) ? e : t.isFailableLike(e) ? n(e) : t.ofSuccess(e);
67
+ } catch (e) {
68
+ return t.ofError(e);
69
+ }
70
+ }
71
+ function p(r) {
72
+ return r.then((e) => t.isFailable(e) ? e : t.isFailableLike(e) ? n(e) : t.ofSuccess(e), t.ofError);
73
+ }
74
+ export {
75
+ t as Failable,
76
+ b as FailableStatus,
77
+ i as FailableTag,
78
+ a as FailureTag,
79
+ u as SuccessTag
80
+ };
@@ -0,0 +1,4 @@
1
+ export declare const FailableTag: unique symbol;
2
+ export declare const SuccessTag: unique symbol;
3
+ export declare const FailureTag: unique symbol;
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,eAAqB,CAAC;AAC9C,eAAO,MAAM,UAAU,eAAoB,CAAC;AAC5C,eAAO,MAAM,UAAU,eAAoB,CAAC"}
@@ -0,0 +1,125 @@
1
+ import { FailableTag, SuccessTag, FailureTag } from './constants.js';
2
+ export declare const enum FailableStatus {
3
+ Success = "success",
4
+ Failure = "failure"
5
+ }
6
+ export type Failable<T, E> = Success<T> | Failure<E>;
7
+ /**
8
+ * Structured-clone-friendly representation of {@link Failable}.
9
+ *
10
+ * Use this when sending a result across context boundaries like:
11
+ * - `window.postMessage` / `MessagePort`
12
+ * - `chrome.runtime.sendMessage` / `chrome.tabs.sendMessage`
13
+ *
14
+ * A {@link Failable} instance relies on Symbols and prototype methods, which do not survive structured cloning.
15
+ *
16
+ * Boundary rule:
17
+ * - **sender**: `Failable.toFailableLike(result)`
18
+ * - **receiver**: `Failable.from(message.result)` (rehydrates into a real {@link Failable})
19
+ *
20
+ * Note: `data` / `error` must themselves be structured-cloneable.
21
+ */
22
+ export type FailableLike<T, E> = FailableLikeSuccess<T> | FailableLikeFailure<E>;
23
+ export type FailableLikeSuccess<T> = {
24
+ readonly status: FailableStatus.Success;
25
+ readonly data: T;
26
+ };
27
+ export type FailableLikeFailure<E> = {
28
+ readonly status: FailableStatus.Failure;
29
+ readonly error: E;
30
+ };
31
+ export type Success<T> = {
32
+ readonly [FailableTag]: true;
33
+ readonly [SuccessTag]: true;
34
+ readonly status: FailableStatus.Success;
35
+ readonly isSuccess: true;
36
+ readonly isError: false;
37
+ readonly data: T;
38
+ readonly error: null;
39
+ readonly or: <U>(value: U) => Success<T>;
40
+ readonly getOr: <U>(value: U) => T;
41
+ readonly getOrThrow: () => T;
42
+ };
43
+ export type Failure<E> = {
44
+ readonly [FailableTag]: true;
45
+ readonly [FailureTag]: true;
46
+ readonly status: FailableStatus.Failure;
47
+ readonly isSuccess: false;
48
+ readonly isError: true;
49
+ readonly error: E;
50
+ readonly data: null;
51
+ readonly or: <U>(value: U) => Success<U>;
52
+ readonly getOr: <U>(value: U) => U;
53
+ readonly getOrThrow: () => never;
54
+ };
55
+ /**
56
+ * Namespace-style factory + utilities for the {@link Failable} result type.
57
+ *
58
+ * `Failable<T, E>` is a discriminated union of:
59
+ * - {@link Success}: `{ status: 'success', isSuccess: true, data: T, error: null }`
60
+ * - {@link Failure}: `{ status: 'failure', isError: true, error: E, data: null }`
61
+ *
62
+ * Design goals:
63
+ * - Prefer explicit, typed results over exceptions.
64
+ * - Provide tiny ergonomics (`or`, `getOr`, `getOrThrow`) with minimal allocation.
65
+ * - Support transport across structured-clone boundaries via {@link FailableLike}.
66
+ *
67
+ * Runtime model / invariants:
68
+ * - Instances are shallow-immutable (`Object.freeze`) and tagged with Symbols.
69
+ * - They are NOT class instances; do not use `instanceof`. Prefer `result.isSuccess` / `result.isError`
70
+ * or the guards {@link Failable.isSuccess} / {@link Failable.isFailure}.
71
+ * - Exactly one of `data` / `error` is non-null.
72
+ *
73
+ * Structured-clone boundary rule (RPC, `postMessage`, `chrome.*` messaging):
74
+ * - **sender**: `Failable.toFailableLike(result)`
75
+ * - **receiver**: `Failable.from(payload)` (rehydrates methods + Symbol tags)
76
+ *
77
+ * `Failable.from(...)` overloads:
78
+ * - `from(failable)` returns the same instance (no wrapping).
79
+ * - `from(failableLike)` rehydrates into a real `Success` / `Failure`.
80
+ * - `from(() => value)` captures thrown values into `Failure` and preserves/rehydrates returned
81
+ * `Failable` / `FailableLike`.
82
+ * - `from(promise)` captures rejection values into `Failure` and preserves/rehydrates resolved
83
+ * `Failable` / `FailableLike`.
84
+ *
85
+ * Gotchas:
86
+ * - `Failable.isFailableLike` is intentionally strict: only `{ status, data }` or `{ status, error }`
87
+ * with no extra enumerable keys. If you need metadata, wrap it: `{ result: failableLike, meta }`.
88
+ * - `or(...)` and `getOr(...)` are eager (fallback is evaluated before the call). Use branching for
89
+ * lazy fallbacks.
90
+ * - No error normalization is performed: whatever you throw/reject becomes `.error`.
91
+ * - `from(() => somePromise)` does NOT await; pass the promise directly: `from(somePromise)`.
92
+ *
93
+ * @example
94
+ * const res = Failable.from(() => JSON.parse(text));
95
+ * if (res.isSuccess) return res.data;
96
+ * console.error(res.error);
97
+ *
98
+ * @example
99
+ * // Structured-clone transport
100
+ * const wire = Failable.toFailableLike(res);
101
+ * // ... send wire ...
102
+ * const hydrated = Failable.from(wire);
103
+ */
104
+ export declare const Failable: {
105
+ readonly isFailable: (value: unknown) => value is Failable<unknown, unknown>;
106
+ readonly isSuccess: (value: unknown) => value is Success<unknown>;
107
+ readonly isFailure: (value: unknown) => value is Failure<unknown>;
108
+ readonly ofSuccess: <T = void>(data: T) => Success<T>;
109
+ readonly ofError: <E = void>(error: E) => Failure<E>;
110
+ readonly toFailableLike: typeof toFailableLike;
111
+ readonly isFailableLike: (value: unknown) => value is FailableLike<unknown, unknown>;
112
+ readonly from: typeof from;
113
+ };
114
+ declare function toFailableLike<T>(value: Success<T>): FailableLikeSuccess<T>;
115
+ declare function toFailableLike<E>(value: Failure<E>): FailableLikeFailure<E>;
116
+ declare function toFailableLike<T, E>(value: Failable<T, E>): FailableLike<T, E>;
117
+ type InferReturnTypeFromFunction<F extends () => R, E = Error, R = ReturnType<F>> = [R] extends [never] ? Failure<E> : R extends Success<infer A> ? Success<A> : R extends Failure<infer A> ? Failure<A> : R extends FailableLikeSuccess<infer A> ? Success<A> : R extends FailableLikeFailure<infer A> ? Failure<A> : R extends Failable<infer A, infer B> ? Failable<A, B> : Failable<R, E>;
118
+ type InferReturnTypeFromPromise<T, E = Error, P extends PromiseLike<T> = PromiseLike<T>> = [Awaited<P>] extends [never] ? Promise<Failure<E>> : Awaited<P> extends Promise<Success<infer A>> ? Promise<Success<A>> : Awaited<P> extends Promise<Failure<infer A>> ? Promise<Failure<A>> : Awaited<P> extends Failable<unknown, unknown> ? Promise<Awaited<P>> : Awaited<P> extends FailableLikeSuccess<infer A> ? Promise<Success<A>> : Awaited<P> extends FailableLikeFailure<infer A> ? Promise<Failure<A>> : Awaited<P> extends FailableLike<infer A, infer B> ? Promise<Failable<A, B>> : Promise<Failable<Awaited<P>, E>>;
119
+ declare function from<T>(value: FailableLikeSuccess<T>): Success<T>;
120
+ declare function from<E>(value: FailableLikeFailure<E>): Failure<E>;
121
+ declare function from<T, E>(value: FailableLike<T, E>): Failable<T, E>;
122
+ declare function from<F extends () => R, E = Error, R = ReturnType<F>>(fun: F): InferReturnTypeFromFunction<F, E, R>;
123
+ declare function from<T, E = Error, P extends PromiseLike<T> = PromiseLike<T>>(promise: P): InferReturnTypeFromPromise<T, E, P>;
124
+ export {};
125
+ //# sourceMappingURL=failable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failable.d.ts","sourceRoot":"","sources":["../../src/lib/failable.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,UA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,CAAC;AAC/D,iBAAS,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAC3D,GAAG,EAAE,CAAC,GACL,2BAA2B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxC,iBAAS,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EACnE,OAAO,EAAE,CAAC,GACT,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@pvorona/failable",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "@pvorona/source": "./src/index.ts",
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "!**/*.tsbuildinfo"
20
+ ],
21
+ "dependencies": {
22
+ "@pvorona/assert": "^0.0.1",
23
+ "@pvorona/not-implemented": "^0.0.1"
24
+ }
25
+ }