diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4418b6c922c..235b10e4cf1 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4542,7 +4542,7 @@ namespace ts { } /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ - export function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray | undefined { + export function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray { return getJSDocTags(node).filter(doc => doc.kind === kind); } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 0f56329ddf9..4bc0f5160d2 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3037,7 +3037,7 @@ declare namespace ts { /** Get all JSDoc tags related to a node, including those on parent nodes. */ function getJSDocTags(node: Node): ReadonlyArray; /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ - function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray | undefined; + function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 8fd304658a8..1f64dd12ab8 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3092,7 +3092,7 @@ declare namespace ts { /** Get all JSDoc tags related to a node, including those on parent nodes. */ function getJSDocTags(node: Node): ReadonlyArray; /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ - function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray | undefined; + function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral;