Skip to main content

$validator

Callable

  • $validator<T>(node: T, options?: Partial<ValidatorOptions>): T

  • Enable the generation of validator code to this schema.

    Example

    $validator(
    $object({
    foo: $string,
    })
    )

    Type parameters

    Parameters

    • node: T

      The schema to enable the validator for.

    • options: Partial<ValidatorOptions> = {}

      The validator options.

    Returns T