Skip to content

Commit 67d9c12

Browse files
authored
Merge pull request #141 from docsbydoxdox/hotfix/missing-return-type
[hotfix] Prevent error when return type is missing.
2 parents 3bfd0b2 + 1bcac26 commit 67d9c12

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/doxdox-parser-jsdoc/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ export default async (cwd: string, path: string): Promise<File> => {
3737
)
3838
.map((jsdoc: Jsdoc) => {
3939
const params = (jsdoc.params || []).map(
40-
({ name, description = '', type }) => ({
40+
({ name, description = '', type = {} }) => ({
4141
name,
4242
description,
43-
types: type.names
43+
types: type.names || []
4444
})
4545
);
4646

4747
const returns = (jsdoc.returns || []).map(
48-
({ name, description = '', type }) => ({
48+
({ name, description = '', type = {} }) => ({
4949
name,
5050
description,
51-
types: type.names
51+
types: type.names || []
5252
})
5353
);
5454

packages/doxdox-parser-jsdoc/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface JsdocTag {
1717
export interface JsdocParam {
1818
name?: string;
1919
description: string;
20-
type: {
20+
type?: {
2121
names: string[];
2222
};
2323
}

0 commit comments

Comments
 (0)