mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-03 18:38:40 -06:00
Apply code formatting
This commit is contained in:
parent
6f002ef7f9
commit
6a6b5225c6
@ -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 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user