Function catchWrap

  • Wrap the supplied function, returning a function that is the equivalent of calling it with catcher.

    Returned function will preserve up to 10 overload signatures, adding the return type of the caughtValue (or undefined if not provided).

    Type Parameters

    • F extends ((...a) => any)

    Parameters

    • fn: F

    Returns AddReturnType<F, undefined>

  • Type Parameters

    • F extends ((...a) => any)

    • E

    Parameters

    • fn: F
    • caughtValue: E

    Returns AddReturnType<F, E>

Generated using TypeDoc