Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 7.24.1 to 7.24.5

tsconfig.json

23

lib/index.js

@@ -10,15 +10,8 @@ 'use strict';

const {
isObjectProperty: isObjectProperty$1,
isArrayPattern,
isObjectPattern,
isAssignmentPattern: isAssignmentPattern$1,
isRestElement,
isIdentifier
} = core.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 {

@@ -29,3 +22,3 @@ properties

const firstProperty = properties[0];
if (isObjectProperty$1(firstProperty)) {
if (firstProperty.type === "ObjectProperty") {
return shouldStoreRHSInTemporaryVariable(firstProperty.value);

@@ -36,6 +29,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);

@@ -75,3 +68,3 @@ } else {

var _api$assumption, _api$assumption2, _api$assumption3, _api$assumption4;
api.assertVersion(7);
api.assertVersion("^7.0.0-0 || >8.0.0-alpha <8.0.0-beta");
const targets = api.targets();

@@ -78,0 +71,0 @@ const supportsObjectAssign = !helperCompilationTargets.isRequired("Object.assign", targets, {

{
"name": "@babel/plugin-transform-object-rest-spread",
"version": "7.24.1",
"version": "7.24.5",
"description": "Compile object rest and spread to ES5",

@@ -21,5 +21,5 @@ "repository": {

"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-plugin-utils": "^7.24.0",
"@babel/helper-plugin-utils": "^7.24.5",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.24.1"
"@babel/plugin-transform-parameters": "^7.24.5"
},

@@ -30,5 +30,5 @@ "peerDependencies": {

"devDependencies": {
"@babel/core": "^7.24.1",
"@babel/core": "^7.24.5",
"@babel/helper-plugin-test-runner": "^7.24.1",
"@babel/parser": "^7.24.1"
"@babel/parser": "^7.24.5"
},

@@ -35,0 +35,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

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