Skip to content

Commit

Permalink
fix: Add comments for function type properties (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Jan 9, 2022
1 parent 5f2ef42 commit c38a095
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -61,11 +61,10 @@ export default function () {
);

if (hasComments) {
if (property.comment) {
const comments = getComments(property);
if (comments) {
row.push(
stripLineBreaks(
Handlebars.helpers.comments.call(property.comment),
),
stripLineBreaks(Handlebars.helpers.comments.call(comments)),
);
} else {
row.push('-');
Expand Down Expand Up @@ -112,3 +111,10 @@ function getName(property: DeclarationReflection) {
}
return md.join('');
}

function getComments(property: DeclarationReflection) {
if (property.signatures) {
return property.signatures[0].comment;
}
return property.comment;
}

0 comments on commit c38a095

Please sign in to comment.