Function unwrap

Retrieve the value from an ok result

Will throw if result is an err result

The value type of the Ok result.

The error type of the Err result.

Result to unwrap the value from

The underlying value of an ok result

  • Retrieve the value from an Err result.

    This override documents that an error is thrown when unwrapping an Err result.

    Parameters

    • result: Result<never, unknown>

      An Err result value

    Returns never

    Never

  • Retrieve the value from an Ok result.

    This override is required for type safety for Ok results.

    Type Parameters

    • T

      The value type of the Ok result.

    Parameters

    • result: Result<T, never>

      Result to unwrap the value from

    Returns T

    The successful value of T result