Keep a numeric TS enum's reverse-mapping keys out of `.options` (#6542)
`z.enum()` accepts a TypeScript enum, whose runtime object carries both directions of the mapping. The parse set already drops the reverse half via `util.getEnumValues`, but `.options` was assigned straight from `Object.values(def.entries)`, so a three-member numeric enum reported six options — three of which `.parse()` rejects, and none of which its declared `Array<T[keyof T]>` type admits. Assign from the value set core already built instead. Classic and mini both carried the line.
C
Colin McDonnell committed
90269c601aae25499ee87e78a07508564825867f
Parent: 18e71c7
Committed by GitHub <noreply@github.com>
on 8/31/2026, 11:26:59 PM