-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
"Uncaught TypeError: Do not know how to serialize a BigInt" #42
Comments
I wonder if on this line the code should be something more like: copyText = JSON.stringify(value, (_, v) => typeof v === 'bigint' ? v + 'n' : v, 2); based on this SO answer. The There does not seem to be a really good way to deal with "BigInt" in JSON, as this other answer on that same SO post outlines in great detail. |
@jaywcjlove did you see my recommendation on the PR conversation about creating a utility function? I would have added it but I wasn't sure whether your team has a standard for how to add "utility functions". |
The current team only has me actively maintaining. However, due to the large number of Git repositories I oversee, I couldn't see your PR in time. Just saw it now, and I think it's fine, so I've merged and released a new version. @gregfenton Thx! |
If you want to point me to how you do utils, I'm happy to do another PR. |
PR merged |
@gregfenton I would be very happy to see another PR from you. |
* fix: Uncaught TypeError: Do not know how to serialize a BigInt #42 * make Copied.test cases consistent * refactor: add `bigIntToString()` types function
Using the example currently posted to the homepage:
EXPECTED:
ACTUAL:
The text was updated successfully, but these errors were encountered: