Merge pull request #38 from cmath10/fix-tostring-in-validators
fix: Fixed toString calls in validators
This commit is contained in:
commit
2f3a63b012
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user