Closed brunomperes closed 9 years ago
Oh wow, could you gist an example JSON file that causes this so I can take a look? If JSON5 is generating invalid JSON that is totally a bug.
It seems that the problem is with json5 v0.4.0, see the changelog. They now remove quotes on keys wherever possible. Something as this
{"key":"value"}
will output as:
{key:"value"}
To test on your machine make sure you have the v0.4 (it took me a while, check the package.json of the json5 module after a npm install
).
definitively an issue, the minified json have all keys unquoted and are unusable on most applications
@shama any update on that? I'm happy to send a PR moving back to the default JSON.stringify method soon
+1 thank you @brunomperes!
Hi @shama , After pushing #7, the outputted JSON seemed to be with the keys on the first depth without quotes on my input (no idea why), which was making my Angular application crash because it uses the standard JSON.stringify() instead of JSON5.
So I was wondering why using the JSON5, as it could generate JSONs that aren't supported on other applications. Perhaps parameterizing the usage of JSON5 in favor of the standard version of JSON or JSON3?