@babel/plugin-transform-object-rest-spread
Advanced tools
Comparing version 8.0.0-alpha.8 to 8.0.0-alpha.9
@@ -6,15 +6,8 @@ import { declare } from '@babel/helper-plugin-utils'; | ||
const { | ||
isObjectProperty: isObjectProperty$1, | ||
isArrayPattern, | ||
isObjectPattern, | ||
isAssignmentPattern: isAssignmentPattern$1, | ||
isRestElement, | ||
isIdentifier | ||
} = types; | ||
function shouldStoreRHSInTemporaryVariable(node) { | ||
if (isArrayPattern(node)) { | ||
if (!node) return false; | ||
if (node.type === "ArrayPattern") { | ||
const nonNullElements = node.elements.filter(element => element !== null); | ||
if (nonNullElements.length > 1) return true;else return shouldStoreRHSInTemporaryVariable(nonNullElements[0]); | ||
} else if (isObjectPattern(node)) { | ||
} else if (node.type === "ObjectPattern") { | ||
const { | ||
@@ -25,3 +18,3 @@ properties | ||
const firstProperty = properties[0]; | ||
if (isObjectProperty$1(firstProperty)) { | ||
if (firstProperty.type === "ObjectProperty") { | ||
return shouldStoreRHSInTemporaryVariable(firstProperty.value); | ||
@@ -32,6 +25,6 @@ } else { | ||
} | ||
} else if (isAssignmentPattern$1(node)) { | ||
} else if (node.type === "AssignmentPattern") { | ||
return shouldStoreRHSInTemporaryVariable(node.left); | ||
} else if (isRestElement(node)) { | ||
if (isIdentifier(node.argument)) return true; | ||
} else if (node.type === "RestElement") { | ||
if (node.argument.type === "Identifier") return true; | ||
return shouldStoreRHSInTemporaryVariable(node.argument); | ||
@@ -64,3 +57,3 @@ } else { | ||
var index = declare((api, opts) => { | ||
api.assertVersion("8.0.0-alpha.8"); | ||
api.assertVersion("8.0.0-alpha.9"); | ||
const targets = api.targets(); | ||
@@ -67,0 +60,0 @@ const supportsObjectAssign = !isRequired("Object.assign", targets, { |
{ | ||
"name": "@babel/plugin-transform-object-rest-spread", | ||
"version": "8.0.0-alpha.8", | ||
"version": "8.0.0-alpha.9", | ||
"description": "Compile object rest and spread to ES5", | ||
@@ -20,20 +20,23 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-compilation-targets": "^8.0.0-alpha.8", | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.8", | ||
"@babel/plugin-transform-parameters": "^8.0.0-alpha.8" | ||
"@babel/helper-compilation-targets": "^8.0.0-alpha.9", | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.9", | ||
"@babel/plugin-transform-parameters": "^8.0.0-alpha.9" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^8.0.0-alpha.8" | ||
"@babel/core": "^8.0.0-alpha.9" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^8.0.0-alpha.8", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.8", | ||
"@babel/parser": "^8.0.0-alpha.8" | ||
"@babel/core": "^8.0.0-alpha.9", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.9", | ||
"@babel/parser": "^8.0.0-alpha.9" | ||
}, | ||
"engines": { | ||
"node": "^16.20.0 || ^18.16.0 || >=20.0.0" | ||
"node": "^18.20.0 || ^20.10.0 || >=21.0.0" | ||
}, | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"exports": { | ||
".": "./lib/index.js", | ||
".": { | ||
"types": "./lib/index.d.ts", | ||
"default": "./lib/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
@@ -40,0 +43,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137473
8
474