Skip to content

Commit

Permalink
fix: correct typo in GenerateTypesOptions (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Mar 27, 2023
1 parent b4c13a3 commit 4b4e28c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/generator/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface GenerateTypesOptions {
interfaceName?: string;
addExport?: boolean;
addDefaults?: boolean;
defaultDescrption?: string;
defaultDescription?: string;
indentation?: number;
allowExtraKeys?: boolean;
partial?: boolean;
Expand Down Expand Up @@ -214,6 +214,10 @@ 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;

let buff = [];

if (schema.title) {
Expand All @@ -222,8 +226,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 (
Expand Down

0 comments on commit 4b4e28c

Please sign in to comment.