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

@babel/plugin-proposal-object-rest-spread

Package Overview
Dependencies
Maintainers
5
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-object-rest-spread - npm Package Compare versions

Comparing version 7.9.5 to 7.9.6

51

lib/index.js

@@ -421,23 +421,2 @@ "use strict";

if (!hasSpread(path.node)) return;
const args = [];
let props = [];
function push() {
args.push(_core.types.objectExpression(props));
props = [];
}
for (const prop of path.node.properties) {
if (_core.types.isSpreadElement(prop)) {
push();
args.push(prop.argument);
} else {
props.push(prop);
}
}
if (props.length) {
push();
}
let helper;

@@ -456,3 +435,31 @@

path.replaceWith(_core.types.callExpression(helper, args));
let exp = null;
let props = [];
function make() {
const hadProps = props.length > 0;
const obj = _core.types.objectExpression(props);
props = [];
if (!exp) {
exp = _core.types.callExpression(helper, [obj]);
return;
}
exp = _core.types.callExpression(_core.types.cloneNode(helper), [exp, ...(hadProps ? [_core.types.objectExpression([]), obj] : [])]);
}
for (const prop of path.node.properties) {
if (_core.types.isSpreadElement(prop)) {
make();
exp.arguments.push(prop.argument);
} else {
props.push(prop);
}
}
if (props.length) make();
path.replaceWith(exp);
}

@@ -459,0 +466,0 @@

{
"name": "@babel/plugin-proposal-object-rest-spread",
"version": "7.9.5",
"version": "7.9.6",
"description": "Compile object rest and spread to ES5",

@@ -23,6 +23,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread",

"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/core": "^7.9.6",
"@babel/helper-plugin-test-runner": "^7.8.3"
},
"gitHead": "5b97e77e030cf3853a147fdff81844ea4026219d"
"gitHead": "9c2846bcacc75aa931ea9d556950c2113765d43d"
}
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