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

@babel/helper-environment-visitor

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-environment-visitor - npm Package Compare versions

Comparing version 7.16.7 to 7.18.2

57

lib/index.js

@@ -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": {

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