(key: string)
| 56 | } |
| 57 | |
| 58 | function readStoredDraftGeneration(key: string): number | null { |
| 59 | const filePath = draftPath(key); |
| 60 | try { |
| 61 | if (!existsSync(filePath)) return null; |
| 62 | const parsed = JSON.parse(readFileSync(filePath, "utf-8")); |
| 63 | return readGeneration((parsed as { draftGeneration?: unknown }).draftGeneration); |
| 64 | } catch { |
| 65 | return null; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | export function getDraftGeneration(key: string): number | null { |
| 70 | const generations = [ |
no test coverage detected