Function default

  • Test if the value matches the predicate. Throws an ArgumentError if the test fails.

    Type Parameters

    • T

    Parameters

    • value: unknown

      Value to test.

    • predicate: BasePredicate<T>

      Predicate to test against.

    Returns asserts value is T

  • Test if value matches the provided predicate. Throws an ArgumentError with the specified label if the test fails.

    Type Parameters

    • T

    Parameters

    • value: unknown

      Value to test.

    • label: string

      Label which should be used in error messages.

    • predicate: BasePredicate<T>

      Predicate to test against.

    Returns asserts value is T