mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-19 02:03:29 +00:00
chore: generate
This commit is contained in:
parent
2f4d36d64e
commit
8b68dc0d7f
2 changed files with 2 additions and 9 deletions
|
|
@ -39,12 +39,7 @@ describe("store cleanup", () => {
|
|||
test("removes stale drafts by age without removing non-empty workspace stores", async () => {
|
||||
const root = await tempRoot()
|
||||
const now = new Date("2026-07-01T00:00:00.000Z")
|
||||
await writeStore(
|
||||
root,
|
||||
"opencode.draft.old.dat",
|
||||
'{"draft:prompt":"hello"}',
|
||||
new Date("2026-05-01T00:00:00.000Z"),
|
||||
)
|
||||
await writeStore(root, "opencode.draft.old.dat", '{"draft:prompt":"hello"}', new Date("2026-05-01T00:00:00.000Z"))
|
||||
await writeStore(root, "opencode.draft.recent.dat", '{"draft:prompt":"hello"}', now)
|
||||
await writeStore(
|
||||
root,
|
||||
|
|
|
|||
|
|
@ -87,9 +87,7 @@ async function isEmptyStore(file: string, size: number) {
|
|||
|
||||
try {
|
||||
const parsed = JSON.parse(raw) as unknown
|
||||
return (
|
||||
typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) && Object.keys(parsed).length === 0
|
||||
)
|
||||
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) && Object.keys(parsed).length === 0
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue