Skip to main content

Interface: IOption<T>

result/src.IOption

Type parameters

Name
T

Methods

[iterator]

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

Returns

Generator<T, any, unknown>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:738


and

and<U>(option): Option<U>

Type parameters

Name
U

Parameters

NameTypeDescription
optionOption<U>

Returns

Option<U>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:397


andThen

andThen<U>(cb): Option<U>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => Option<U>

Returns

Option<U>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:418


contains

contains(value): boolean

Parameters

NameTypeDescription
valueT

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:550


eq

eq(other): boolean

Parameters

NameTypeDescription
otherOption<T>

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:680


expect

expect(message): T

Parameters

NameTypeDescription
messagestring

Returns

T

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:89


filter

filter(predicate): Option<T>

Parameters

NameTypeDescription
predicate(value: T) => boolean

Returns

Option<T>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:526


flatten

flatten<IT>(this): Option<IT>

Type parameters

Name
IT

Parameters

NameType
thisOption<Option<IT>>

Returns

Option<IT>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:659


inspect

inspect(cb): IOption<T>

Parameters

NameTypeDescription
cb(value: T) => void

Returns

IOption<T>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:276


inspectAsync

inspectAsync(cb): Promise<IOption<T>>

Parameters

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

Returns

Promise<IOption<T>>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:296


intoPromise

intoPromise(): Promise<Option<Awaited<T>>>

Returns

Promise<Option<Awaited<T>>>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:672


isNone

isNone(): this is None

Returns

this is None

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:66


isSome

isSome(): this is Some<T>

Returns

this is Some<T>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:24


isSomeAnd

isSomeAnd(cb): boolean

Parameters

NameTypeDescription
cb(value: T) => boolean

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:48


iter

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

Returns

Generator<T, any, unknown>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:364


map

map<U>(cb): Option<U>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => U

Returns

Option<U>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:165


mapInto

mapInto<Inner>(cb): Option<Inner>

Type parameters

Name
Inner

Parameters

NameTypeDescription
cb(value: T) => Option<Inner>

Returns

Option<Inner>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:189


mapNoneInto

mapNoneInto<Inner>(cb): Option<T | Inner>

Type parameters

Name
Inner

Parameters

NameTypeDescription
cb() => Option<Inner>

Returns

Option<T | Inner>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:256


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/Option/IOption.ts:212


mapOrElse

mapOrElse<U>(defaultValue, cb): U

Type parameters

Name
U

Parameters

NameTypeDescription
defaultValue() => U
cb(value: T) => U

Returns

U

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:232


match

match<SomeValue, NoneValue>(branches): SomeValue | NoneValue

Type parameters

Name
SomeValue
NoneValue

Parameters

NameTypeDescription
branchesObject
branches.none() => NoneValue-
branches.some(value: T) => SomeValue-

Returns

SomeValue | NoneValue

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:711


ne

ne(other): boolean

Parameters

NameTypeDescription
otherOption<T>

Returns

boolean

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:688


okOr

okOr<E>(err): Result<T, E>

Type parameters

Name
E

Parameters

NameTypeDescription
errE

Returns

Result<T, E>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:318


okOrElse

okOrElse<E>(cb): Result<T, E>

Type parameters

Name
E

Parameters

NameTypeDescription
cb() => E

Returns

Result<T, E>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:337


or

or(option): Option<T>

Parameters

NameTypeDescription
optionOption<T>

Returns

Option<T>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:451


orElse

orElse(cb): Option<T>

Parameters

NameTypeDescription
cb() => Option<T>

Returns

Option<T>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:471


transpose

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

Type parameters

Name
IT
E

Parameters

NameType
thisOption<Result<IT, E>>

Returns

Result<Option<IT>, E>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:636


unwrap

unwrap(): T

Returns

T

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:114


unwrapOr

unwrapOr<V>(defaultValue): T | V

Type parameters

Name
V

Parameters

NameType
defaultValueV

Returns

T | V

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:133


unwrapOrElse

unwrapOrElse<V>(cb): T | V

Type parameters

Name
V

Parameters

NameType
cb() => V

Returns

T | V

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:149


unzip

unzip<Inner, U>(this): [Option<Inner>, Option<U>]

Type parameters

Name
Inner
U

Parameters

NameType
thisOption<readonly [Inner, U]>

Returns

[Option<Inner>, Option<U>]

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:620


xor

xor(option): Option<T>

Parameters

NameTypeDescription
optionOption<T>

Returns

Option<T>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:504


zip

zip<U>(other): Option<[T, U]>

Type parameters

Name
U

Parameters

NameTypeDescription
otherOption<U>

Returns

Option<[T, U]>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:570


zipWith

zipWith<U, R>(other, f): Option<R>

Type parameters

Name
U
R

Parameters

NameTypeDescription
otherOption<U>
f(s: T, o: U) => R

Returns

Option<R>

Defined in

projects/utilities/packages/result/src/lib/Option/IOption.ts:600