Socket
Socket
Sign inDemoInstall

babel-plugin-minify-constant-folding

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-minify-constant-folding - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

13

lib/index.js
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc