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.5.0-alpha.7b176463 to 0.5.0-alpha.7ba5821f

17

lib/index.js
"use strict";
var flipSeen = Symbol("flipSeen");
const flipSeen = Symbol("flipSeen");

@@ -13,4 +13,3 @@ module.exports = function (t) {

// more nodes that could benifit from flipping than not.
shouldFlip(topNode) {
var savings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
shouldFlip(topNode, savings = 0) {
visit(topNode);

@@ -41,10 +40,10 @@ return savings > 0;

flip(node, resultNotUsed) {
var lastNodeDesc;
var ret = visit(node);
let lastNodeDesc;
const ret = visit(node);
ret[flipSeen] = true;
if (resultNotUsed && lastNodeDesc) {
var _lastNodeDesc = lastNodeDesc,
parent = _lastNodeDesc.parent,
key = _lastNodeDesc.key;
const _lastNodeDesc = lastNodeDesc,
parent = _lastNodeDesc.parent,
key = _lastNodeDesc.key;

@@ -80,3 +79,3 @@ if (parent && key && t.isUnaryExpression(parent[key], {

if (t.isBinaryExpression(node)) {
var operator;
let operator;

@@ -83,0 +82,0 @@ switch (node.operator) {

{
"name": "babel-helper-flip-expressions",
"version": "0.5.0-alpha.7b176463",
"version": "0.5.0-alpha.7ba5821f",
"description": "",

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

@@ -6,3 +6,3 @@ # babel-helper-flip-expressions

```sh
npm install babel-helper-flip-expressions
npm install babel-helper-flip-expressions --save-dev
```
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