Function toMaybe

  • Convert a Result to a Maybe.Maybe Maybe.

    The converted type will be Maybe.Just Just if the Result is Ok or Maybe.Nothing Nothing if the Result is Err; the wrapped error value will be discarded.

    Type Parameters

    • T

    Parameters

    • result: Result<T, unknown>

      The Result to convert to a Maybe

    Returns Maybe<T>

    Just the value in result if it is Ok; otherwise Nothing

Generated using TypeDoc