core-utils
    Preparing search index...
    • Internal

      Do not use this function directly. Use requiredEnumWithFallback or optionalEnumWithFallback instead. Enum + "invalid -> fallback" with optionality toggle.

      • If optional=true: undefined stays undefined
      • If optional=false: undefined is rejected (normal enum behavior)
      • Fallback must be a member of the enum

      Type Parameters

      • const V extends EnumValues
      • const F extends string

      Parameters

      • values: V
      • fallback: F
      • Optionaloptions: { optional?: false }

      Returns ZodEffects<ZodEnum<V>, V[number], unknown>

    • Internal

      Do not use this function directly. Use requiredEnumWithFallback or optionalEnumWithFallback instead. Enum + "invalid -> fallback" with optionality toggle.

      • If optional=true: undefined stays undefined
      • If optional=false: undefined is rejected (normal enum behavior)
      • Fallback must be a member of the enum

      Type Parameters

      • const V extends EnumValues
      • const F extends string

      Parameters

      • values: V
      • fallback: F
      • options: { optional: true }

      Returns ZodEffects<ZodOptional<ZodEnum<V>>, V[number] | undefined, unknown>