Socket
Socket
Sign inDemoInstall

@babel/helper-hoist-variables

Package Overview
Dependencies
Maintainers
4
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-hoist-variables - npm Package Compare versions

Comparing version 7.18.6 to 7.21.4-esm

lib/index.js.map

14

lib/index.js

@@ -7,5 +7,3 @@ "use strict";

exports.default = hoistVariables;
var _t = require("@babel/types");
const {

@@ -20,7 +18,5 @@ assignmentExpression,

},
FunctionParent(path) {
path.skip();
},
VariableDeclaration(path, state) {

@@ -31,10 +27,7 @@ if (state.kind && path.node.kind !== state.kind) return;

let firstId;
for (const declar of declarations) {
firstId = declar.node.id;
if (declar.node.init) {
nodes.push(expressionStatement(assignmentExpression("=", declar.node.id, declar.node.init)));
}
for (const name of Object.keys(declar.getBindingIdentifiers())) {

@@ -44,3 +37,2 @@ state.emit(identifier(name), name, declar.node.init !== null);

}
if (path.parentPath.isFor({

@@ -54,5 +46,3 @@ left: path.node

}
};
function hoistVariables(path, emit, kind = "var") {

@@ -63,2 +53,4 @@ path.traverse(visitor, {

});
}
}
//# sourceMappingURL=index.js.map
{
"name": "@babel/helper-hoist-variables",
"version": "7.18.6",
"version": "7.21.4-esm",
"description": "Helper function to hoist variables",

@@ -17,7 +17,7 @@ "repository": {

"dependencies": {
"@babel/types": "^7.18.6"
"@babel/types": "^7.21.4-esm"
},
"TODO": "The @babel/traverse dependency is only needed for the NodePath TS type. We can consider exporting it from @babel/core.",
"devDependencies": {
"@babel/traverse": "^7.18.6"
"@babel/traverse": "^7.21.4-esm"
},

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc