()
| 35 | } |
| 36 | |
| 37 | async function getRandomFileHandle() { |
| 38 | const files = []; |
| 39 | for await (const entry of rootHandle.values()) { |
| 40 | if (entry.kind === 'file') { |
| 41 | files.push(entry); |
| 42 | } |
| 43 | } |
| 44 | if (files.length === 0) { |
| 45 | return null; |
| 46 | } |
| 47 | const randomIndex = Math.floor(Math.random() * files.length); |
| 48 | return files[randomIndex]; |
| 49 | } |
| 50 | |
| 51 | async function createFile() { |
| 52 | const fileName = `file_${Date.now()}.txt`; |
no outgoing calls
no test coverage detected