Skip to content

Commit caa3154

Browse files
authored
Merge pull request #138 from docsbydoxdox/hotfix/api-private-tag
[hotfix] Added support for api private tag in Jsdoc.
2 parents ee0c2f2 + e1f52de commit caa3154

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ export default async (cwd: string, path: string): Promise<File> => {
5252
})
5353
);
5454

55+
const isPrivate =
56+
jsdoc.access === 'private' ||
57+
(jsdoc.tags &&
58+
jsdoc.tags.findIndex(
59+
tag =>
60+
tag.title === 'api' && tag.value === 'private'
61+
)) !== -1;
62+
5563
return {
5664
slug: `${slugify(path)}-${slugify(jsdoc.name)}`,
5765
name: jsdoc.name,
@@ -62,7 +70,7 @@ export default async (cwd: string, path: string): Promise<File> => {
6270
description: jsdoc.description || '',
6371
params,
6472
returns,
65-
private: jsdoc.access === 'private'
73+
private: isPrivate
6674
};
6775
})
6876
.sort((a, b) => {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ export interface Jsdoc {
22
kind: string;
33
name: string;
44
description: string;
5+
tags?: JsdocTag[];
56
params: JsdocParam[];
67
returns: JsdocParam[];
78
access: string;
89
undocumented?: boolean;
910
}
1011

12+
export interface JsdocTag {
13+
title: string;
14+
value: string;
15+
}
16+
1117
export interface JsdocParam {
1218
name?: string;
1319
description: string;

0 commit comments

Comments
 (0)