MCPcopy Create free account
hub / github.com/EmNudge/watlings / loadDraft

Function loadDraft

web-build/src/progress.ts:70–81  ·  view source on GitHub ↗
(
  chapterId: string,
  lessonId: string,
  exerciseHash: string,
)

Source from the content-addressed store, hash-verified

68}
69
70export function loadDraft(
71 chapterId: string,
72 lessonId: string,
73 exerciseHash: string,
74): { code: string; hostCode?: string } | null {
75 const drafts = getDrafts();
76 const draft = drafts[`${chapterId}/${lessonId}`];
77 if (draft && draft.exerciseHash === exerciseHash) {
78 return { code: draft.code, ...(draft.hostCode != null && { hostCode: draft.hostCode }) };
79 }
80 return null;
81}

Callers

nothing calls this directly

Calls 1

getDraftsFunction · 0.85

Tested by

no test coverage detected