Skip to content

Commit 9c6e5ac

Browse files
fix: update typo in error message for @IsUrl decorator
1 parent 86993af commit 9c6e5ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/decorator/string/IsUrl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import ValidatorJS from 'validator';
66
export const IS_URL = 'isUrl';
77

88
/**
9-
* Checks if the string is an url.
9+
* Checks if the string is a url.
1010
* If given value is not a string, then it returns false.
1111
*/
1212
export function isURL(value: string, options?: ValidatorJS.IsURLOptions): boolean {
1313
return typeof value === 'string' && isUrlValidator(value, options);
1414
}
1515

1616
/**
17-
* Checks if the string is an url.
17+
* Checks if the string is a url.
1818
* If given value is not a string, then it returns false.
1919
*/
2020
export function IsUrl(options?: ValidatorJS.IsURLOptions, validationOptions?: ValidationOptions): PropertyDecorator {
@@ -24,7 +24,7 @@ export function IsUrl(options?: ValidatorJS.IsURLOptions, validationOptions?: Va
2424
constraints: [options],
2525
validator: {
2626
validate: (value, args): boolean => isURL(value, args?.constraints[0]),
27-
defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be an URL address', validationOptions),
27+
defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be a URL address', validationOptions),
2828
},
2929
},
3030
validationOptions

test/functional/validation-functions-and-decorators.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3437,7 +3437,7 @@ describe('IsUrl', () => {
34373437

34383438
it('should return error object with proper data', () => {
34393439
const validationType = 'isUrl';
3440-
const message = 'someProperty must be an URL address';
3440+
const message = 'someProperty must be a URL address';
34413441
return checkReturnedError(new MyClass(), invalidValues, validationType, message);
34423442
});
34433443
});

0 commit comments

Comments
 (0)