( chapterId: string, lessonId: string, exerciseHash: string, )
| 68 | } |
| 69 | |
| 70 | export 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 | } |
nothing calls this directly
no test coverage detected