Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-object-rest-spread

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-object-rest-spread - npm Package Compare versions

Comparing version 7.0.0-alpha.9 to 7.0.0-alpha.10

29

lib/index.js

@@ -75,2 +75,10 @@ "use strict";

if (paramPath.isArrayPattern() && hasRestElement(paramPath)) {
var elements = paramPath.get("elements");
for (var _i3 = 0; _i3 < elements.length; _i3++) {
replaceRestElement(parentPath, elements[_i3], _i3, elements.length);
}
}
if (paramPath.isObjectPattern() && hasRestElement(paramPath)) {

@@ -118,6 +126,7 @@ var uid = parentPath.scope.generateUidIdentifier("ref");

var ref = this.originalPath.node.init;
var refPropertyPath = [];
path.findParent(function (path) {
if (path.isObjectProperty()) {
ref = t.memberExpression(ref, t.identifier(path.node.key.name));
refPropertyPath.unshift(path.node.key.name);
} else if (path.isVariableDeclarator()) {

@@ -128,2 +137,8 @@ return true;

if (refPropertyPath.length) {
refPropertyPath.forEach(function (prop) {
ref = t.memberExpression(ref, t.identifier(prop));
});
}
var _createObjectSpread = createObjectSpread(file, path.parentPath.node.properties, ref),

@@ -242,12 +257,12 @@ argument = _createObjectSpread[0],

for (var _iterator3 = path.node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
for (var _iterator3 = path.node.properties, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
var _ref4;
if (_isArray3) {
if (_i3 >= _iterator3.length) break;
_ref4 = _iterator3[_i3++];
if (_i4 >= _iterator3.length) break;
_ref4 = _iterator3[_i4++];
} else {
_i3 = _iterator3.next();
if (_i3.done) break;
_ref4 = _i3.value;
_i4 = _iterator3.next();
if (_i4.done) break;
_ref4 = _i4.value;
}

@@ -254,0 +269,0 @@

{
"name": "babel-plugin-transform-object-rest-spread",
"version": "7.0.0-alpha.9",
"version": "7.0.0-alpha.10",
"description": "Compile object rest and spread to ES5",

@@ -15,4 +15,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread",

"devDependencies": {
"babel-helper-plugin-test-runner": "7.0.0-alpha.9"
"babel-helper-plugin-test-runner": "7.0.0-alpha.10"
}
}
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