babel-helper-flip-expressions
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -7,11 +7,10 @@ "use strict"; | ||
return { | ||
hasSeen: function hasSeen(node) { | ||
hasSeen(node) { | ||
return !!node[flipSeen]; | ||
}, | ||
// Takes an expressions and determines if it has | ||
// more nodes that could benifit from flipping than not. | ||
shouldFlip: function shouldFlip(topNode) { | ||
var savings = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; | ||
shouldFlip(topNode) { | ||
var savings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | ||
@@ -39,3 +38,4 @@ visit(topNode); | ||
}, | ||
flip: function flip(node, resultNotUsed) { | ||
flip(node, resultNotUsed) { | ||
var lastNodeDesc = void 0; | ||
@@ -47,5 +47,5 @@ var ret = visit(node); | ||
if (resultNotUsed && lastNodeDesc) { | ||
var _lastNodeDesc = lastNodeDesc; | ||
var parent = _lastNodeDesc.parent; | ||
var key = _lastNodeDesc.key; | ||
var _lastNodeDesc = lastNodeDesc, | ||
parent = _lastNodeDesc.parent, | ||
key = _lastNodeDesc.key; | ||
@@ -60,3 +60,3 @@ if (parent && key && t.isUnaryExpression(parent[key], { operator: "!" })) { | ||
function visit(node, parent, key) { | ||
lastNodeDesc = { parent: parent, key: key }; | ||
lastNodeDesc = { parent, key }; | ||
@@ -63,0 +63,0 @@ if (t.isUnaryExpression(node, { operator: "!" })) { |
{ | ||
"name": "babel-helper-flip-expressions", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/babel/babili#readme", |
@@ -6,3 +6,3 @@ # babel-helper-flip-expressions | ||
```sh | ||
$ npm install babel-helper-flip-expressions | ||
npm install babel-helper-flip-expressions | ||
``` |
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
3017
1