(reader)
| 635 | } |
| 636 | |
| 637 | function readAllDirectoryEntries(reader) { |
| 638 | return new Promise((resolve) => { |
| 639 | const entries = []; |
| 640 | const readBatch = function () { |
| 641 | reader.readEntries(function (batch) { |
| 642 | if (!batch || !batch.length) { |
| 643 | resolve(entries); |
| 644 | return; |
| 645 | } |
| 646 | for (let i = 0; i < batch.length; i++) { |
| 647 | entries.push(batch[i]); |
| 648 | } |
| 649 | readBatch(); |
| 650 | }); |
| 651 | }; |
| 652 | readBatch(); |
| 653 | }); |
| 654 | } |
| 655 | |
| 656 | async function walkEntry(entry, prefix) { |
| 657 | if (!entry) return []; |