@vinejs/vine - v4.2.0
    Preparing search index...

    Class VineNull

    VineNull represents a schema type that only accepts null values. Typically used inside union types to explicitly allow null as a valid value.

    const schema = vine.union([
    vine.string(),
    vine.null()
    ])

    const result = await vine.validate({
    schema,
    data: null
    })

    Implements

    Index

    Constructors

    Properties

    "[ITYPE]": null

    The input type of the schema (type-only property)

    "[OTYPE]": null

    The output type of the schema (type-only property)

    "[COTYPE]": null

    The camelCase output type of the schema (type-only property)

    "[SUBTYPE]": string = 'null'

    The subtype identifier for the literal schema field

    "[UNIQUE_NAME]": string = 'vine.null'

    Unique name identifier for union type resolution

    Methods

    • Type checker function to determine if a value is null. Required for "unionOfTypes" functionality.

      Parameters

      • value: unknown

        The value to check

      Returns value is null

      True if the value is null

    • Compiles the schema type to a compiler node for validation.

      Parameters

      • propertyName: string

        The name of the property being validated

      • refs: RefsStore

        Reference store for tracking parsers and validators

      • options: ParserOptions

        Parser options including camelCase conversion

      Returns FieldNode & {} & { subtype: string }