Urara-Blog/node_modules/.pnpm-store/v3/files/0e/dc2d274c1c154bc24135dfcb48901eba6be76083b545770d5d61ff2a7e0cb9657717fd8f5d9f062ed2d71076ddd1a682e0560b36ee852a8aeadb1a9343a2c8
2022-08-14 01:14:53 +08:00

59 lines
No EOL
1.1 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.requeueComputedKeyAndDecorators = requeueComputedKeyAndDecorators;
exports.skipAllButComputedKey = skipAllButComputedKey;
function skipAllButComputedKey(path) {
path.skip();
if (path.node.computed) {
path.context.maybeQueue(path.get("key"));
}
}
function requeueComputedKeyAndDecorators(path) {
const {
context,
node
} = path;
if (node.computed) {
context.maybeQueue(path.get("key"));
}
if (node.decorators) {
for (const decorator of path.get("decorators")) {
context.maybeQueue(decorator);
}
}
}
const visitor = {
FunctionParent(path) {
if (path.isArrowFunctionExpression()) {
return;
} else {
path.skip();
if (path.isMethod()) {
requeueComputedKeyAndDecorators(path);
}
}
},
Property(path) {
if (path.isObjectProperty()) {
return;
}
path.skip();
requeueComputedKeyAndDecorators(path);
}
};
var _default = visitor;
exports.default = _default;