feat(isDate): Disallow mismatching length for isDate by frederike-ramin · Pull Request #2056 · validatorjs/validator.js

Before this, if I provided a format to the isDate function, it was never checked that the format exactly matches - including the length of the date. I could have provided any possible date as long as I only included valid delimiters.
Important: I only changed this for strictMode because I think there it should 100% be checked, but maybe there are cases (without strictMode) where it is okay? If you want me to remove the strictMode condition, just let me know.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)