Function assertNotError

  • Checks if given value is Error if it's subclass and then throw it.

    Type Parameters

    • T

    Parameters

    • value: Error | T

      any value

    Returns T

    value if it is not an instance of Error

    Example

    const value = new Error()
    const value2 = assertNotError(value)
    // throws error

    Throws

    value if it is an instance of Error

Generated using TypeDoc