Socket
Socket
Sign inDemoInstall

@babel/helper-explode-assignable-expression

Package Overview
Dependencies
32
Maintainers
5
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.1.0 to 7.7.0

40

lib/index.js

@@ -8,20 +8,14 @@ "use strict";

function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function getObjRef(node, nodes, file, scope) {
let ref;
if (t().isSuper(node)) {
if (t.isSuper(node)) {
return node;
} else if (t().isIdentifier(node)) {
} else if (t.isIdentifier(node)) {
if (scope.hasBinding(node.name)) {

@@ -32,6 +26,6 @@ return node;

}
} else if (t().isMemberExpression(node)) {
} else if (t.isMemberExpression(node)) {
ref = node.object;
if (t().isSuper(ref) || t().isIdentifier(ref) && scope.hasBinding(ref.name)) {
if (t.isSuper(ref) || t.isIdentifier(ref) && scope.hasBinding(ref.name)) {
return ref;

@@ -47,3 +41,3 @@ }

});
nodes.push(t().assignmentExpression("=", t().cloneNode(temp), t().cloneNode(ref)));
nodes.push(t.assignmentExpression("=", t.cloneNode(temp), t.cloneNode(ref)));
return temp;

@@ -54,4 +48,4 @@ }

const prop = node.property;
const key = t().toComputedKey(node, prop);
if (t().isLiteral(key) && t().isPureish(key)) return key;
const key = t.toComputedKey(node, prop);
if (t.isLiteral(key) && t.isPureish(key)) return key;
const temp = scope.generateUidIdentifierBasedOnNode(prop);

@@ -61,3 +55,3 @@ scope.push({

});
nodes.push(t().assignmentExpression("=", t().cloneNode(temp), t().cloneNode(prop)));
nodes.push(t.assignmentExpression("=", t.cloneNode(temp), t.cloneNode(prop)));
return temp;

@@ -69,3 +63,3 @@ }

if (t().isIdentifier(node) && allowedSingleIdent) {
if (t.isIdentifier(node) && allowedSingleIdent) {
obj = node;

@@ -78,10 +72,10 @@ } else {

if (t().isIdentifier(node)) {
ref = t().cloneNode(node);
if (t.isIdentifier(node)) {
ref = t.cloneNode(node);
uid = obj;
} else {
const prop = getPropRef(node, nodes, file, scope);
const computed = node.computed || t().isLiteral(prop);
uid = t().memberExpression(t().cloneNode(obj), t().cloneNode(prop), computed);
ref = t().memberExpression(t().cloneNode(obj), t().cloneNode(prop), computed);
const computed = node.computed || t.isLiteral(prop);
uid = t.memberExpression(t.cloneNode(obj), t.cloneNode(prop), computed);
ref = t.memberExpression(t.cloneNode(obj), t.cloneNode(prop), computed);
}

@@ -88,0 +82,0 @@

{
"name": "@babel/helper-explode-assignable-expression",
"version": "7.1.0",
"version": "7.7.0",
"description": "Helper function to explode an assignable expression",

@@ -12,5 +12,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression",

"dependencies": {
"@babel/traverse": "^7.1.0",
"@babel/types": "^7.0.0"
}
"@babel/traverse": "^7.7.0",
"@babel/types": "^7.7.0"
},
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea"
}

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