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

    Type Alias UnionNoMatchCallback<Input>

    UnionNoMatchCallback: (value: Input, field: FieldContext) => any

    Callback function invoked when a union schema cannot match any of its variants. Allows for custom error handling or fallback logic when union validation fails.

    Type Parameters

    • Input

      The type of the input value

    Type Declaration

      • (value: Input, field: FieldContext): any
      • Parameters

        • value: Input

          The input value that couldn't be matched

        • field: FieldContext

          Context information about the field being validated

        Returns any

        Custom error or fallback value

    const noMatchCallback: UnionNoMatchCallback<unknown> = (value, field) => {
    throw new Error(`No union variant matched for field ${field.name}`)
    }