(files, why)
| 328 | }; |
| 329 | |
| 330 | const flush = async (files, why) => { |
| 331 | const upserts = []; |
| 332 | const removals = []; |
| 333 | const reports = []; |
| 334 | for (const file of files) { |
| 335 | const result = await rebuildFile(file, why); |
| 336 | upserts.push(...result.upserts); |
| 337 | removals.push(...result.removals); |
| 338 | reports.push(...result.reports); |
| 339 | } |
| 340 | if (!upserts.length && !removals.length && !reports.length) return; |
| 341 | version += 1; |
| 342 | broadcast({ type: "patch", version, upserts, removals, reports }); |
| 343 | }; |
| 344 | |
| 345 | const initial = await readdir(directory, { withFileTypes: true }); |
| 346 | for (const entry of initial) { |
no test coverage detected