Handle the case that tag.text is a string

This commit is contained in:
Sebastian Pahnke 2021-06-11 15:19:48 +02:00
parent b8e0740b41
commit a03a8ba908

View file

@ -575,8 +575,10 @@ function tagToString(tag: ts.JSDocTagInfo): string {
const [paramName, ...rest] = tag.text;
tagLabel += `\`${paramName.text}\``;
if (rest.length > 0) tagLabel += `${rest.map(r => r.text).join(' ')}`;
} else if (tag.text) {
} else if (Array.isArray(tag.text)) {
tagLabel += `${tag.text.map(r => r.text).join(' ')}`;
} else if (tag.text) {
tagLabel += `${tag.text}`;
}
return tagLabel;
}