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.1.3 to 0.2.0

8

lib/index.js

@@ -103,3 +103,7 @@ "use strict";

// TODO: look into evaluating binding too (could result in more code, but gzip?)
Expression(path) {
Expression(path, _ref) {
var _ref$opts = _ref.opts;
_ref$opts = _ref$opts === undefined ? {} : _ref$opts;
var _ref$opts$tdz = _ref$opts.tdz,
tdz = _ref$opts$tdz === undefined ? false : _ref$opts$tdz;
var node = path.node;

@@ -142,3 +146,3 @@

var res = evaluate(path);
var res = evaluate(path, { tdz });
if (res.confident) {

@@ -145,0 +149,0 @@ // Avoid fractions because they can be longer than the original expression.

@@ -32,5 +32,15 @@ "use strict";

length() {
if (this.elements.some(function (el) {
return t.isSpreadElement(el);
})) {
return;
}
return t.numericLiteral(this.elements.length);
},
[FALLBACK_HANDLER](i) {
if (this.elements.some(function (el) {
return t.isSpreadElement(el);
})) {
return;
}
if (typeof i === "number" || i.match(/^\d+$/)) {

@@ -37,0 +47,0 @@ return this.elements[i] || undef;

{
"name": "babel-plugin-minify-constant-folding",
"version": "0.1.3",
"version": "0.2.0",
"description": "",
"homepage": "https://github.com/babel/babili#readme",
"repository": "https://github.com/babel/babili/tree/master/packages/babel-plugin-minify-constant-folding",
"bugs": "https://github.com/babel/babili/issues",
"author": "amasad",
"license": "MIT",
"main": "lib/index.js",
"keywords": [
"babel-plugin"
],
"homepage": "https://github.com/babel/minify#readme",
"bugs": "https://github.com/babel/minify/issues",
"license": "MIT",
"author": "amasad",
"main": "lib/index.js",
"repository": "https://github.com/babel/minify/tree/master/packages/babel-plugin-minify-constant-folding",
"dependencies": {
"babel-helper-evaluate-path": "^0.1.0"
"babel-helper-evaluate-path": "^0.2.0"
}
}

@@ -87,1 +87,5 @@ # babel-plugin-minify-constant-folding

```
## Options
+ `tdz` - Account for TDZ (Temporal Dead Zone)
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