Library API
    Preparing search index...

    Function assertCondition

    • Asserts a condition is true, otherwise throws an Error.

      Parameters

      • condition: boolean

        The boolean condition that must be true

      • Optionalmessage: string

        The error message to throw if the condition is false

      Returns asserts condition

      If the condition evaluates to false

      assertCondition(user.isLoggedIn, 'User must be logged in');