Skip to content

unwrap

Explicit escape hatch: returns the success value, or throws a ResultError carrying the structured failure.

Use when you have already validated the input (or prefer exceptions) and the Result ceremony is noise. Accepts any of the library's *Result types.

ts
function unwrap<TValue, TError extends Micro509Error<string, unknown>>(
	result: UnwrappableResult<TValue, TError>,
): TValue

Parameters

Released under the MIT License.