Closed kaizhu256 closed 4 years ago
Thank you for the feedback, but that approach is too narrow for the goals of this proposal, which aims to support fine-grained practitioner control of deserialization now (e.g., which output values are Number vs. BigInt), and also future use cases such as BigDecimal. Refer to https://github.com/tc39/proposal-json-parse-with-source/issues/12#issuecomment-704441889 for the currently anticipated shape of serialization.
apologies for revisiting #5 (add an options object to JSON.parse and JSON.stringify)
i think this proposal's primary motivation is parsing bigint? imo options-object like
{ bigintIfTooBig: true }
remains more ergonomic (and less error-prone):roundtripping is more ergonomic as well: