feat: delete sessions (#362)
publish / publish (push) Has been cancelled

Co-authored-by: adamdottv <2363879+adamdottv@users.noreply.github.com>
This commit is contained in:
Adam
2025-06-24 11:07:41 -05:00
committed by GitHub
parent 96e0f3ffc3
commit b0b9740de9
8 changed files with 490 additions and 17 deletions
+5
View File
@@ -29,6 +29,11 @@ export namespace Storage {
await fs.unlink(target).catch(() => {})
}
export async function removeDir(key: string) {
const target = path.join(state().dir, key)
await fs.rm(target, { recursive: true, force: true }).catch(() => {})
}
export async function readJSON<T>(key: string) {
return Bun.file(path.join(state().dir, key + ".json")).json() as Promise<T>
}