Skip to content

Commit

Permalink
feat(dts): default description for values
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 9, 2022
1 parent 7862f3b commit 9e2e6b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/generator/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { escapeKey, normalizeTypes } from '../utils'
export interface GenerateTypesOptions {
addExport?: boolean
addDefaults?: boolean
defaultDescrption?: string
}

const GenerateTypesDefaults: GenerateTypesOptions = {
Expand Down Expand Up @@ -155,6 +156,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)
}

if (
Expand Down

0 comments on commit 9e2e6b4

Please sign in to comment.