(root: string)
| 3246 | } |
| 3247 | |
| 3248 | export async function emptyTrash(root: string): Promise<void> { |
| 3249 | const trashDir = path.join(root, 'trash') |
| 3250 | try { |
| 3251 | const entries = await fs.readdir(trashDir) |
| 3252 | await Promise.all(entries.map((e) => removeNoteComments(root, `trash/${e}`))) |
| 3253 | await Promise.all( |
| 3254 | entries.map((e) => fs.rm(path.join(trashDir, e), { recursive: true, force: true })) |
| 3255 | ) |
| 3256 | invalidateNoteMetaCache(root) |
| 3257 | invalidateVaultTextSearchCache(root) |
| 3258 | } catch { |
| 3259 | /* no trash dir yet */ |
| 3260 | } |
| 3261 | } |
| 3262 | |
| 3263 | export async function deleteNote(root: string, rel: string): Promise<void> { |
| 3264 | const abs = resolveSafe(root, rel) |
no test coverage detected