fastest-validator icon indicating copy to clipboard operation
fastest-validator copied to clipboard

How to make such a type that the field is either absent at all or is a number

Open AD2018 opened this issue 2 years ago • 2 comments

How to make such a type that the field is either absent at all or is a number, i tried it: image

But as you see from console.log it doesnt work, because null is ok for validator(same for undefined) It will be ok if someone tells me how to make the null value not allowed, undefining is acceptable for me

AD2018 avatar Jul 04 '23 18:07 AD2018

I think that using a custom you can solve the problem

fernandodevelon avatar Jul 07 '23 12:07 fernandodevelon

I will try soon, thank you

AD2018 avatar Jul 07 '23 16:07 AD2018