sidorares / json-bigint

JSON.parse/stringify with bigints support
MIT License
808 stars 192 forks source link

Fix: Non-integers were always parsed as strings, if storeAsString #89

Open edgarsi opened 1 year ago

edgarsi commented 1 year ago

Losing precision after the decimal point is almost always a non-issue. Using 'string' in such cases is usually worse.

edgarsi commented 1 year ago

To be frank, it isn't clear to me what the purpose of storeAsString is:

If json-bigint is used as a drop-in replacement for parsing all jsons, it is safe to say we don't want to convert to string in cases where it isn't necessary, as it may break components expecting non-string types. There are several questionable cases: