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 95ffea6 commit 5b2042aCopy full SHA for 5b2042a
1 file changed
src/extract.ts
@@ -210,13 +210,17 @@ function extractObjectProperties(lines: string[]): PropertyInfo[] {
210
}
211
212
function inferType(value: string): string {
213
- if (value.startsWith('"') || value.startsWith('\''))
214
- return value.replace(/^['"]|['"]$/g, '')
+ // Handle string literals - keep the quotes
+ if (value.startsWith('"') || value.startsWith('\'')) {
215
+ // Ensure consistent quote style (using single quotes)
216
+ const cleanValue = value.trim().replace(/^["']|["']$/g, '')
217
+ return `'${cleanValue}'`
218
+ }
219
220
if (value === 'true' || value === 'false')
221
return value
222
- if (!isNaN(Number(value)))
223
+ if (!Number.isNaN(Number(value)))
224
225
226
if (value.includes('=>') || value.includes('function'))
0 commit comments