Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Result

Index

Functions

and

andThen

contains

  • contains<T, E>(res: ResultType<T, E>, value: T): boolean

containsError

  • containsError<T, E>(res: ResultType<T, E>, value: E): boolean

error

flatten

intoOkOrError

isError

isOk

map

mapError

mapOr

  • mapOr<T, U, E>(res: ResultType<T, E>, defaults: U, fn: (inner: T) => U): U
  • Type parameters

    • T

    • U

    • E

    Parameters

    • res: ResultType<T, E>
    • defaults: U
    • fn: (inner: T) => U
        • (inner: T): U
        • Parameters

          • inner: T

          Returns U

    Returns U

mapOrElse

  • mapOrElse<T, U, E>(res: ResultType<T, E>, defaults: (err: E) => U, fn: (inner: T) => U): U
  • Type parameters

    • T

    • U

    • E

    Parameters

    • res: ResultType<T, E>
    • defaults: (err: E) => U
        • (err: E): U
        • Parameters

          • err: E

          Returns U

    • fn: (inner: T) => U
        • (inner: T): U
        • Parameters

          • inner: T

          Returns U

    Returns U

ok

or

orElse

toOption

toOptionError

transpose

tryCatch

  • tryCatch<T>(fn: () => Promise<T>): Promise<ResultType<T, unknown>>
  • tryCatch<T>(fn: () => T): ResultType<T, unknown>

unwrap

unwrapError

unwrapOr

  • unwrapOr<T, E>(res: ResultType<T, E>, defaults: T): T

unwrapOrElse

  • unwrapOrElse<T, E>(res: ResultType<T, E>, defaults: (err: E) => T): T
  • Type parameters

    • T

    • E

    Parameters

    • res: ResultType<T, E>
    • defaults: (err: E) => T
        • (err: E): T
        • Parameters

          • err: E

          Returns T

    Returns T

Generated using TypeDoc