Apply code formatting

This commit is contained in:
copilot-swe-agent[bot] 2025-07-14 17:15:07 +00:00
parent 6f002ef7f9
commit 6a6b5225c6

View File

@ -289,31 +289,31 @@ function getKeyFromNode(exp: FunctionLikeDeclaration) {
return `${exp.pos.toString()}:${exp.end.toString()}`;
}
function canBeConvertedToClass(node: Node, checker: TypeChecker): boolean {
if (isFunctionExpression(node)) {
// Generator functions cannot be converted to classes
if (getFunctionFlags(node) & FunctionFlags.Generator) {
return false;
}
if (isVariableDeclaration(node.parent) && node.symbol.members?.size) {
return true;
}
const symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false);
return !!(symbol && (symbol.exports?.size || symbol.members?.size));
}
if (isFunctionDeclaration(node)) {
// Generator functions cannot be converted to classes
if (getFunctionFlags(node) & FunctionFlags.Generator) {
return false;
}
return !!node.symbol.members?.size;
}
return false;
function canBeConvertedToClass(node: Node, checker: TypeChecker): boolean {
if (isFunctionExpression(node)) {
// Generator functions cannot be converted to classes
if (getFunctionFlags(node) & FunctionFlags.Generator) {
return false;
}
if (isVariableDeclaration(node.parent) && node.symbol.members?.size) {
return true;
}
const symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false);
return !!(symbol && (symbol.exports?.size || symbol.members?.size));
}
if (isFunctionDeclaration(node)) {
// Generator functions cannot be converted to classes
if (getFunctionFlags(node) & FunctionFlags.Generator) {
return false;
}
return !!node.symbol.members?.size;
}
return false;
}
/** @internal */