@vinejs/vine - v4.0.0-next.1
    Preparing search index...

    Type Alias ValidationRule<Options>

    A validation rule combines a validator function with metadata needed for compilation and execution. This is the building block of all validation logic in Vine.

    Think of this type as "Validator" + "metadata"

    const minLengthRule: ValidationRule<{ length: number }> = {
    validator: minLengthValidator,
    name: 'minLength',
    isAsync: false,
    implicit: false
    }
    type ValidationRule<Options extends any> = {
        validator: Validator<Options>;
        name: string;
        isAsync: boolean;
        implicit: boolean;
    }

    Type Parameters

    • Options extends any

      The type of options the validator accepts

    Index

    Properties

    validator: Validator<Options>

    The validation function to execute

    name: string

    Unique name for the validation rule

    isAsync: boolean

    Whether the validator returns a Promise

    implicit: boolean

    Whether the rule runs even when the field value is undefined/null