You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems a bit difficult to support large numbers if we do not write the parser ourselves.
Both integers and floats are valid in JSON, so we cannot just use the library json-bigint to parse the JSON string. Do you have any ideas?
I have now implemented it based on CodeMirror, because it accepts strings, so I can use JSONBigNumber for processing by myself. If I want to implement it in your library, the solution I came up with is:
When creating a new Differ, add additional options for users to pass their own JSON stringify and parse methods.
When creating a new Differ, add additional options to determine if the data is a BigNumber. This check is to prevent iterating through BigNumber objects (values processed using bignumber.js are special objects).
Because the underlying design of your library is to accept raw JSON objects instead of strings, the above method can only be handled by users through options, and cannot be integrated into your library (the values in the transmitted object must have been processed by bignumber, otherwise precision will be lost during transmission).
https://json-diff-kit.js.org/#l=%7B%0A++%22a%22%3A+90071992547409912345%0A%7D&r=%7B%0A++%22b%22%3A+90071992547409912345%0A%7D
The text was updated successfully, but these errors were encountered: