micro509/result
Canonical shared result surface. Owns the stable micro509/result entrypoint.
Functions
errorResult— Wraps a Micro509Error in a flattened ErrorResult.failureResult— Builds a flattened failure result in one step.indexedErrorResult— Wraps an IndexedMicro509Error in a flattened IndexedErrorResult.indexedMicro509Error— Constructs an IndexedMicro509Error payload with an optional collection index.isResultError— Type guard: wasvaluethrown by unwrap? Narrows to ResultError.micro509Error— Constructs a Micro509Error payload.rethrowIfInvariant— Rethrows error if it is an invariant/programmer error (TypeError, RangeError,successResult— Wraps a value in a success result ({ ok: true, value }).unwrap— Explicit escape hatch: returns the success value, or throws a ResultError carrying the structured failure.unwrapOr— Returns the success value, orfallbackwhen the result is a failure.
Types
DecodeFailureCode— The codes a parse boundary returns for input it cannot decode:malformedand everyDecodeRefusalCode.DecodeRefusalCode— One ofDECODE_REFUSAL_CODES.ErrorResult— Failed result with a flattened code/message/details surface for ergonomic matching.IndexedErrorResult— Like ErrorResult but also carries an index into the collection that was being processed.IndexedMicro509Error— Like Micro509Error but includes a positional index for collection-processing APIs.Micro509Error— Base error shape carried by all failure results in the library.Result— Discriminatedokunion: either{ ok: true; value }or{ ok: false; error }.ResultError— Exception form of a Micro509Error: a branded Error carrying the structuredUnwrappableResult— A minimal fallible-result shape:{ ok: true, value }or{ ok: false, error }.
Variables
DECODE_REFUSAL_CODES— Codes a parse boundary returns for input it refuses without calling it