From 8feb99f3e3b87f0ea5a03c52f172ba3a2330f163 Mon Sep 17 00:00:00 2001 From: Derpius <49565664+Derpius@users.noreply.github.com> Date: Sun, 13 Aug 2023 09:12:18 +0100 Subject: [PATCH] Add fallback for missing parameter name --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 1c2579b..5f1d5d4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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); @@ -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 ? "?" : ""