babel-plugin-minify-simplify
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -267,2 +267,6 @@ "use strict"; | ||
if (path.node.operator !== "=") { | ||
return; | ||
} | ||
var canBeUpdateExpression = rightExpr.get("right").isNumericLiteral() && rightExpr.get("right").node.value === 1 && updateOperators.has(rightExpr.node.operator); | ||
@@ -269,0 +273,0 @@ |
{ | ||
"name": "babel-plugin-minify-simplify", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "", | ||
@@ -15,7 +15,7 @@ "homepage": "https://github.com/babel/babili#readme", | ||
"dependencies": { | ||
"babel-helper-flip-expressions": "^0.0.1", | ||
"babel-helper-flip-expressions": "^0.0.2", | ||
"babel-helper-is-nodes-equiv": "^0.0.1", | ||
"babel-helper-to-multiple-sequence-expressions": "^0.0.2" | ||
"babel-helper-to-multiple-sequence-expressions": "^0.0.3" | ||
}, | ||
"devDependencies": {} | ||
} |
# babel-plugin-minify-simplify | ||
This plugin will transform code in mainly two ways: | ||
> Simplifies code for minification by reducing statements into expressions and making expressions uniform where possible. | ||
1. Reduce as much statements as possible into expressions | ||
## Example | ||
### Reduce statement into expression | ||
**In** | ||
```js | ||
@@ -19,2 +22,3 @@ function foo() { | ||
**Out** | ||
```js | ||
@@ -29,5 +33,6 @@ function foo() { | ||
2. Make expressions as uniform as possible for better compressibility | ||
### Make expression as uniform as possible for better compressibility | ||
**In** | ||
```js | ||
@@ -40,2 +45,3 @@ undefined | ||
**Out** | ||
```js | ||
@@ -51,3 +57,3 @@ void 0 | ||
```sh | ||
$ npm install babel-plugin-minify-simplify | ||
npm install babel-plugin-minify-simplify | ||
``` | ||
@@ -70,3 +76,3 @@ | ||
```sh | ||
$ babel --plugins minify-simplify script.js | ||
babel --plugins minify-simplify script.js | ||
``` | ||
@@ -73,0 +79,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
56812
1424
82
0
+ Addedbabel-helper-flip-expressions@0.0.2(transitive)
+ Addedbabel-helper-to-multiple-sequence-expressions@0.0.3(transitive)
- Removedbabel-helper-flip-expressions@0.0.1(transitive)
- Removedbabel-helper-to-multiple-sequence-expressions@0.0.2(transitive)