Paste statements that use the ? : ternary operator, one per line, then click Convert to expand each recognised statement into an if/else block.
Three forms per line: a declaration (const/let/var x = c ? a : b), a plain assignment (x = c ? a : b) and a return (return c ? a : b). Other lines are left unchanged.
No. The nullish coalescing operator ?? and optional chaining ?. are detected and skipped so they are never mistaken for a ternary.
The outer ternary is expanded and any nested ternary is kept intact inside the branch, so the code stays valid — run it again to expand deeper levels.