mirror of
https://github.com/transloadit/uppy.git
synced 2026-08-04 15:54:16 +00:00
@uppy/core: bring back validateRestrictions (#5538)
This commit is contained in:
parent
54ad2c7426
commit
5eb049779e
1 changed files with 12 additions and 0 deletions
|
|
@ -883,6 +883,18 @@ export class Uppy<
|
|||
}
|
||||
}
|
||||
|
||||
validateRestrictions(
|
||||
file: ValidateableFile<M, B>,
|
||||
files: ValidateableFile<M, B>[] = this.getFiles(),
|
||||
): RestrictionError<M, B> | null {
|
||||
try {
|
||||
this.#restricter.validate(files, [file])
|
||||
} catch (err) {
|
||||
return err as any
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
validateSingleFile(file: ValidateableFile<M, B>): string | null {
|
||||
try {
|
||||
this.#restricter.validateSingleFile(file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue