Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Add stringifyJsonWithBigInts helper #3194

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

lorisleiva
Copy link
Contributor

@lorisleiva lorisleiva commented Sep 2, 2024

This PR adds a new stringifyJsonWithBigInts helper function that supports rendering bigints as unsafe numerical values.

This will be used — in a subsequent PR — to create a new Solana-RPC-specific HTTP transport that prevents loss of precision for large integers, in both the request and the response of the RPC cycle.

Copy link

changeset-bot bot commented Sep 2, 2024

⚠️ No Changeset found

Latest commit: 0931654

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from dd565d7 to 7b5a5cb Compare September 2, 2024 14:51
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from ebde947 to c631810 Compare September 2, 2024 14:51
@lorisleiva lorisleiva marked this pull request as ready for review September 2, 2024 14:54
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from 7b5a5cb to 0369450 Compare September 2, 2024 15:43
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from c631810 to 3ed7380 Compare September 2, 2024 15:43
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from 0369450 to b3e4ac7 Compare September 2, 2024 15:47
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 3ed7380 to f563379 Compare September 2, 2024 15:47
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from b3e4ac7 to cc8c5d6 Compare September 3, 2024 21:25
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch 2 times, most recently from c5c040a to 906eb43 Compare September 3, 2024 21:29
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from cc8c5d6 to f2ea496 Compare September 3, 2024 21:35
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 906eb43 to 5eb1545 Compare September 3, 2024 21:35
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from f2ea496 to eedbefd Compare September 3, 2024 22:11
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 5eb1545 to 0d567bb Compare September 3, 2024 22:11
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from eedbefd to 6a38604 Compare September 5, 2024 09:22
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 0d567bb to 877f2ef Compare September 5, 2024 09:22
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from 6a38604 to b935286 Compare September 6, 2024 11:49
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 877f2ef to 41378fc Compare September 6, 2024 11:49
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from b935286 to 0a6e00d Compare September 10, 2024 07:54
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 41378fc to 97d86b7 Compare September 10, 2024 07:55
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from 0a6e00d to 7e84995 Compare September 10, 2024 08:17
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 97d86b7 to 42cece0 Compare September 10, 2024 08:17
@lorisleiva lorisleiva force-pushed the loris/json-parse-with-bigints branch from 7e84995 to c651c96 Compare September 10, 2024 10:12
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from 42cece0 to b3c246e Compare September 10, 2024 10:13
Copy link
Contributor

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added via Giphy

it.each`
input | expectedString
${0n} | ${'0'}
${-0n} | ${'0'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting.

Copy link
Contributor Author

lorisleiva commented Sep 11, 2024

Merge activity

  • Sep 11, 4:12 AM EDT: @lorisleiva started a stack merge that includes this pull request via Graphite.
  • Sep 11, 4:17 AM EDT: Graphite rebased this pull request as part of a merge.
  • Sep 11, 4:18 AM EDT: @lorisleiva merged this pull request with Graphite.

@lorisleiva lorisleiva changed the base branch from loris/json-parse-with-bigints to graphite-base/3194 September 11, 2024 08:13
@lorisleiva lorisleiva changed the base branch from graphite-base/3194 to master September 11, 2024 08:15
@lorisleiva lorisleiva force-pushed the loris/json-stringify-with-bigints branch from b3c246e to 0931654 Compare September 11, 2024 08:16
@lorisleiva lorisleiva merged commit 6338d1a into master Sep 11, 2024
7 checks passed
@lorisleiva lorisleiva deleted the loris/json-stringify-with-bigints branch September 11, 2024 08:18
Copy link
Contributor

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants