Skip to content

Commit

Permalink
Add fallback for missing parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
Derpius committed Aug 13, 2023
1 parent ef0d96b commit 8feb99f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function generateParams(params?: DocParameter[]): {
if (params === undefined) return ret;

params.forEach(function (param) {
param.name = param.name ?? "missing_name";
if (param.name.endsWith("...")) param.name = "...";

const type = generateType(param);
Expand All @@ -211,6 +212,7 @@ function generateParams(params?: DocParameter[]): {
function generateInlineParams(params: DocParameter[]): string {
return params
.map((param) => {
param.name = param.name ?? "missing_name";
const type = generateType(param);
return `${param.name}${
type.optional ? "?" : ""
Expand Down

0 comments on commit 8feb99f

Please sign in to comment.