Skip to content

Type Alias: ExtractOk<T>

ExtractOk<T> = Extract<T, Ok>

Defined in: index.ts:100

Extracts only the Ok types from a union type.

Type Parameters

T

T

The type to extract Ok types from

Example

typescript
type T1 = ExtractOk<Ok<'x'> | Err<1> | Ok<true> | []>; // Ok<'x'> | Ok<true>