Class Operate

Constructors

Methods

  • For an input of a result or null, the returning function returns the result if not null, or a successful result of value if null.

    Type Parameters

    • T extends Break<any, any>
    • U

    Parameters

    • value: U

    Returns UnaryFn<T, Fallback<T, U>>

  • Allows to optionally convert an input successful result into a failed result with the same data, and vice-versa.

    Type Parameters

    • T extends Break<any, any>
    • U extends boolean | Empty
    • V extends boolean | Empty

    Parameters

    • OptionalonSuccess: U

      whether to flip a successful result to a failed result

    • OptionalonFailure: V

      whether to flip a failed result to a successful result

    Returns UnaryFn<T, Flip<T, U, V>>

  • Maps a result to a result with different data values.

    Type Parameters

    Parameters

    • OptionalonSuccess: U
    • OptionalonFailure: V

    Returns UnaryFn<T, Map<T, U, V>>

  • Allows for the execution of side effects upon a successful or failed result.

    Type Parameters

    • T extends Break<any, any>

    Parameters

    Returns UnaryFn<T, T>