• Asserts a condition is truthy, otherwise throws an error

    Parameters

    • condition: unknown
    • Optional message: string

    Returns asserts condition

    Remarks

    Useful at the top of functions to ensure certain conditions, arguments and properties are set/met before continuing. When using this function, TypeScript will narrow away falsy types from the condition.

Generated using TypeDoc