From 9c6e5ac75f603e4a06dc37ec505caddfb286a698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Ol=C3=A1h?= Date: Sun, 20 Nov 2022 14:08:18 +0000 Subject: [PATCH] fix: update typo in error message for `@IsUrl` decorator --- src/decorator/string/IsUrl.ts | 6 +++--- test/functional/validation-functions-and-decorators.spec.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/decorator/string/IsUrl.ts b/src/decorator/string/IsUrl.ts index 6b55b83f2f..42b5c98ae2 100644 --- a/src/decorator/string/IsUrl.ts +++ b/src/decorator/string/IsUrl.ts @@ -6,7 +6,7 @@ import ValidatorJS from 'validator'; export const IS_URL = 'isUrl'; /** - * Checks if the string is an url. + * Checks if the string is a url. * If given value is not a string, then it returns false. */ export function isURL(value: string, options?: ValidatorJS.IsURLOptions): boolean { @@ -14,7 +14,7 @@ export function isURL(value: string, options?: ValidatorJS.IsURLOptions): boolea } /** - * Checks if the string is an url. + * Checks if the string is a url. * If given value is not a string, then it returns false. */ export function IsUrl(options?: ValidatorJS.IsURLOptions, validationOptions?: ValidationOptions): PropertyDecorator { @@ -24,7 +24,7 @@ export function IsUrl(options?: ValidatorJS.IsURLOptions, validationOptions?: Va constraints: [options], validator: { validate: (value, args): boolean => isURL(value, args?.constraints[0]), - defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be an URL address', validationOptions), + defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be a URL address', validationOptions), }, }, validationOptions diff --git a/test/functional/validation-functions-and-decorators.spec.ts b/test/functional/validation-functions-and-decorators.spec.ts index bde60a90c5..78290664ad 100644 --- a/test/functional/validation-functions-and-decorators.spec.ts +++ b/test/functional/validation-functions-and-decorators.spec.ts @@ -3437,7 +3437,7 @@ describe('IsUrl', () => { it('should return error object with proper data', () => { const validationType = 'isUrl'; - const message = 'someProperty must be an URL address'; + const message = 'someProperty must be a URL address'; return checkReturnedError(new MyClass(), invalidValues, validationType, message); }); });