diff --git a/packages/@uppy/core/src/Uppy.ts b/packages/@uppy/core/src/Uppy.ts index 5e1ddaf455..ed9e6bd9e8 100644 --- a/packages/@uppy/core/src/Uppy.ts +++ b/packages/@uppy/core/src/Uppy.ts @@ -883,6 +883,18 @@ export class Uppy< } } + validateRestrictions( + file: ValidateableFile, + files: ValidateableFile[] = this.getFiles(), + ): RestrictionError | null { + try { + this.#restricter.validate(files, [file]) + } catch (err) { + return err as any + } + return null + } + validateSingleFile(file: ValidateableFile): string | null { try { this.#restricter.validateSingleFile(file)