Skip to content

Commit 8709a3a

Browse files
cherry-pick(#29687): chore: fix docs roll for functions without args follow-up (#29688)
This PR cherry-picks the following commits: - 03902d8 - 1a43adc --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent aa9f6fb commit 8709a3a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utils/doclint/documentation.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class Type {
566566
return type;
567567
}
568568

569-
if (parsedType.args) {
569+
if (parsedType.args || parsedType.retType) {
570570
const type = new Type('function');
571571
type.args = [];
572572
// @ts-ignore
@@ -737,7 +737,8 @@ function parseTypeExpression(type) {
737737
if (type[i] === '(') {
738738
name = type.substring(0, i);
739739
const matching = matchingBracket(type.substring(i), '(', ')');
740-
args = parseTypeExpression(type.substring(i + 1, i + matching - 1));
740+
const argsString = type.substring(i + 1, i + matching - 1);
741+
args = argsString ? parseTypeExpression(argsString) : null;
741742
i = i + matching;
742743
if (type[i] === ':') {
743744
retType = parseTypeExpression(type.substring(i + 1));

0 commit comments

Comments
 (0)