Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-spread

Package Overview
Dependencies
Maintainers
6
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-spread - npm Package Compare versions

Comparing version 7.6.2 to 7.7.4

56

lib/index.js

@@ -8,23 +8,7 @@ "use strict";

function _helperPluginUtils() {
const data = require("@babel/helper-plugin-utils");
var _helperPluginUtils = require("@babel/helper-plugin-utils");
_helperPluginUtils = function () {
return data;
};
var _core = require("@babel/core");
return data;
}
function _core() {
const data = require("@babel/core");
_core = function () {
return data;
};
return data;
}
var _default = (0, _helperPluginUtils().declare)((api, options) => {
var _default = (0, _helperPluginUtils.declare)((api, options) => {
api.assertVersion(7);

@@ -36,3 +20,3 @@ const {

function getSpreadLiteral(spread, scope) {
if (loose && !_core().types.isIdentifier(spread.argument, {
if (loose && !_core.types.isIdentifier(spread.argument, {
name: "arguments"

@@ -48,3 +32,3 @@ })) {

for (let i = 0; i < nodes.length; i++) {
if (_core().types.isSpreadElement(nodes[i])) {
if (_core.types.isSpreadElement(nodes[i])) {
return true;

@@ -59,3 +43,3 @@ }

if (!_props.length) return _props;
nodes.push(_core().types.arrayExpression(_props));
nodes.push(_core.types.arrayExpression(_props));
return [];

@@ -69,3 +53,3 @@ }

for (const prop of props) {
if (_core().types.isSpreadElement(prop)) {
if (_core.types.isSpreadElement(prop)) {
_props = push(_props, nodes);

@@ -100,4 +84,4 @@ nodes.push(getSpreadLiteral(prop, scope));

if (!_core().types.isArrayExpression(first)) {
first = _core().types.arrayExpression([]);
if (!_core.types.isArrayExpression(first)) {
first = _core.types.arrayExpression([]);
} else {

@@ -107,3 +91,3 @@ nodes.shift();

path.replaceWith(_core().types.callExpression(_core().types.memberExpression(first, _core().types.identifier("concat")), nodes));
path.replaceWith(_core.types.callExpression(_core.types.memberExpression(first, _core.types.identifier("concat")), nodes));
},

@@ -133,3 +117,3 @@

if (nodes.length) {
node.arguments.push(_core().types.callExpression(_core().types.memberExpression(first, _core().types.identifier("concat")), nodes));
node.arguments.push(_core.types.callExpression(_core.types.memberExpression(first, _core.types.identifier("concat")), nodes));
} else {

@@ -145,18 +129,18 @@ node.arguments.push(first);

if (temp) {
callee.object = _core().types.assignmentExpression("=", temp, callee.object);
callee.object = _core.types.assignmentExpression("=", temp, callee.object);
contextLiteral = temp;
} else {
contextLiteral = _core().types.cloneNode(callee.object);
contextLiteral = _core.types.cloneNode(callee.object);
}
_core().types.appendToMemberExpression(callee, _core().types.identifier("apply"));
_core.types.appendToMemberExpression(callee, _core.types.identifier("apply"));
} else {
node.callee = _core().types.memberExpression(node.callee, _core().types.identifier("apply"));
node.callee = _core.types.memberExpression(node.callee, _core.types.identifier("apply"));
}
if (_core().types.isSuper(contextLiteral)) {
contextLiteral = _core().types.thisExpression();
if (_core.types.isSuper(contextLiteral)) {
contextLiteral = _core.types.thisExpression();
}
node.arguments.unshift(_core().types.cloneNode(contextLiteral));
node.arguments.unshift(_core.types.cloneNode(contextLiteral));
},

@@ -175,3 +159,3 @@

if (nodes.length) {
args = _core().types.callExpression(_core().types.memberExpression(first, _core().types.identifier("concat")), nodes);
args = _core.types.callExpression(_core.types.memberExpression(first, _core.types.identifier("concat")), nodes);
} else {

@@ -181,3 +165,3 @@ args = first;

path.replaceWith(_core().types.callExpression(path.hub.addHelper("construct"), [node.callee, args]));
path.replaceWith(_core.types.callExpression(path.hub.addHelper("construct"), [node.callee, args]));
}

@@ -184,0 +168,0 @@

{
"name": "@babel/plugin-transform-spread",
"version": "7.6.2",
"version": "7.7.4",
"description": "Compile ES2015 spread to ES5",

@@ -21,6 +21,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread",

"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/helper-plugin-test-runner": "^7.0.0"
"@babel/core": "^7.7.4",
"@babel/helper-plugin-test-runner": "^7.7.4"
},
"gitHead": "b9cb4af953afb1a5aeed9b18526192ab15bb45c1"
"gitHead": "75767d87cb147709b9bd9b99bf44daa6688874a9"
}
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