Function toOkOrErr

  • Transform the Maybe into a Result.Result Result, using the wrapped value as the Ok value if Just; otherwise using the supplied error value for Err.

    Type Parameters

    • T

    • E

    Parameters

    • error: E

      The error value to use if the Maybe is Nothing.

    • maybe: Maybe<T>

      The Maybe instance to convert.

    Returns Result<T, E>

    A Result containing the value wrapped in maybe in an Ok, or error in an Err.

    Typeparam

    T The wrapped value.

    Typeparam

    E The error type to in the Result.

  • Type Parameters

    • T

    • E

    Parameters

    • error: E

    Returns ((maybe) => Result<T, E>)

Generated using TypeDoc