Skip to content

Result ​

Result ​

Discriminated ok union: either { ok: true; value } or { ok: false; error }.

Every fallible public API in micro509 returns a specialization of this type.

ts
type Result<TValue, TError> = {
  readonly ok: true;
  readonly value: TValue
} | {
  readonly ok: false;
  readonly error: TError
}

Released under the MIT License.