Files
NapCatQQ/.pnpm-store/v3/files/fd/662a12257389fe19fc4212779ba37ab516dd89fcaa58611e107e6de00e6534c1c70196bceae0aacd00d569462314548543ef005387d4ad690c79e2df982724
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

19 lines
775 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getParentFunctionNode = getParentFunctionNode;
const utils_1 = require("@typescript-eslint/utils");
function getParentFunctionNode(node) {
let current = node.parent;
while (current) {
if (current.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression ||
current.type === utils_1.AST_NODE_TYPES.FunctionDeclaration ||
current.type === utils_1.AST_NODE_TYPES.FunctionExpression) {
return current;
}
current = current.parent;
}
// this shouldn't happen in correct code, but someone may attempt to parse bad code
// the parser won't error, so we shouldn't throw here
/* istanbul ignore next */ return null;
}