Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JSON.rawJSON #365

Open
chrisdickinson opened this issue Nov 5, 2024 · 0 comments
Open

Support for JSON.rawJSON #365

chrisdickinson opened this issue Nov 5, 2024 · 0 comments

Comments

@chrisdickinson
Copy link

Hi! Thanks for the great project! I'm opening an issue because I ran into a situation where I need to JSON.stringify an object containing a bigint. I can bail out back to parsing to/from strings, but it looks like one (forward-looking) way to accomplish this is via JSON.rawJSON, by doing something like:

JSON.stringify(
  {"bigint": 9223372036854775807n},
  (key, value) => typeof value === 'bigint' ? JSON.rawJSON(value.toString()) : value
)

It might be a bit soon to implement but I wanted to get the proposal on your radar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant