SafeResult
katanakit-js / SafeResult
Type Alias: SafeResult<T, E>
Section titled “Type Alias: SafeResult<T, E>”type SafeResult<T, E> = | { data: T; error: null; ok: true; } | { data: null; error: E; ok: false; };Defined in: types/core/http.ts:60
Generic Safe Result discriminated union (Astro Actions style): the ok flag
narrows between the success and error branches and nothing is thrown.
Domain results below are aliases of this shape with a specific error type.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T |
- |
E |
ApiError |