Open guicompeng opened 2 years ago
Hello, as a user, I think this is a really useful feature, I am currently working in this issue, to create a function that does this, I will create a Pull Request later when I complete the feature :)
Hello, I have added the required feature. If the string length falls in the range and if exact number/array/object is mentioned, then exact conditions are checked. If not provided, then true is returned is len>=min & len<=max and false is returned is not in range [min, max]. Thanks for giving me a chance to contribute :) PR#2019 - https://github.com/validatorjs/validator.js/pull/2019
Heyy @rubiin !! This additional feature is been added in PR https://github.com/validatorjs/validator.js/pull/2019. It would be great if you could have a look.
@guicompeng I want to know if this issue is still open for me to work on it. Thanks and look forward to hearing from you.
Currently the options for isLength are
min
andmax
only. I believe there could be more options. I'm needing the field size to be exactly 11 or 14 or 16. For now I'm usingmin
11 andmax
16 but in my program the length values (12, 13, 15) should not be accepted. a new option can be:exact: {11, 14, 16}
orsize: {11, 14, 16}
Do you think this change adding more options would be a good thing?