fix: endswith

This commit is contained in:
Nevo David 2025-07-31 10:42:46 +07:00
parent db0b135787
commit a7ed9f981a
1 changed files with 5 additions and 5 deletions

View File

@ -8,11 +8,11 @@ import {
export class ValidUrlExtension implements ValidatorConstraintInterface {
validate(text: string, args: ValidationArguments) {
return (
text.endsWith('.png') ||
text.endsWith('.jpg') ||
text.endsWith('.jpeg') ||
text.endsWith('.gif') ||
text.endsWith('.mp4')
text?.endsWith('.png') ||
text?.endsWith('.jpg') ||
text?.endsWith('.jpeg') ||
text?.endsWith('.gif') ||
text?.endsWith('.mp4')
);
}