Skip to content

Commit

Permalink
fix: fix example field in attribute's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed Jan 28, 2025
1 parent f904f0f commit cef667e
Show file tree
Hide file tree
Showing 96 changed files with 950 additions and 950 deletions.
2 changes: 1 addition & 1 deletion gen/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ const templatedComponent = (res: string, name: string, cmp: Component): { compon
if (a.enum) enums[a.name] = attrType
if (a.description || a.example) {
const desc = (a.description && !a.description.endsWith('.')) ? `${a.description}.` : a.description
fields.push(`/** ${desc ? `\n\t * ${desc}` : ''}${a.example ? `\n\t * @example \`\`\`"${a.example}"\`\`\`` : ''}\n\t */`)
fields.push(`/** ${desc ? `\n\t * ${desc}` : ''}${a.example ? `\n\t * @example \`\`\`${JSON.stringify(a.example)}\`\`\`` : ''}\n\t */`)
}
fields.push(`${a.name}${a.required ? '' : '?'}: ${attrType}${a.required ? '' : ' | null'}`)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@semantic-release/git": "^10.0.1",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.10",
"@types/node": "^22.12.0",
"dotenv": "^16.4.7",
"eslint": "^8.57.1",
"jest": "^29.7.0",
Expand Down
Loading

0 comments on commit cef667e

Please sign in to comment.