Skip to main content

Validators

Readonly normalized collection of composable validators for a node value.

Import​

import type { Validators } from '@ngblocks/form-nodes';

When to use it​

Use for a normalized readonly collection of composable rules. Use ValidatorSource for public inputs that also accept a single validator or nullish entries.

Declaration​

type Validators<TValue, TField extends AnyNode = ValidatorNode> = readonly ComposableValidator<TValue, TField>[];

Type parameters​

ParameterConstraintDefault
TValueUnconstrainedRequired
TFieldAnyNodeValidatorNode