Remove outdated typeArguments check (#18640)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-01-15 18:11:11 +08:00
1 parent 8bb1341ff4
commit 28c00b6251
1 file changed
+2 -9
+2 -9
View File
@@ -419,7 +419,7 @@ function isObjectPropertyWithShortKey(node, keyDoc, options) {
} }
function isCallExpressionWithComplexTypeArguments(node, print) { function isCallExpressionWithComplexTypeArguments(node, print) {
const typeArgs = getTypeArgumentsFromCallExpression(node); const typeArgs = node.typeArguments?.params;
if (isNonEmptyArray(typeArgs)) { if (isNonEmptyArray(typeArgs)) {
if (typeArgs.length > 1) { if (typeArgs.length > 1) {
return true; return true;
@@ -435,20 +435,13 @@ function isCallExpressionWithComplexTypeArguments(node, print) {
return true; return true;
} }
} }
const typeArgsKeyName = node.typeParameters if (willBreak(print("typeArguments"))) {
? "typeParameters"
: "typeArguments";
if (willBreak(print(typeArgsKeyName))) {
return true; return true;
} }
} }
return false; return false;
} }
function getTypeArgumentsFromCallExpression(node) {
return (node.typeParameters ?? node.typeArguments)?.params;
}
function isGeneric(node) { function isGeneric(node) {
switch (node.type) { switch (node.type) {
case "FunctionTypeAnnotation": case "FunctionTypeAnnotation":