(count: number)
| 16 | const tick = () => new Promise<void>((resolve) => setTimeout(resolve, 0)) |
| 17 | |
| 18 | const take = (count: number) => { |
| 19 | if (queued.size === 0) return [] as string[] |
| 20 | const items: string[] = [] |
| 21 | for (const [id, directory] of queued) { |
| 22 | queued.delete(id) |
| 23 | items.push(directory) |
| 24 | if (items.length >= count) break |
| 25 | } |
| 26 | return items |
| 27 | } |
| 28 | |
| 29 | const schedule = () => { |
| 30 | if (timer) return |