Skip to content

Commit

Permalink
cherry-pick(#29687): chore: fix docs roll for functions without args …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
playwrightmachine and github-actions[bot] committed Feb 27, 2024
1 parent aa9f6fb commit 8709a3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/doclint/documentation.js
Expand Up @@ -566,7 +566,7 @@ class Type {
return type;
}

if (parsedType.args) {
if (parsedType.args || parsedType.retType) {
const type = new Type('function');
type.args = [];
// @ts-ignore
Expand Down Expand Up @@ -737,7 +737,8 @@ function parseTypeExpression(type) {
if (type[i] === '(') {
name = type.substring(0, i);
const matching = matchingBracket(type.substring(i), '(', ')');
args = parseTypeExpression(type.substring(i + 1, i + matching - 1));
const argsString = type.substring(i + 1, i + matching - 1);
args = argsString ? parseTypeExpression(argsString) : null;
i = i + matching;
if (type[i] === ':') {
retType = parseTypeExpression(type.substring(i + 1));
Expand Down

0 comments on commit 8709a3a

Please sign in to comment.