Socket
Socket
Sign inDemoInstall

@babel/helper-member-expression-to-functions

Package Overview
Dependencies
4
Maintainers
6
Versions
70
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.12.17 to 7.13.0

22

lib/index.js

@@ -133,3 +133,3 @@ 'use strict';

handle(member) {
handle(member, noDocumentAll) {
const {

@@ -264,7 +264,23 @@ node,

const baseMemoised = baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef);
if (willEndPathCastToBoolean) {
const nonNullishCheck = t.logicalExpression("&&", t.binaryExpression("!==", baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression("!==", t.cloneNode(baseRef), scope.buildUndefinedNode()));
let nonNullishCheck;
if (noDocumentAll) {
nonNullishCheck = t.binaryExpression("!=", baseMemoised, t.nullLiteral());
} else {
nonNullishCheck = t.logicalExpression("&&", t.binaryExpression("!==", baseMemoised, t.nullLiteral()), t.binaryExpression("!==", t.cloneNode(baseRef), scope.buildUndefinedNode()));
}
replacementPath.replaceWith(t.logicalExpression("&&", nonNullishCheck, regular));
} else {
const nullishCheck = t.logicalExpression("||", t.binaryExpression("===", baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode()));
let nullishCheck;
if (noDocumentAll) {
nullishCheck = t.binaryExpression("==", baseMemoised, t.nullLiteral());
} else {
nullishCheck = t.logicalExpression("||", t.binaryExpression("===", baseMemoised, t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode()));
}
replacementPath.replaceWith(t.conditionalExpression(nullishCheck, isDeleteOperation ? t.booleanLiteral(true) : scope.buildUndefinedNode(), regular));

@@ -271,0 +287,0 @@ }

4

package.json
{
"name": "@babel/helper-member-expression-to-functions",
"version": "7.12.17",
"version": "7.13.0",
"description": "Helper function to replace certain member expressions with function calls",

@@ -18,4 +18,4 @@ "repository": {

"dependencies": {
"@babel/types": "^7.12.17"
"@babel/types": "^7.13.0"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc