Type alias Validator<U, V>

Validator<U, V>: ((value: U) => [true, V] | [false, unknown])

Type Parameters

Type declaration

    • (value: U): [true, V] | [false, unknown]
    • An input validator. A function which checks whether an input is valid and transforms that input.

      Returns

      Returns a tuple containing whether the input is valid and the transformed input. Note that if the input is not valid, then the transformed input will be a bogus value.

      Parameters

      • value: U

      Returns [true, V] | [false, unknown]

Generated using TypeDoc