(todos: TodoItem[])
| 159 | } |
| 160 | |
| 161 | function todoListToMarkdown(todos: TodoItem[]): string { |
| 162 | return todos |
| 163 | .map((t) => { |
| 164 | let box = "[ ]" |
| 165 | if (t.status === "completed") box = "[x]" |
| 166 | else if (t.status === "in_progress") box = "[-]" |
| 167 | return `${box} ${t.content}` |
| 168 | }) |
| 169 | .join("\n") |
| 170 | } |
| 171 | |
| 172 | function normalizeStatus(status: string | undefined): TodoStatus { |
| 173 | if (status === "completed") return "completed" |