mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-03 13:19:29 +08:00
26 lines
No EOL
827 B
Text
26 lines
No EOL
827 B
Text
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getThisExpression = void 0;
|
|
const utils_1 = require("@typescript-eslint/utils");
|
|
function getThisExpression(node) {
|
|
while (node) {
|
|
if (node.type === utils_1.AST_NODE_TYPES.CallExpression) {
|
|
node = node.callee;
|
|
}
|
|
else if (node.type === utils_1.AST_NODE_TYPES.ThisExpression) {
|
|
return node;
|
|
}
|
|
else if (node.type === utils_1.AST_NODE_TYPES.MemberExpression) {
|
|
node = node.object;
|
|
}
|
|
else if (node.type === utils_1.AST_NODE_TYPES.ChainExpression) {
|
|
node = node.expression;
|
|
}
|
|
else {
|
|
break;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
exports.getThisExpression = getThisExpression;
|
|
//# sourceMappingURL=getThisExpression.js.map |