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
4
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.0.1 to 0.0.2

18

lib/index.js

@@ -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
```
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