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

Feature: strict number validation #65

Merged
merged 7 commits into from
Sep 10, 2024
Merged

Feature: strict number validation #65

merged 7 commits into from
Sep 10, 2024

Conversation

vitalics
Copy link
Owner

@vitalics vitalics commented Sep 9, 2024

We make validation for number type, format, minValue and maxValue fields. That means we handle it on our side so you get an error for invalid values.

Examples:

s.number().format('float').int() // error in type!
s.int().const(3.4) // error in type!
s.number().int().format('float') // error in format!
s.number().int().format('double') // error in format!

// ranges are also check for possibility

s.number().min(5).max(3) // error in range!
s.number().min(3).max(5).const(10) // error in constant!

@vitalics vitalics self-assigned this Sep 9, 2024
@vitalics vitalics added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 9, 2024
@vitalics vitalics merged commit 9a62d94 into main Sep 10, 2024
8 checks passed
@vitalics vitalics deleted the feat/strict-number branch September 10, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant