diff --git a/behaviors/phone-number.ts b/behaviors/phone-number.ts index 53bff9f..17c023b 100644 --- a/behaviors/phone-number.ts +++ b/behaviors/phone-number.ts @@ -3,4 +3,4 @@ import { parsePhoneNumber } from '../deps.ts'; export function isPhoneNumber(prop: string, locale?: string): boolean { const pn = parsePhoneNumber(prop, { regionCode: locale }); return pn.valid; -}; +} diff --git a/behaviors/string.ts b/behaviors/string.ts index 27f530e..8bcf1c9 100644 --- a/behaviors/string.ts +++ b/behaviors/string.ts @@ -1,5 +1,15 @@ -export function lengthGreaterOrEqual(str: string, minLength: number): boolean {return str.length >= minLength; } -export function lengthGreater(str: string, minLength: number): boolean {return str.length > minLength; } -export function lengthLowerOrEqual(str: string, maxLength: number): boolean {return str.length <= maxLength; } -export function lengthLower(str: string, maxLength: number): boolean {return str.length < maxLength; } -export function isRegex(str: string, regex: RegExp): boolean { return regex.test(str) }; +export function lengthGreaterOrEqual(str: string, minLength: number): boolean { + return str.length >= minLength; +} +export function lengthGreater(str: string, minLength: number): boolean { + return str.length > minLength; +} +export function lengthLowerOrEqual(str: string, maxLength: number): boolean { + return str.length <= maxLength; +} +export function lengthLower(str: string, maxLength: number): boolean { + return str.length < maxLength; +} +export function isRegex(str: string, regex: RegExp): boolean { + return regex.test(str); +} diff --git a/decorator-function.ts b/decorator-function.ts index 3ed69f5..017118a 100644 --- a/decorator-function.ts +++ b/decorator-function.ts @@ -1 +1 @@ -export type DecoratorFunction = () => PropertyDecorator; \ No newline at end of file +export type DecoratorFunction = () => PropertyDecorator; diff --git a/validate.ts b/validate.ts index 7e0a8d2..4a64e5d 100644 --- a/validate.ts +++ b/validate.ts @@ -146,4 +146,4 @@ export function createValidator>( constraints: [...args], }); }; -}; +} diff --git a/validators/common.ts b/validators/common.ts index 942a5d0..2f9e98c 100644 --- a/validators/common.ts +++ b/validators/common.ts @@ -257,4 +257,4 @@ export function IsPort(): PropertyDecorator { errorMessage: 'Property must be a valid port number', constraints: [], }); -} \ No newline at end of file +} diff --git a/validators/nested.ts b/validators/nested.ts index 1b8c45d..1d9a477 100644 --- a/validators/nested.ts +++ b/validators/nested.ts @@ -20,4 +20,4 @@ export function Nested(expectedClass: Constructor): PropertyDecorator { constraints: [], }, ); -}; +} diff --git a/validators/number.ts b/validators/number.ts index 5a1df9a..89549dc 100644 --- a/validators/number.ts +++ b/validators/number.ts @@ -14,7 +14,7 @@ export function GreaterOrEqual(min: number): PropertyDecorator { constraints: [min], }, ); -}; +} /** * Checks if a number is greater than to a specified minimum value. * @@ -28,7 +28,7 @@ export function Greater(min: number): PropertyDecorator { constraints: [min], }, ); -}; +} /** * Checks if a number is lower than or equal to a specified minimum value. * @@ -42,7 +42,7 @@ export function LowerOrEqual(max: number): PropertyDecorator { constraints: [max], }, ); -}; +} /** * Checks if a number is lower than a specified minimum value. * @@ -56,4 +56,4 @@ export function Lower(max: number): PropertyDecorator { constraints: [max], }, ); -}; +} diff --git a/validators/phone-number.ts b/validators/phone-number.ts index 25dcb6e..7e74ae8 100644 --- a/validators/phone-number.ts +++ b/validators/phone-number.ts @@ -15,7 +15,7 @@ export function IsPhoneNumber(locale?: string): PropertyDecorator { constraints: [locale], }, ); -}; +} /** * Validates if a string is an international phone number.