@babel/plugin-transform-spread
Advanced tools
Comparing version 7.2.0 to 7.2.2
@@ -88,5 +88,5 @@ "use strict"; | ||
const nodes = build(elements, scope); | ||
const first = nodes.shift(); | ||
let first = nodes[0]; | ||
if (nodes.length === 0 && first !== elements[0].argument) { | ||
if (nodes.length === 1 && first !== elements[0].argument) { | ||
path.replaceWith(first); | ||
@@ -96,2 +96,8 @@ return; | ||
if (!_core().types.isArrayExpression(first)) { | ||
first = _core().types.arrayExpression([]); | ||
} else { | ||
nodes.shift(); | ||
} | ||
path.replaceWith(_core().types.callExpression(_core().types.memberExpression(first, _core().types.identifier("concat")), nodes)); | ||
@@ -98,0 +104,0 @@ }, |
{ | ||
"name": "@babel/plugin-transform-spread", | ||
"version": "7.2.0", | ||
"version": "7.2.2", | ||
"description": "Compile ES2015 spread to ES5", | ||
@@ -21,5 +21,5 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", | ||
"devDependencies": { | ||
"@babel/core": "^7.2.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/helper-plugin-test-runner": "^7.0.0" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6535
143
0