Skip to content

Commit 389af2e

Browse files
committed
build(docs): correct parameter syntax
1 parent 60f1dea commit 389af2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/update-endpoints/docs.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ ${param.description}
4343
const requiredParameterNames = endpoint.parameters
4444
.filter(parameter => parameter.required)
4545
.map(parameter => parameter.name);
46-
const example = `octokit.${endpoint.scope}.${
47-
endpoint.id
48-
}(${requiredParameterNames.join(", ")})`;
46+
const example =
47+
`octokit.${endpoint.scope}.${endpoint.id}` +
48+
(requiredParameterNames.length
49+
? `({
50+
${requiredParameterNames.join(",\n")}
51+
})`
52+
: "()");
4953

5054
const content = `
5155
# ${endpoint.name}

0 commit comments

Comments
 (0)