Closed gregfenton closed 5 months ago
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 + 'n'
would make this code consistent with the handling of a stand-alone bigint
value that is done in the code here.
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.
Using the example currently posted to the homepage:
EXPECTED:
ACTUAL: