core-utils
    Preparing search index...
    • Internal

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

      • If optional=true: undefined stays undefined
      • If optional=false: undefined is rejected (normal enum behavior)
      • Invalid values are coerced to ENUM_FALLBACK ("UNRECOGNIZED_")

      Type Parameters

      • const V extends EnumValues

      Parameters

      • values: NarrowEnum<V>
      • Optionaloptions: { optional?: false }

      Returns ZodEffects<ZodEnum<[...V[], "UNRECOGNIZED_"]>>

    • Internal

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

      • If optional=true: undefined stays undefined
      • If optional=false: undefined is rejected (normal enum behavior)
      • Invalid values are coerced to ENUM_FALLBACK ("UNRECOGNIZED_")

      Type Parameters

      • const V extends EnumValues

      Parameters

      • values: NarrowEnum<V>
      • options: { optional: true }

      Returns ZodEffects<ZodOptional<ZodEnum<[...V[], "UNRECOGNIZED_"]>>>