Skip to content

Commit 5b2042a

Browse files
committed
chore: wip
1 parent 95ffea6 commit 5b2042a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/extract.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,17 @@ function extractObjectProperties(lines: string[]): PropertyInfo[] {
210210
}
211211

212212
function inferType(value: string): string {
213-
if (value.startsWith('"') || value.startsWith('\''))
214-
return value.replace(/^['"]|['"]$/g, '')
213+
// Handle string literals - keep the quotes
214+
if (value.startsWith('"') || value.startsWith('\'')) {
215+
// Ensure consistent quote style (using single quotes)
216+
const cleanValue = value.trim().replace(/^["']|["']$/g, '')
217+
return `'${cleanValue}'`
218+
}
215219

216220
if (value === 'true' || value === 'false')
217221
return value
218222

219-
if (!isNaN(Number(value)))
223+
if (!Number.isNaN(Number(value)))
220224
return value
221225

222226
if (value.includes('=>') || value.includes('function'))

0 commit comments

Comments
 (0)