Skip to content

Commit 3912a6b

Browse files
committed
fix(type-doc): fix properties parser fix
1 parent e071b1d commit 3912a6b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/typedoc.parser/parsers/properties.parser.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export class PropertiesParser {
4848
} else {
4949
return obj[CO.name];
5050
}
51+
} else {
52+
return obj[CO.name];
5153
}
5254
}
5355

@@ -76,14 +78,21 @@ export class PropertiesParser {
7678
}
7779

7880
getTypeReferenceProp(prop: any) {
79-
return prop[CO.type][CO.name] + '<' + prop[CO.type][CO.typeArguments][0][CO.name] + '>';
81+
if (prop[CO.type][CO.typeArguments] && prop[CO.type][CO.typeArguments].length !== 0) {
82+
return prop[CO.type][CO.name] + '<' + prop[CO.type][CO.typeArguments][0][CO.name] + '>';
83+
} else {
84+
return prop[CO.type][CO.name];
85+
}
8086
}
8187

8288
getTypeOther(prop: any) {
8389
if (prop[CO.comment][CO.tags] && prop[CO.comment][CO.tags].length !==0) {
8490
return prop[CO.comment][CO.tags][0][CO.text].replace(/[\n{}]+/g, '');
85-
} else {
91+
} else if(prop[CO.setSignature] && prop[CO.setSignature].length !== 0 &&
92+
prop[CO.setSignature][0][CO.parameters] && prop[CO.setSignature][0][CO.parameters].length !== 0) {
8693
return prop[CO.setSignature][0][CO.parameters][0][CO.type][CO.name];
94+
} else if (prop[CO.getSignature] && prop[CO.getSignature].length !== 0) {
95+
return prop[CO.getSignature][0][CO.type][CO.name];
8796
}
8897
}
8998

src/typedoc.parser/typedoc.parser.options.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ export const CO = {
2222
arguments: 'arguments',
2323
bindingPropertyName: 'bindingPropertyName',
2424
typeArguments: 'typeArguments',
25+
getSignature: 'getSignature',
2526
};

0 commit comments

Comments
 (0)