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

    Class OptionalModifier<Schema>

    Modifies a literal schema type to allow undefined values in addition to the original type. This modifier is used for form fields that may not be present in 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

    Camelcase output type with undefined support

    validations: Validation<any>[]

    List of additional validations to apply to non-undefined values

    Methods