• Wraps the return value of body into a Result.

    Type Parameters

    • E

    Parameters

    • catcher: ((err) => E)

      The function to cast an error from body.

        • (err): E
        • Parameters

          • err: unknown

          Returns E

    Returns (<A, R>(body) => ((...args) => Result<E, R>))

    The wrapped function.

      • <A, R>(body): ((...args) => Result<E, R>)
      • Type Parameters

        • A extends unknown[]

        • R

        Parameters

        • body: ((...args) => R)
            • (...args): R
            • Parameters

              • Rest ...args: A

              Returns R

        Returns ((...args) => Result<E, R>)

          • (...args): Result<E, R>
          • Parameters

            • Rest ...args: A

            Returns Result<E, R>

Generated using TypeDoc