( markdown: string, taskIndex: number, checked: boolean )
| 112 | } |
| 113 | |
| 114 | export function toggleTaskAtIndex( |
| 115 | markdown: string, |
| 116 | taskIndex: number, |
| 117 | checked: boolean |
| 118 | ): string { |
| 119 | return editTaskAtIndex(markdown, taskIndex, (match) => { |
| 120 | return `${match[1]}${checked ? 'x' : ' '}${match[3]}` |
| 121 | }) |
| 122 | } |
| 123 | |
| 124 | /** Same as `toggleTaskAtIndex`, with a name that matches the rest of |
| 125 | * the `setTask*` mutators. Kept as a separate export for callers that |
no test coverage detected