Describe the bug
isFloat() returns true when a combination of sign and decimal separator is passed. E.g. "+."
Examples
Tested in REPL
This line only checks for "", ".", "-" and "+".
An effective solution is to use Regular Expression:
if (/^[+-]?[.٫]?$/.test(str)) {
return false;
}
Might affect https://github.com/usarfoss/validator.js/pull/2020
Additional context
Validator.js version: v13.7.0
Node.js version: v16.6.1
OS platform: windows