@pengzhanbo/utils - v3.4.1
    Preparing search index...

    Function assert

    • Asserts that a condition is true

      断言条件为真

      Parameters

      • condition: boolean

        The condition to assert. 要断言的条件

      • Optionalmessage: string

        The message to display if the condition is false. 如果条件为假时显示的消息

      Returns asserts condition

      If the condition is false. 如果条件为假

      assert(true) // no throw
      assert(false, 'custom message') // throws Error: custom message