Files
memecoin-botV2/.pnpm-store/v10/files/fd/662a12257389fe19fc4212779ba37ab516dd89fcaa58611e107e6de00e6534c1c70196bceae0aacd00d569462314548543ef005387d4ad690c79e2df982724

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;
}