Open sodiumjoe opened 2 months ago
Another option is to use JSON.stringify
when raw
is true
.
Another option is to use
JSON.stringify
whenraw
istrue
.
I was looking for a similar config to https://vitejs.dev/config/shared-options.html#json-stringify for performance
A stringify
option would be nice, instead of raw
, which I feel have very limited use cases since they only work on scalar?
Revisiting this issue, I don't think the
raw
config is quite the correct solution.The original issue is that this plugin unquotes numeric keys:
Which, as the above issue notes, results in an error because of the leading 0.
The problem with
raw
mode is it fails on objects:The above issue correctly identified
tosource
as the culprit here. Sincejs-yaml.load
returns plain JSON, I'm not sure whytosource
is necessary at all, as opposed to justJSON.stringify
.Happy to submit a PR if that sounds reasonable.