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.0.0-beta.47 to 7.0.0-beta.48

90

lib/index.js

@@ -11,3 +11,3 @@ "use strict";

_helperPluginUtils = function _helperPluginUtils() {
_helperPluginUtils = function () {
return data;

@@ -22,3 +22,3 @@ };

_pluginSyntaxObjectRestSpread = function _pluginSyntaxObjectRestSpread() {
_pluginSyntaxObjectRestSpread = function () {
return data;

@@ -33,3 +33,3 @@ };

_core = function _core() {
_core = function () {
return data;

@@ -45,6 +45,6 @@ };

api.assertVersion(7);
const _opts$useBuiltIns = opts.useBuiltIns,
useBuiltIns = _opts$useBuiltIns === void 0 ? false : _opts$useBuiltIns,
_opts$loose = opts.loose,
loose = _opts$loose === void 0 ? false : _opts$loose;
const {
useBuiltIns = false,
loose = false
} = opts;

@@ -83,16 +83,3 @@ if (typeof loose !== "boolean") {

function hasSpread(node) {
for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
const prop = _ref;
for (const prop of node.properties) {
if (_core().types.isSpreadElement(prop)) {

@@ -111,16 +98,3 @@ return true;

for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done) break;
_ref2 = _i2.value;
}
const prop = _ref2;
for (const prop of props) {
if (_core().types.isIdentifier(prop.key) && !prop.computed) {

@@ -145,15 +119,3 @@ keys.push(_core().types.stringLiteral(prop.key.name));

for (var _iterator3 = path.get("properties"), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
var _ref3;
if (_isArray3) {
if (_i3 >= _iterator3.length) break;
_ref3 = _iterator3[_i3++];
} else {
_i3 = _iterator3.next();
if (_i3.done) break;
_ref3 = _i3.value;
}
const propPath = _ref3;
for (const propPath of path.get("properties")) {
const key = propPath.get("key");

@@ -184,7 +146,7 @@

const impureComputedPropertyDeclarators = replaceImpureComputedKeys(path);
const {
keys,
allLiteral
} = extractNormalizedKeys(path);
const _extractNormalizedKey = extractNormalizedKeys(path),
keys = _extractNormalizedKey.keys,
allLiteral = _extractNormalizedKey.allLiteral;
if (keys.length === 0) {

@@ -279,8 +241,4 @@ return [impureComputedPropertyDeclarators, restElement.argument, _core().types.callExpression(getExtendsHelper(file), [_core().types.objectExpression([]), _core().types.cloneNode(objRef)])];

const objectPatternPath = path.findParent(path => path.isObjectPattern());
const [impureComputedPropertyDeclarators, argument, callExpression] = createObjectSpread(objectPatternPath, file, ref);
const _createObjectSpread = createObjectSpread(objectPatternPath, file, ref),
impureComputedPropertyDeclarators = _createObjectSpread[0],
argument = _createObjectSpread[1],
callExpression = _createObjectSpread[2];
_core().types.assertIdentifier(argument);

@@ -326,8 +284,4 @@

nodes.push(_core().types.variableDeclaration("var", [_core().types.variableDeclarator(_core().types.identifier(refName), path.node.right)]));
const [impureComputedPropertyDeclarators, argument, callExpression] = createObjectSpread(leftPath, file, _core().types.identifier(refName));
const _createObjectSpread2 = createObjectSpread(leftPath, file, _core().types.identifier(refName)),
impureComputedPropertyDeclarators = _createObjectSpread2[0],
argument = _createObjectSpread2[1],
callExpression = _createObjectSpread2[2];
if (impureComputedPropertyDeclarators.length > 0) {

@@ -348,4 +302,6 @@ nodes.push(_core().types.variableDeclaration("var", impureComputedPropertyDeclarators));

ForXStatement(path) {
const node = path.node,
scope = path.scope;
const {
node,
scope
} = path;
const leftPath = path.get("left");

@@ -386,7 +342,3 @@ const left = node.left;

var _arr = path.node.properties;
for (var _i4 = 0; _i4 < _arr.length; _i4++) {
const prop = _arr[_i4];
for (const prop of path.node.properties) {
if (_core().types.isSpreadElement(prop)) {

@@ -393,0 +345,0 @@ push();

{
"name": "@babel/plugin-proposal-object-rest-spread",
"version": "7.0.0-beta.47",
"version": "7.0.0-beta.48",
"description": "Compile object rest and spread to ES5",

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

"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.47",
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.47"
"@babel/helper-plugin-utils": "7.0.0-beta.48",
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.48"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.47"
"@babel/core": "7.0.0-beta.48"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.47",
"@babel/helper-plugin-test-runner": "7.0.0-beta.47"
"@babel/core": "7.0.0-beta.48",
"@babel/helper-plugin-test-runner": "7.0.0-beta.48"
}
}
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