1
0
mirror of synced 2024-11-22 05:16:05 +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')) { if (typeof value === 'string' || (force === 'length')) {
value = !isNaN(value) ? value.toString() : value value = !isNaN(value) ? String(value) : value
return value.length <= maximum return value.length <= maximum
} }
@ -187,7 +187,7 @@ const rules: Record<string, ValidationRuleFn> = {
} }
if (typeof value === 'string' || (force === 'length')) { if (typeof value === 'string' || (force === 'length')) {
value = !isNaN(value) ? value.toString() : value value = !isNaN(value) ? String(value) : value
return value.length >= minimum return value.length >= minimum
} }