Skip to main content

Interface: IResult<T, E>

result/src.IResult

Type parameters

NameDescription
T-
E-

Methods

[iterator]

[iterator](): Generator<T, any, unknown>

Returns

Generator<T, any, unknown>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:863


and

and<U>(result): Result<U, E>

Type parameters

Name
U

Parameters

NameTypeDescription
resultResult<U, E>

Returns

Result<U, E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:601


andThen

andThen<U>(cb): Result<U, E>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => Result<U, E>

Returns

Result<U, E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:622


contains

contains(value): boolean

Parameters

NameTypeDescription
valueT

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:703


containsErr

containsErr(error): boolean

Parameters

NameTypeDescription
errorE

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:727


eq

eq(other): boolean

Parameters

NameTypeDescription
otherResult<T, E>

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:805


err

err(): Option<E>

Returns

Option<E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:139


expect

expect(message): T

Parameters

NameTypeDescription
messagestring

Returns

T

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:419


expectErr

expectErr(message): E

Parameters

NameTypeDescription
messagestring

Returns

E

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:444


flatten

flatten<IT>(this): Result<IT, E>

Type parameters

Name
IT

Parameters

NameType
thisResult<Result<IT, E>, E>

Returns

Result<IT, E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:766


inspect

inspect(cb): IResult<T, E>

Parameters

NameTypeDescription
cb(value: T) => void

Returns

IResult<T, E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:308


inspectAsync

inspectAsync(cb): Promise<IResult<T, E>>

Parameters

NameTypeDescription
cb(value: T) => Awaitable<void>

Returns

Promise<IResult<T, E>>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:328


inspectErr

inspectErr(cb): IResult<T, E>

Parameters

NameTypeDescription
cb(error: E) => void

Returns

IResult<T, E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:348


inspectErrAsync

inspectErrAsync(cb): Promise<IResult<T, E>>

Parameters

NameTypeDescription
cb(error: E) => Awaitable<void>

Returns

Promise<IResult<T, E>>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:368


intoOkOrErr

intoOkOrErr(): T | E

Returns

T | E

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:784


intoPromise

intoPromise(): Promise<Result<Awaited<T>, Awaited<E>>>

Returns

Promise<Result<Awaited<T>, Awaited<E>>>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:797


isErr

isErr(): this is Err<E>

Returns

this is Err<E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:75


isErrAnd

isErrAnd<R>(cb): this is Err<E> & R

Type parameters

NameType
Rextends boolean

Parameters

NameTypeDescription
cb(error: E) => R

Returns

this is Err<E> & R

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:99


isOk

isOk(): this is Ok<T>

Returns

this is Ok<T>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:34


isOkAnd

isOkAnd<R>(cb): this is Ok<T> & R

Type parameters

NameType
Rextends boolean

Parameters

NameType
cb(value: T) => R

Returns

this is Ok<T> & R

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:57


iter

iter(): Generator<T, any, unknown>

Returns

Generator<T, any, unknown>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:394


map

map<U>(cb): Result<U, E>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => U

Returns

Result<U, E>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:159


mapErr

mapErr<F>(cb): Result<T, F>

Type parameters

Name
F

Parameters

NameTypeDescription
cb(error: E) => F

Returns

Result<T, F>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:258


mapErrInto

mapErrInto<IT, IE>(cb): Result<T | IT, IE>

Type parameters

Name
IT
IE

Parameters

NameTypeDescription
cb(error: E) => Result<IT, IE>

Returns

Result<T | IT, IE>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:288


mapInto

mapInto<IT, IE>(cb): Result<IT, E | IE>

Type parameters

Name
IT
IE

Parameters

NameTypeDescription
cb(value: T) => Result<IT, IE>

Returns

Result<IT, E | IE>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:190


mapOr

mapOr<U>(defaultValue, cb): U

Type parameters

Name
U

Parameters

NameTypeDescription
defaultValueU
cb(value: T) => U

Returns

U

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:213


mapOrElse

mapOrElse<U>(op, cb): U

Type parameters

Name
U

Parameters

NameTypeDescription
op(error: E) => U
cb(value: T) => U

Returns

U

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:236


match

match<OkValue, ErrValue>(branches): OkValue | ErrValue

Type parameters

Name
OkValue
ErrValue

Parameters

NameTypeDescription
branchesObject
branches.err(error: E) => ErrValue-
branches.ok(value: T) => OkValue-

Returns

OkValue | ErrValue

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:836


ne

ne(other): boolean

Parameters

NameTypeDescription
otherResult<T, E>

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:813


ok

ok(): Option<T>

Returns

Option<T>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:119


or

or<F>(result): Result<T, F>

Type parameters

Name
F

Parameters

NameTypeDescription
resultResult<T, F>

Returns

Result<T, F>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:658


orElse

orElse<F>(cb): Result<T, F>

Type parameters

Name
F

Parameters

NameTypeDescription
cb(error: E) => Result<T, F>

Returns

Result<T, F>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:679


transpose

transpose<IT>(this): Option<Result<IT, E>>

Type parameters

Name
IT

Parameters

NameType
thisResult<Option<IT>, E>

Returns

Option<Result<IT, E>>

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:743


unwrap

unwrap(): T

Returns

T

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:472


unwrapErr

unwrapErr(): E

Returns

E

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:500


unwrapOr

unwrapOr<V>(defaultValue): T | V

Type parameters

Name
V

Parameters

NameTypeDescription
defaultValueV

Returns

T | V

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:527


unwrapOrElse

unwrapOrElse<V>(op): T | V

Type parameters

Name
V

Parameters

NameTypeDescription
op(error: E) => V

Returns

T | V

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:548


unwrapRaw

unwrapRaw(): T

Returns

T

Defined in

projects/utilities/packages/result/src/lib/Result/IResult.ts:574