Numerical greaterThanOrEqual and lessThanOrEqual do not check for equality
Closed this issue · 1 comments
abelbraaksma commented
Basically, it is just this:
/// Value is greater than provided min with the default error
/// message
member _.greaterThan (min : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.greaterThan field min
x.greaterThan min msg field input
/// Value is greater than or equal to provided min with the default
/// error message
member _.greaterThanOrEqualTo (min : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.greaterThanOrEqualTo field min
x.greaterThan min msg field input
/// Value is less than provided max with the default error message
member _.lessThan (max : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.lessThan field max
x.lessThan max msg field input
/// Value is less than or equal to provided max with the default
/// error message
member _.lessThanOrEqualTo (max : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.lessThanOrEqualTo field max
x.lessThan max msg field input
Which needs to be this:
/// Value is greater than provided min with the default error
/// message
member _.greaterThan (min : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.greaterThan field min
x.greaterThan min msg field input
/// Value is greater than or equal to provided min with the default
/// error message
member _.greaterThanOrEqualTo (min : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.greaterThanOrEqualTo field min
x.greaterThanOrEqualTo min msg field input
/// Value is less than provided max with the default error message
member _.lessThan (max : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.lessThan field max
x.lessThan max msg field input
/// Value is less than or equal to provided max with the default
/// error message
member _.lessThanOrEqualTo (max : 'a) (field : string) (input : 'a) =
let msg field = ValidationMessages.lessThanOrEqualTo field max
x.lessThanOrEqualTo max msg field input
These functions already exist, but just have never been called:
Line 72 in 71f7fc5
abelbraaksma commented
Thanks for fixing this @pimbrouwers!!! ❤️