Don't add duplicates of JSDoc comments.

This commit is contained in:
Daniel 2020-05-11 21:39:47 +00:00
parent 1450908e5c
commit 74d6d04d70

View file

@ -93,10 +93,13 @@ namespace ts.JsDoc {
forEachUnique(declarations, declaration => { forEachUnique(declarations, declaration => {
for (const { comment } of getCommentHavingNodes(declaration)) { for (const { comment } of getCommentHavingNodes(declaration)) {
if (comment === undefined) continue; if (comment === undefined) continue;
if (documentationComment.length) { const commentTextPart = textPart(comment);
documentationComment.push(lineBreakPart()); if (!contains(documentationComment, commentTextPart)) {
if (documentationComment.length) {
documentationComment.push(lineBreakPart());
}
documentationComment.push(commentTextPart);
} }
documentationComment.push(textPart(comment));
} }
}); });
return documentationComment; return documentationComment;