You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I used hasSize(100) expecting the validation to be at most 100 characters long which isn't what's happening though.
The function is defined as:
hasSize(min: Int = Int.MIN_VALUE, max: Int = Int.MAX_VALUE)
which translates to hasSize(100, Int.MAX_VALUE).
Describe the solution you'd like
I think there should be a one parameter function hasSize(size: Int) to prevent these misunderstandings and the two parameter function should not have default values for min/max.
hasSize(size: Int) -> matches exact size / length
hasSize(min: Int, max: Int) -> matches size in [min, max]
Describe alternatives you've considered
To be even clearer with the intention I suggest:
hasSize(size: Int) -> matches exact size / length
hasSize(range: IntRange) -> matches size defined by IntRange
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I used hasSize(100) expecting the validation to be at most 100 characters long which isn't what's happening though.
The function is defined as:
hasSize(min: Int = Int.MIN_VALUE, max: Int = Int.MAX_VALUE)
which translates to hasSize(100, Int.MAX_VALUE).
Describe the solution you'd like
I think there should be a one parameter function hasSize(size: Int) to prevent these misunderstandings and the two parameter function should not have default values for min/max.
Describe alternatives you've considered
To be even clearer with the intention I suggest:
The text was updated successfully, but these errors were encountered: