Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/plugin-transform-destructuring

Package Overview
Dependencies
Maintainers
4
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 7.24.8 to 7.25.7

34

lib/index.js

@@ -108,3 +108,35 @@ 'use strict';

} else {
return this.scope.toArray(node, count, this.arrayLikeIsIterable);
const {
scope,
arrayLikeIsIterable
} = this;
if (core.types.isIdentifier(node)) {
const binding = scope.getBinding(node.name);
if (binding != null && binding.constant && binding.path.isGenericType("Array")) {
return node;
}
}
if (core.types.isArrayExpression(node)) {
return node;
}
if (core.types.isIdentifier(node, {
name: "arguments"
})) {
return core.template.expression.ast`
Array.prototype.slice.call(${node})
`;
}
let helperName;
const args = [node];
if (typeof count === "number") {
args.push(core.types.numericLiteral(count));
helperName = "slicedToArray";
} else {
helperName = "toArray";
}
if (arrayLikeIsIterable) {
args.unshift(scope.path.hub.addHelper(helperName));
helperName = "maybeArrayLike";
}
return core.types.callExpression(scope.path.hub.addHelper(helperName), args);
}

@@ -111,0 +143,0 @@ }

10

package.json
{
"name": "@babel/plugin-transform-destructuring",
"version": "7.24.8",
"version": "7.25.7",
"description": "Compile ES2015 destructuring to ES5",

@@ -20,3 +20,3 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^7.24.8"
"@babel/helper-plugin-utils": "^7.25.7"
},

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

"devDependencies": {
"@babel/core": "^7.24.8",
"@babel/helper-plugin-test-runner": "^7.24.7",
"@babel/traverse": "^7.24.8"
"@babel/core": "^7.25.7",
"@babel/helper-plugin-test-runner": "^7.25.7",
"@babel/traverse": "^7.25.7"
},

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

@@ -15,4 +15,7 @@ /* This file is automatically generated by scripts/generators/tsconfig.js */

"path": "../../packages/babel-helper-plugin-utils"
},
{
"path": "../../packages/babel-core"
}
]
}

Sorry, the diff of this file is not supported yet

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