Los switch statements filtran bugs en tiempo de compilación
Los switch statements de TypeScript te dejan olvidar casos en silencio. Así es cómo reemplazarlos con patrones de exhaustividad que hacen fallar el build en lugar del runtime.
Refactorizaste un tipo shape, agregaste una nueva variante, y TypeScript se mantuvo verde. Tu CI pasó. Tu deploy salió. Entonces un usuario entró en una branch…