1
0
mirror of synced 2024-11-24 14:26:03 +03:00

Merge pull request #38 from cmath10/fix-tostring-in-validators

fix: Fixed toString calls in validators
This commit is contained in:
Kruglov Kirill 2021-11-11 11:39:38 +03:00 committed by GitHub
commit 2f3a63b012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,7 +165,7 @@ const rules: Record<string, ValidationRuleFn> = {
}
if (typeof value === 'string' || (force === 'length')) {
value = !isNaN(value) ? value.toString() : value
value = !isNaN(value) ? String(value) : value
return value.length <= maximum
}
@ -187,7 +187,7 @@ const rules: Record<string, ValidationRuleFn> = {
}
if (typeof value === 'string' || (force === 'length')) {
value = !isNaN(value) ? value.toString() : value
value = !isNaN(value) ? String(value) : value
return value.length >= minimum
}