refactor: collapse toZod's enum leaf normalizer to a dummy union (#6533)
Unioning both sides with a private unique symbol forces TypeScript to rebuild each union, which is enough to make an enum reference and the union of exactly its members compare identical — the mapped-key rebuild and its Extract/Exclude split were doing the same job with more machinery. Differentially probed against the previous implementation across 35 cases (fixes, guarantees, numeric-enum nominality, classes with private members) on TypeScript 5.5, 6 and 7.0: observable behavior is identical.
C
Colin McDonnell committed
2ec972ecc5a8af8135ed072d2d5b5363c27bb46f
Parent: 68a609a
Committed by GitHub <noreply@github.com>
on 8/31/2026, 7:07:26 PM