From 2ff5f5ba68081a27c9002221720729275624276d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 27 Mar 2023 11:53:03 +0200 Subject: [PATCH 1/2] fix: correct typo in `GenerateTypesOptions` --- src/generator/dts.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/generator/dts.ts b/src/generator/dts.ts index 1a7b729..b1adcdb 100644 --- a/src/generator/dts.ts +++ b/src/generator/dts.ts @@ -5,7 +5,7 @@ export interface GenerateTypesOptions { interfaceName?: string; addExport?: boolean; addDefaults?: boolean; - defaultDescrption?: string; + defaultDescription?: string; indentation?: number; allowExtraKeys?: boolean; partial?: boolean; @@ -214,6 +214,9 @@ export function genFunctionArgs( } function generateJSDoc(schema: Schema, opts: GenerateTypesOptions): string[] { + // @ts-expect-error - legacy typo + opts.defaultDescription = opts.defaultDescription || opts.defaultDescrption; + let buff = []; if (schema.title) { @@ -222,8 +225,8 @@ function generateJSDoc(schema: Schema, opts: GenerateTypesOptions): string[] { if (schema.description) { buff.push(schema.description, ""); - } else if (opts.defaultDescrption && schema.type !== "object") { - buff.push(opts.defaultDescrption, ""); + } else if (opts.defaultDescription && schema.type !== "object") { + buff.push(opts.defaultDescription, ""); } if ( From 4fcb04587b35414294773451bf07805854f6341e Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 27 Mar 2023 11:54:07 +0200 Subject: [PATCH 2/2] chore: add comment --- src/generator/dts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generator/dts.ts b/src/generator/dts.ts index b1adcdb..3962b86 100644 --- a/src/generator/dts.ts +++ b/src/generator/dts.ts @@ -214,6 +214,7 @@ export function genFunctionArgs( } function generateJSDoc(schema: Schema, opts: GenerateTypesOptions): string[] { + // TODO: remove when appropriate // @ts-expect-error - legacy typo opts.defaultDescription = opts.defaultDescription || opts.defaultDescrption;