From da56b04213b6ebc3d001a273b26a350a59e0382b Mon Sep 17 00:00:00 2001 From: Zaytsev Kirill Date: Thu, 11 Nov 2021 11:28:12 +0300 Subject: [PATCH] fix: Fixed toString calls in validators --- src/validation/rules.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/validation/rules.ts b/src/validation/rules.ts index 3ee278b..fff2b79 100644 --- a/src/validation/rules.ts +++ b/src/validation/rules.ts @@ -165,7 +165,7 @@ const rules: Record = { } 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 = { } if (typeof value === 'string' || (force === 'length')) { - value = !isNaN(value) ? value.toString() : value + value = !isNaN(value) ? String(value) : value return value.length >= minimum }