Skip to content

Commit 9626ab3

Browse files
committed
chore: wip
1 parent 26a33bb commit 9626ab3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/extract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export async function extractTypeFromSource(filePath: string): Promise<string> {
7676
// Parse the object literal
7777
const parsedValue = parseObjectLiteral(constValue.slice(1, -1))
7878
const formattedValue = Object.entries(parsedValue)
79-
.map(([key, value]) => ` ${key}: ${value.match(/^['"].*['"]$/) ? value : `'${value}'`}`)
79+
.map(([key, value]) => ` ${key.match(/\W/) ? `'${key}'` : key}: ${value.match(/^['"].*['"]$/) ? value : `'${value}'`}`)
8080
.join(',\n')
8181

8282
if (pendingComment) {

0 commit comments

Comments
 (0)