| 1 | export type TrashOperationSummary = { succeeded: string[]; failed: string[] }; |
| 2 | export async function purgeTrashBatch(paths: string[], purge: (path: string) => Promise<void>): Promise<TrashOperationSummary> { |
| 3 | const result: TrashOperationSummary = { succeeded: [], failed: [] }; |
| 4 | for (const path of new Set(paths)) { |
| 5 | try { await purge(path); result.succeeded.push(path); } |
| 6 | catch { result.failed.push(path); } |
| 7 | } |
| 8 | return result; |
| 9 | } |
| 10 |