babel-plugin-simplify-ternary-expressions
v1.0.1
Published
Babel plugin to convert ternary expression statements into if statements
Downloads
9
Readme
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.