Type alias ReusableValidator<T>

ReusableValidator<T>: ((value, label?) => void)

A reusable validator.

Type Parameters

  • T

Type declaration

    • (value, label?): void
    • Test if the value matches the predicate. Throws an ArgumentError if the test fails.

      Parameters

      • value: unknown

        Value to test.

      • Optional label: string

        Override the label which should be used in error messages.

      Returns void