Skip to main content

Class: Result<T, E>

Type Parameters

Type ParameterDefault type
T-
E extends ErrorError

Properties

error?

readonly optional error: E

Defined in

projects/shapeshift/src/lib/Result.ts:4


success

readonly success: boolean

Defined in

projects/shapeshift/src/lib/Result.ts:2


value?

readonly optional value: T

Defined in

projects/shapeshift/src/lib/Result.ts:3

Methods

isErr()

isErr(): this is Object

Returns

this is Object

Defined in

projects/shapeshift/src/lib/Result.ts:19


isOk()

isOk(): this is Object

Returns

this is Object

Defined in

projects/shapeshift/src/lib/Result.ts:15


unwrap()

unwrap(): T

Returns

T

Defined in

projects/shapeshift/src/lib/Result.ts:23


err()

static err<T, E>(error: E): Result<T, E>

Type Parameters

Type ParameterDefault type
T-
E extends ErrorError

Parameters

ParameterType
errorE

Returns

Result<T, E>

Defined in

projects/shapeshift/src/lib/Result.ts:32


ok()

static ok<T, E>(value: T): Result<T, E>

Type Parameters

Type ParameterDefault type
T-
E extends ErrorError

Parameters

ParameterType
valueT

Returns

Result<T, E>

Defined in

projects/shapeshift/src/lib/Result.ts:28