Skip to content

Commit ecfae5e

Browse files
committed
chore: clean up jsdoc comments
1 parent 2ecd006 commit ecfae5e

File tree

2 files changed

+6
-34
lines changed

2 files changed

+6
-34
lines changed

.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
"name": "jest structured-types",
240240
"program": "${workspaceFolder}/node_modules/.bin/jest",
241241
"cwd": "${workspaceFolder}/misc/structured-types",
242-
"args": ["boolean-prop"],
242+
"args": ["object-prop"],
243243
"console": "integratedTerminal",
244244
"internalConsoleOptions": "neverOpen",
245245
"disableOptimisticBPs": true,

misc/structured-types/src/SymbolParser.ts

+5-33
Original file line numberDiff line numberDiff line change
@@ -653,39 +653,11 @@ export class SymbolParser implements ISymbolParser {
653653
const { jsDoc } = node as {
654654
jsDoc: JSDocInfoType[];
655655
};
656-
const docs: {
657-
descriptions: string[];
658-
tags: string[];
659-
} = jsDoc.reduce(
660-
(
661-
acc: {
662-
descriptions: string[];
663-
tags: string[];
664-
},
665-
{ comment, tags },
666-
) => {
667-
const newTags = tags
668-
? tags.map(({ comment, name, tagName }) => {
669-
const text = name?.getText();
670-
return `* @${tagName.text}${`${text ? ` ${text}` : ''}`}${
671-
comment ? ` ${comment}` : ''
672-
}`;
673-
})
674-
: [];
675-
return {
676-
descriptions: comment
677-
? [...acc.descriptions, comment]
678-
: acc.descriptions,
679-
tags: [...acc.tags, ...newTags],
680-
};
681-
},
682-
{
683-
descriptions: [],
684-
tags: [],
685-
},
686-
);
687-
if (docs.descriptions.length) {
688-
prop.description = cleanJSDocText(docs.descriptions.join(''));
656+
const docs: string[] = jsDoc.reduce((acc: string[], { comment }) => {
657+
return comment ? [...acc, comment] : acc;
658+
}, []);
659+
if (docs.length) {
660+
prop.description = cleanJSDocText(docs.join(''));
689661
}
690662
const merged = mergeJSDoc(this, prop, node);
691663
if (merged === null) {

0 commit comments

Comments
 (0)