1.0.1 • Published 3 years ago

babel-plugin-simplify-ternary-expressions v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
3 years ago

simplify-ternary-expressions

When a ternary expression is found, and the value is not used, it is converted to an If statement. Alternatively, if the value is used in a return statement, it is converted to an If statement with return statements on both branches.

When a logical expression is found, and the value is not used, it is converted to an If statement.

Options:

  • convertReturnStatements: Whether or not to convert ternary expressions in return statements.