Trailing comma
Diokuz opened this issue · comments
Failed to parse:
const dJSON = require('dirty-json')
const x = dJSON.parse(`{
text: 'foo bar',
}`
)
Succeed:
const dJSON = require('dirty-json')
const x = dJSON.parse(`{
text: 'foo bar',
}`.replace(/,\s*\}/g, '')
)
Oops, looks like I got this case for lists but missed it for objects.