type alias InferErr

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

Examples

Example 1

type MyResult = Result<number, ValidationError>;
type Error = InferErr<MyResult>; // ValidationError

Type Parameters

Definition

R extends Result<unknown, infer E> ? E : never

Usage

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