babel-plugin-minify-constant-folding
Advanced tools
Comparing version 0.3.0-alpha.e6a189cd to 0.3.0
@@ -63,15 +63,22 @@ "use strict"; | ||
BinaryExpression(path) { | ||
if (!path.isBinaryExpression({ operator: "+" })) { | ||
return; | ||
} | ||
var literal = void 0, | ||
bin = void 0; | ||
if (path.get("right").isStringLiteral()) { | ||
literal = path.get("right"); | ||
if (path.get("left").isBinaryExpression({ operator: "+" })) { | ||
bin = path.get("left"); | ||
var left = path.get("left"); | ||
var right = path.get("right"); | ||
if (right.isStringLiteral()) { | ||
literal = right; | ||
if (left.isBinaryExpression({ operator: "+" })) { | ||
bin = left; | ||
} else { | ||
return; | ||
} | ||
} else if (path.get("left").isStringLiteral()) { | ||
literal = path.get("left"); | ||
if (path.get("right").isBinaryExpression({ operator: "+" })) { | ||
bin = path.get("right"); | ||
} else if (left.isStringLiteral()) { | ||
literal = left; | ||
if (right.isBinaryExpression({ operator: "+" })) { | ||
bin = right; | ||
} else { | ||
@@ -78,0 +85,0 @@ return; |
{ | ||
"name": "babel-plugin-minify-constant-folding", | ||
"version": "0.3.0-alpha.e6a189cd", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -15,4 +15,4 @@ "keywords": [ | ||
"dependencies": { | ||
"babel-helper-evaluate-path": "^0.3.0-alpha.e6a189cd" | ||
"babel-helper-evaluate-path": "^0.3.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
12974
319