Skip to content

Commit

Permalink
fix: resolved types error
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Jul 11, 2023
1 parent 295eaa2 commit 2790e41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/upload/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ export function getFileUrlByFileRaw(fileRaw: File): Promise<string> {
export function getFileList(files: FileList, accept?: string) {
const fileList: File[] = [];
for (let i = 0; i < files.length; i++) {
const regExp = new RegExp(accept);
if (regExp.test(files[i].type)) {
fileList.push(files[i]);
if (accept) {
const regExp = new RegExp(accept);
if (regExp.test(files[i].type)) {
fileList.push(files[i]);
}
}
}
return fileList;
Expand Down

0 comments on commit 2790e41

Please sign in to comment.