type alias Infer

Extracts the Ok type T from a Result<T, E>.

Examples

Example 1

type MyResult = Result<number, ValidationError>;
type Value = Infer<MyResult>; // number

Type Parameters

Definition

R extends Result<infer T, BaseError> ? T : never

Usage

import { type Infer } from "result/mod.ts";