Skip to content

Commit 1df7997

Browse files
author
Andy
authoredMay 18, 2018
getJSDocTypeParameterDeclarations: Avoid unnecessary array (#24257)
1 parent 04a3512 commit 1df7997

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎src/compiler/utilities.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3114,9 +3114,9 @@ namespace ts {
31143114
}
31153115

31163116
export function getJSDocTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray<TypeParameterDeclaration> {
3117-
const tags = filter(getJSDocTags(node), isJSDocTemplateTag);
31183117
// template tags are only available when a typedef isn't already using them
3119-
const tag = find(tags, tag => !(tag.parent.kind === SyntaxKind.JSDocComment && find(tag.parent.tags, isJSDocTypeAlias)));
3118+
const tag = find(getJSDocTags(node), (tag): tag is JSDocTemplateTag =>
3119+
isJSDocTemplateTag(tag) && !(tag.parent.kind === SyntaxKind.JSDocComment && tag.parent.tags!.some(isJSDocTypeAlias)));
31203120
return (tag && tag.typeParameters) || emptyArray;
31213121
}
31223122

0 commit comments

Comments
 (0)
Please sign in to comment.