fix(isUUID): handle of null version value by theteladras · Pull Request #1777 · validatorjs/validator.js

The issue here lies in that, where the defaulting of argument is only managed for when the value of the version is 'undefined', and for other falsy values (in my case 'null') it accepts them. There are cases where functions do trigger callbacks with null values instead of undefined, and it usually leads to unexpected outcomes. I do believe that this is the general understanding of how the function should be used, when the version argument is falsy, it should check for 'all' pattern.

The particular issue is here:

Screenshot 2021-10-12 at 13 48 29

Checklist

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