What it changes
Rewrites nullish-coalescing expressions as equivalent conditional expressions while evaluating the left operand once.Before and after
Configuration
Run this transform by settingtransforms.nullishCoalescingToTernary 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.