From 79c03815d87fc78846f3f456be2503208bb16c3c Mon Sep 17 00:00:00 2001 From: Karl Viiburg Date: Tue, 18 Jun 2024 13:01:53 +0300 Subject: [PATCH] change(isMobilePhone): updated locale typing to better reflect ValidatorJS functionality --- src/decorator/string/IsMobilePhone.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decorator/string/IsMobilePhone.ts b/src/decorator/string/IsMobilePhone.ts index 34859b5007..e95686fa2d 100644 --- a/src/decorator/string/IsMobilePhone.ts +++ b/src/decorator/string/IsMobilePhone.ts @@ -19,7 +19,7 @@ export const IS_MOBILE_PHONE = 'isMobilePhone'; */ export function isMobilePhone( value: unknown, - locale?: ValidatorJS.MobilePhoneLocale, + locale?: 'any' | ValidatorJS.MobilePhoneLocale | ValidatorJS.MobilePhoneLocale[], options?: ValidatorJS.IsMobilePhoneOptions ): boolean { return typeof value === 'string' && isMobilePhoneValidator(value, locale, options); @@ -38,7 +38,7 @@ export function isMobilePhone( * If given value is not a string, then it returns false. */ export function IsMobilePhone( - locale?: ValidatorJS.MobilePhoneLocale, + locale?: 'any' | ValidatorJS.MobilePhoneLocale | ValidatorJS.MobilePhoneLocale[], options?: ValidatorJS.IsMobilePhoneOptions, validationOptions?: ValidationOptions ): PropertyDecorator {