babel-plugin-minify-constant-folding
Advanced tools
Comparing version 0.0.3 to 0.0.4
"use strict"; | ||
var evaluate = require("babel-helper-evaluate-path"); | ||
var jsesc = require("jsesc"); | ||
@@ -18,3 +19,3 @@ module.exports = function (_ref) { | ||
// "a" + b + "c" + "d" -> "a" + b + "cd" | ||
BinaryExpression: function BinaryExpression(path) { | ||
BinaryExpression(path) { | ||
var literal = void 0, | ||
@@ -60,5 +61,4 @@ bin = void 0; | ||
// TODO: look into evaluating binding too (could result in more code, but gzip?) | ||
Expression: function Expression(path) { | ||
Expression(path) { | ||
var node = path.node; | ||
@@ -119,2 +119,9 @@ | ||
// https://github.com/babel/babili/issues/382 | ||
if (typeof res.value === "string") { | ||
res.value = jsesc(res.value, { | ||
isScriptContext: true | ||
}); | ||
} | ||
var _node = t.valueToNode(res.value); | ||
@@ -121,0 +128,0 @@ _node[seen] = true; |
{ | ||
"name": "babel-plugin-minify-constant-folding", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "", | ||
@@ -15,5 +15,6 @@ "homepage": "https://github.com/babel/babili#readme", | ||
"dependencies": { | ||
"babel-helper-evaluate-path": "^0.0.3" | ||
"babel-helper-evaluate-path": "^0.0.3", | ||
"jsesc": "^2.4.0" | ||
}, | ||
"devDependencies": {} | ||
} |
@@ -28,3 +28,3 @@ # babel-plugin-minify-constant-folding | ||
```sh | ||
$ npm install babel-plugin-minify-constant-folding | ||
npm install babel-plugin-minify-constant-folding | ||
``` | ||
@@ -47,3 +47,3 @@ | ||
```sh | ||
$ babel --plugins minify-constant-folding script.js | ||
babel --plugins minify-constant-folding script.js | ||
``` | ||
@@ -50,0 +50,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
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
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
5105
107
2
+ Addedjsesc@^2.4.0
+ Addedjsesc@2.5.2(transitive)