Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-destructuring

Package Overview
Dependencies
54
Maintainers
4
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.1.2 to 7.1.3

23

lib/index.js

@@ -163,3 +163,4 @@ "use strict";

pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) {
let keys = [];
const keys = [];
let allLiteral = true;

@@ -170,9 +171,12 @@ for (let i = 0; i < pattern.properties.length; i++) {

if (_core().types.isRestElement(prop)) continue;
let key = prop.key;
const key = prop.key;
if (_core().types.isIdentifier(key) && !prop.computed) {
key = _core().types.stringLiteral(prop.key.name);
keys.push(_core().types.stringLiteral(key.name));
} else if (_core().types.isLiteral(key)) {
keys.push(_core().types.stringLiteral(String(key.value)));
} else {
keys.push(_core().types.cloneNode(key));
allLiteral = false;
}
keys.push(_core().types.cloneNode(key));
}

@@ -185,4 +189,9 @@

} else {
keys = _core().types.arrayExpression(keys);
value = _core().types.callExpression(this.addHelper(`objectWithoutProperties${loose ? "Loose" : ""}`), [_core().types.cloneNode(objRef), keys]);
let keyExpression = _core().types.arrayExpression(keys);
if (!allLiteral) {
keyExpression = _core().types.callExpression(_core().types.memberExpression(keyExpression, _core().types.identifier("map")), [this.addHelper("toPropertyKey")]);
}
value = _core().types.callExpression(this.addHelper(`objectWithoutProperties${loose ? "Loose" : ""}`), [_core().types.cloneNode(objRef), keyExpression]);
}

@@ -189,0 +198,0 @@

{
"name": "@babel/plugin-transform-destructuring",
"version": "7.1.2",
"version": "7.1.3",
"description": "Compile ES2015 destructuring to ES5",

@@ -5,0 +5,0 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring",

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