Closed jdalton closed 6 years ago
Oh that sample one sec.
Try:
const pkgJSON = JSON6.parse(fs.readFileSync("./path/to/package.json"))
Ya I see now... pushed/published 0.1.124 (test)[https://github.com/d3x0r/JSON6/blob/master/tests/json6TestObject2.js]
Thank you!
Was testing performance and found that 'let' can cause deoptimizations. FIxed to restore performance over json5.
It looks like from your patch you added more let
s?
kinda; the one that was really causing problems was like case (something): let... and putting brackets around that one solved it, but putting bracked around others didn't.. I was experimenting with adding more... and a few seemed to be benefictial (going from like 1732ms to 1670ms) so I left them in; although that's probably just jitter.
On version json-6@0.1.123 if you
JSON6.parse
this file https://github.com/standard-things/esm/blob/master/package.json it will incorrectly produce objects:and
when there is no such structures in the actual JSON.
It looks like
json-6
is glitching and turning the last key in thescripts
anddevDependencies
objects into other objects. In the case of the example'test:prod'
and'yargs'
.