Open
Description
Describe the bug
Due to my use case I'm currently wrapping the isInt validator and passing the options object as required. In conformance with the typescript type definitions I'm explicitly passing undefined for options.max
. Because isInt uses hasOwnProperty to check for the presence of the option it compares the value with undefined and the validation fails.
As a workaround I changed my wrapper to pass only defined options, but would have expected isInt to handle this case.
I noticed that hasOwnProperty is used to check for options in other validators as well if no default option exists. So if addressed this issue would span over multiple validators.
Examples
import validator from "validator";
validator.isInt("2", { min: 1, max: undefined }) // yields false
Additional context
Validator.js version: 13.1.17