@babel/helper-environment-visitor
Advanced tools
Comparing version 7.16.7 to 7.18.2
@@ -7,33 +7,54 @@ "use strict"; | ||
exports.default = void 0; | ||
exports.requeueComputedKeyAndDecorators = requeueComputedKeyAndDecorators; | ||
exports.skipAllButComputedKey = skipAllButComputedKey; | ||
var _t = require("@babel/types"); | ||
function skipAllButComputedKey(path) { | ||
path.skip(); | ||
const { | ||
VISITOR_KEYS, | ||
staticBlock | ||
} = _t; | ||
function skipAllButComputedKey(path) { | ||
if (!path.node.computed) { | ||
path.skip(); | ||
return; | ||
if (path.node.computed) { | ||
path.context.maybeQueue(path.get("key")); | ||
} | ||
} | ||
const keys = VISITOR_KEYS[path.type]; | ||
function requeueComputedKeyAndDecorators(path) { | ||
const { | ||
context, | ||
node | ||
} = path; | ||
for (const key of keys) { | ||
if (key !== "key") path.skipKey(key); | ||
if (node.computed) { | ||
context.maybeQueue(path.get("key")); | ||
} | ||
if (node.decorators) { | ||
for (const decorator of path.get("decorators")) { | ||
context.maybeQueue(decorator); | ||
} | ||
} | ||
} | ||
const skipKey = (staticBlock ? "StaticBlock|" : "") + "ClassPrivateProperty|TypeAnnotation|FunctionDeclaration|FunctionExpression"; | ||
var _default = { | ||
[skipKey]: path => path.skip(), | ||
const visitor = { | ||
FunctionParent(path) { | ||
if (path.isArrowFunctionExpression()) { | ||
return; | ||
} else { | ||
path.skip(); | ||
"Method|ClassProperty"(path) { | ||
skipAllButComputedKey(path); | ||
if (path.isMethod()) { | ||
requeueComputedKeyAndDecorators(path); | ||
} | ||
} | ||
}, | ||
Property(path) { | ||
if (path.isObjectProperty()) { | ||
return; | ||
} | ||
path.skip(); | ||
requeueComputedKeyAndDecorators(path); | ||
} | ||
}; | ||
var _default = visitor; | ||
exports.default = _default; |
{ | ||
"name": "@babel/helper-environment-visitor", | ||
"version": "7.16.7", | ||
"version": "7.18.2", | ||
"description": "Helper visitor to only visit nodes in the current 'this' context", | ||
@@ -20,7 +20,5 @@ "repository": { | ||
}, | ||
"dependencies": { | ||
"@babel/types": "^7.16.7" | ||
}, | ||
"devDependencies": { | ||
"@babel/traverse": "^7.16.7" | ||
"@babel/traverse": "^7.18.2", | ||
"@babel/types": "^7.18.2" | ||
}, | ||
@@ -27,0 +25,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
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
3365
0
47
2
- Removed@babel/types@^7.16.7
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/types@7.26.0(transitive)