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

fix(napi): convert u64 to u32 in serialization #1478

Merged
merged 1 commit into from Feb 8, 2023
Merged

fix(napi): convert u64 to u32 in serialization #1478

merged 1 commit into from Feb 8, 2023

Conversation

m1212e
Copy link
Contributor

@m1212e m1212e commented Feb 7, 2023

#1470
serde_json::Value parses positive integers to u64 types by default. When converting serde_json::Value to a js value, those numbers are converted to BigInts, even if they are within the bounds of the number primitive. The added checks converts an u64 to an u32 if possible to prevent this behavior.

#1470
serde_json::Value parses positive integers to u64 types by default. When converting serde_json::Value to a js value, those numbers are converted to BigInts, even if they are within the bounds of the number primitive. The added checks converts an u64 to an u32 if possible to prevent this behavior.
@Brooooooklyn Brooooooklyn changed the title feat(napi): convert u64 to u32 in serialization fix(napi): convert u64 to u32 in serialization Feb 8, 2023
@Brooooooklyn Brooooooklyn merged commit a7dcf2a into napi-rs:main Feb 8, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants