Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-helper-flip-expressions

Package Overview
Dependencies
Maintainers
5
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-helper-flip-expressions - npm Package Compare versions

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

31

lib/index.js

@@ -15,3 +15,2 @@ "use strict";

var savings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
visit(topNode);

@@ -21,3 +20,5 @@ return savings > 0;

function visit(node) {
if (t.isUnaryExpression(node, { operator: "!" })) {
if (t.isUnaryExpression(node, {
operator: "!"
})) {
savings++;

@@ -41,5 +42,4 @@ return;

flip(node, resultNotUsed) {
var lastNodeDesc = void 0;
var lastNodeDesc;
var ret = visit(node);
ret[flipSeen] = true;

@@ -52,3 +52,5 @@

if (parent && key && t.isUnaryExpression(parent[key], { operator: "!" })) {
if (parent && key && t.isUnaryExpression(parent[key], {
operator: "!"
})) {
parent[key] = parent[key].argument;

@@ -61,5 +63,10 @@ }

function visit(node, parent, key) {
lastNodeDesc = { parent, key };
lastNodeDesc = {
parent,
key
};
if (t.isUnaryExpression(node, { operator: "!" })) {
if (t.isUnaryExpression(node, {
operator: "!"
})) {
return node.argument;

@@ -76,3 +83,4 @@ }

if (t.isBinaryExpression(node)) {
var operator = void 0;
var operator;
switch (node.operator) {

@@ -82,8 +90,11 @@ case "!==":

break;
case "===":
operator = "!==";
break;
case "!=":
operator = "==";
break;
case "==":

@@ -97,5 +108,4 @@ operator = "!=";

return node;
}
} // Falls through to unary expression
// Falls through to unary expression
}

@@ -106,3 +116,4 @@

}
};
};
{
"name": "babel-helper-flip-expressions",
"version": "0.4.0-alpha.6546ad11",
"version": "0.4.0-alpha.caaefb4c",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [

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