Skip to content

Commit

Permalink
@uppy/core: bring back validateRestrictions (#5538)
Browse files Browse the repository at this point in the history
  • Loading branch information
Murderlon authored Dec 16, 2024
1 parent 54ad2c7 commit 5eb0497
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/@uppy/core/src/Uppy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5eb0497

Please sign in to comment.