mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
getJSDocTypeParameterDeclarations: Avoid unnecessary array (#24257)
This commit is contained in:
parent
04a351224c
commit
1df7997014
@ -3114,9 +3114,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getJSDocTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray<TypeParameterDeclaration> {
|
||||
const tags = filter(getJSDocTags(node), isJSDocTemplateTag);
|
||||
// template tags are only available when a typedef isn't already using them
|
||||
const tag = find(tags, tag => !(tag.parent.kind === SyntaxKind.JSDocComment && find(tag.parent.tags, isJSDocTypeAlias)));
|
||||
const tag = find(getJSDocTags(node), (tag): tag is JSDocTemplateTag =>
|
||||
isJSDocTemplateTag(tag) && !(tag.parent.kind === SyntaxKind.JSDocComment && tag.parent.tags!.some(isJSDocTypeAlias)));
|
||||
return (tag && tag.typeParameters) || emptyArray;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user