Skip to content

Commit

Permalink
refactor: for...of chang to for
Browse files Browse the repository at this point in the history
  • Loading branch information
huiliangShen committed Aug 7, 2024
1 parent 1f8cbae commit b1f3410
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/traverseFileTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ const traverseFileTree = async (files: InternalDataTransferItem[], isAccepted) =
const results = await new Promise<InternalDataTransferItem[]>((resolve) => {
dirReader.readEntries(resolve, () => resolve([]));
});

if (!results.length) {
const n = results.length;

if (!n) {
break;
}

for (const entry of results) {
entries.push(entry);
for (let i = 0; i < n; i++) {
entries.push(results[i]);
}
}
return entries;
Expand Down

0 comments on commit b1f3410

Please sign in to comment.