Skip to content

Class: Ok<T, E>

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:26

Type Parameters

T

T

E

E

Implements

  • ResultInterface<T, E>

Constructors

Constructor

new Ok<T, E>(value: T): Ok<T, E>;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:27

Parameters

value

T

Returns

Ok<T, E>

Methods

isErr()

isErr(): this is Err<T, E>;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:31

Returns true only if this contains an error and allows safe access to the value via result.error.

Returns

this is Err<T, E>

Implementation of

ResultInterface.isErr

isOk()

isOk(): this is Ok<T, E>;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:28

Returns true only if this contains a value and allows safe access to the value via result.value.

Returns

this is Ok<T, E>

Implementation of

ResultInterface.isOk

unwrap()

unwrap(): T;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:34

Returns the value if this contains a value, or throws the error.

Returns

T

Throws

E

Implementation of

ResultInterface.unwrap

Properties

value

readonly value: T;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:27