• Asserts a condition is truthy, otherwise throws an error

    Parameters

    • condition: unknown
    • Optionalmessage: string

    Returns asserts condition

    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.