diff --git a/packages/common/pipes/file/file-type.validator.ts b/packages/common/pipes/file/file-type.validator.ts index 710bcdd2993..854a31f2904 100644 --- a/packages/common/pipes/file/file-type.validator.ts +++ b/packages/common/pipes/file/file-type.validator.ts @@ -21,7 +21,7 @@ export class FileTypeValidator extends FileValidator { return `Validation failed (expected type is ${this.validationOptions.fileType})`; } - isValid(file: FileType): boolean { + isValid(file: Partial | FileType): boolean { if (!this.validationOptions) { return true; } diff --git a/packages/common/pipes/file/file-validator.interface.ts b/packages/common/pipes/file/file-validator.interface.ts index 91ca8eec6e1..090a5824e8d 100644 --- a/packages/common/pipes/file/file-validator.interface.ts +++ b/packages/common/pipes/file/file-validator.interface.ts @@ -1,4 +1,4 @@ -import { FileType } from "./interfaces"; +import { FileType } from './interfaces'; /** * Interface describing FileValidators, which can be added to a {@link ParseFilePipe}. @@ -12,7 +12,9 @@ export abstract class FileValidator> { * Indicates if this file should be considered valid, according to the options passed in the constructor. * @param file the file from the request object */ - abstract isValid(file?: FileType): boolean | Promise; + abstract isValid( + file?: FileType | Partial, + ): boolean | Promise; /** * Builds an error message in case the validation fails. diff --git a/packages/common/pipes/file/max-file-size.validator.ts b/packages/common/pipes/file/max-file-size.validator.ts index d2f60c91ef8..f5d8559fee7 100644 --- a/packages/common/pipes/file/max-file-size.validator.ts +++ b/packages/common/pipes/file/max-file-size.validator.ts @@ -17,7 +17,7 @@ export class MaxFileSizeValidator extends FileValidator): boolean { if (!this.validationOptions) { return true; }