Class: Result<T, E>
Type Parameters
Type Parameter | Default type |
---|---|
T | - |
E extends Error | Error |
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 Parameter | Default type |
---|---|
T | - |
E extends Error | Error |
Parameters
Parameter | Type |
---|---|
error | E |
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 Parameter | Default type |
---|---|
T | - |
E extends Error | Error |
Parameters
Parameter | Type |
---|---|
value | T |
Returns
Result
<T
, E
>