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

Type is not strict when serialize u64 or u128 #81

Open
hanakannzashi opened this issue Dec 27, 2023 · 1 comment
Open

Type is not strict when serialize u64 or u128 #81

hanakannzashi opened this issue Dec 27, 2023 · 1 comment

Comments

@hanakannzashi
Copy link

hanakannzashi commented Dec 27, 2023

When schema is u64 or u128, the input value type can be number, bigint, string, boolean. But when schema is u8, u16, u32, the input value type can only be number, they are not consistent, that is strange.

I think we should make input value type be strict when serialize u64 or u128, I mean ONLY allow bigint.
Alternatively, we should make input type NOT be strict when serialize u8, u16, u32, I mean allow number, bigint, string and boolean

@hanakannzashi hanakannzashi changed the title type is not strict when serialize bigint type is not strict when serialize u64 or u128 Dec 27, 2023
@hanakannzashi hanakannzashi changed the title type is not strict when serialize u64 or u128 Type is not strict when serialize u64 or u128 Dec 27, 2023
@gagdiez
Copy link
Contributor

gagdiez commented Jan 30, 2024

While I agree with the simplicity from the theoretical point of view, the reality is that I've seen people always use number for number, but the same people would use BN.js or strings for big values.

To be honest, I think we would break more things that we would fix by doing this (thought I might be wrong)

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

2 participants