We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26a33bb commit 9626ab3Copy full SHA for 9626ab3
1 file changed
src/extract.ts
@@ -76,7 +76,7 @@ export async function extractTypeFromSource(filePath: string): Promise<string> {
76
// Parse the object literal
77
const parsedValue = parseObjectLiteral(constValue.slice(1, -1))
78
const formattedValue = Object.entries(parsedValue)
79
- .map(([key, value]) => ` ${key}: ${value.match(/^['"].*['"]$/) ? value : `'${value}'`}`)
+ .map(([key, value]) => ` ${key.match(/\W/) ? `'${key}'` : key}: ${value.match(/^['"].*['"]$/) ? value : `'${value}'`}`)
80
.join(',\n')
81
82
if (pendingComment) {
0 commit comments