What it changes
Rewrites eligibleswitch statements as equivalent if statements, using a
labeled block when fallthrough must be preserved. Switches whose shared case
scope cannot be preserved stay unchanged.
Before and after
Configuration
Run this transform by settingtransforms.switchToIf to true:
obfuscate.mjs
View the implementation
Open the TypeScript implementation on GitHub.
Read the behavior tests
Review behavior checks and cases this transform leaves alone.