Socket
Socket
Sign inDemoInstall

babel-plugin-minify-guarded-expressions

Package Overview
Dependencies
Maintainers
5
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-minify-guarded-expressions - npm Package Compare versions

Comparing version 0.4.0-alpha.6546ad11 to 0.4.0-alpha.caaefb4c

16

lib/index.js

@@ -18,8 +18,4 @@ "use strict";

var node = path.node;
var left = path.get("left");
var right = path.get("right");
// issues - 171, 174, 176
var right = path.get("right"); // issues - 171, 174, 176
// we assume that it is returned/assigned/part of a bigger expression

@@ -31,2 +27,3 @@ // or utilized somehow

// we can safely replace the entire expression
var shouldBail = !path.parentPath.isExpressionStatement();

@@ -36,2 +33,3 @@

var leftTruthy = left.evaluateTruthy();
if (leftTruthy === false) {

@@ -47,2 +45,3 @@ // Short-circuit

var _leftTruthy = left.evaluateTruthy();
if (_leftTruthy === false && left.isPure()) {

@@ -60,3 +59,2 @@ path.replaceWith(node.right);

if (flipExpressions.hasSeen(node)) {

@@ -68,6 +66,6 @@ return;

return;
}
} // Start counting savings from one since we can ignore the last
// expression.
// Start counting savings from one since we can ignore the last
// expression.
if (flipExpressions.shouldFlip(node, 1)) {

@@ -74,0 +72,0 @@ var newNode = flipExpressions.flip(node, true);

{
"name": "babel-plugin-minify-guarded-expressions",
"version": "0.4.0-alpha.6546ad11",
"version": "0.4.0-alpha.caaefb4c",
"description": "",

@@ -15,4 +15,4 @@ "keywords": [

"dependencies": {
"babel-helper-flip-expressions": "^0.4.0-alpha.6546ad11"
"babel-helper-flip-expressions": "^0.4.0-alpha.caaefb4c"
}
}

@@ -46,5 +46,5 @@ # babel-plugin-minify-guarded-expressions

```javascript
require("babel-core").transform("code", {
require("@babel/core").transform("code", {
plugins: ["minify-guarded-expressions"]
});
```
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