@kayahr/assert
    Preparing search index...

    Function assertContain

    Asserts that the given item is contained within the given container.

    Examples:

    assertContain([ 1, 2, 3 ], 2);
    assertContain("The fox thingy jumps over some other thingy, whatever...", "fox");

    The container. Can be an array or a string.

    The item to search in the container. Must be a string if container is a string.

    Optional reason added to exception message when assertion fails.

    AssertionError when item is not found in container.

    • Parameters

      • container: string
      • item: string
      • Optionalreason: string

      Returns void

    • Type Parameters

      • T

      Parameters

      • container: T[]
      • item: T
      • Optionalreason: string

      Returns void