After many trial and errors, this seem to be the best way to remove
break stmts in switch cases,
This change targets only last break in last case of switch smts if its
unlabelled
this change differs from #23914 as its no longer targets all branches as
that should not be no longer necessary if all cases are correctly
rewritten
https://github.com/oxc-project/oxc/issues/24672
-----
cases like `switch (a) { case 3: if (b) break; }` are not changed
-----
ref: #17544
Pure refactor.
Remove a few remaining instances of the pattern where we destructure global objects at top level e.g. `const { isArray } = Array;`.
In Oxlint, TSDown plugin already performs this optimization. In `napi/parser`, we intend to build the package with TSDown, and we'll apply the same optimization in build process then too.
By hoisting `let enter;` up out of the the `if` block, minifier is able to convert the `if` statement into a `&&` expression, resulting in tighter minified output.
This optimization is only visible in the bundled output, as that's where we do more aggressive minification.