@babel/helper-hoist-variables
Advanced tools
Comparing version 7.18.6 to 7.21.4-esm
@@ -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": { |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
7045
6
48
1
Updated@babel/types@^7.21.4-esm