MCPcopy Create free account
hub / github.com/backnotprop/plannotator / readStoredDraftGeneration

Function readStoredDraftGeneration

packages/shared/draft.ts:58–67  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

56}
57
58function 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
69export function getDraftGeneration(key: string): number | null {
70 const generations = [

Callers 2

getDraftGenerationFunction · 0.85
saveDraftFunction · 0.85

Calls 3

draftPathFunction · 0.85
readGenerationFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected