1
0
mirror of synced 2024-11-21 21:06:04 +03:00

fix: Fixed toString calls in validators

This commit is contained in:
Zaytsev Kirill 2021-11-11 11:28:12 +03:00
parent 76dec48d64
commit da56b04213

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
}