fastest-validator
fastest-validator copied to clipboard
How to make such a type that the field is either absent at all or is a number
How to make such a type that the field is either absent at all or is a number, i tried it:
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
I think that using a custom you can solve the problem
I will try soon, thank you