FileValidator
Interface describing FileValidators, which can be added to a ParseFilePipe
abstract class FileValidator<TValidationOptions = Record<string, any>, TFile extends IFile = IFile> {
constructor(validationOptions: TValidationOptions)
protected validationOptions: TValidationOptions
abstract isValid(file?: TFile | TFile[] | Record<string, TFile[]>): boolean | Promise<boolean>
abstract buildErrorMessage(file: any): string
}
Subclasses
See also
{ParseFilePipe}
Constructor
Properties
Property | Description |
---|---|
protected validationOptions: TValidationOptions
|
Read-only. Declared in constructor. |
Methods
isValid() |
---|
Indicates if this file should be considered valid, according to the options passed in the constructor. |
buildErrorMessage() |
---|
Builds an error message in case the validation fails. |