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

    Class OptionalModifier<Schema>

    Modifies the schema type to allow undefined values in addition to the original schema type. This is useful for form fields that may not be present in the submitted data.

    const schema = vine.string().optional()
    // Accepts: "hello", undefined
    // Rejects: null (unless also nullable), 123

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    "[ITYPE]": Schema[typeof ITYPE] | null | undefined

    Define the input type of the schema, including undefined and null

    "[OTYPE]": Schema[typeof OTYPE] | undefined

    The output value of the field with undefined support. The property points to a type only and not the real value.

    "[COTYPE]": Schema[typeof COTYPE] | undefined

    Type marker for camelCase output type inference

    validations: Validation<any>[]

    List of validations to apply to non-undefined values

    Methods