MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / toggleTaskAtIndex

Function toggleTaskAtIndex

packages/shared-domain/src/tasklists.ts:114–122  ·  view source on GitHub ↗
(
  markdown: string,
  taskIndex: number,
  checked: boolean
)

Source from the content-addressed store, hash-verified

112}
113
114export 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

Callers 3

store.tsFile · 0.90
onChangeFunction · 0.90
setTaskCheckedAtIndexFunction · 0.70

Calls 1

editTaskAtIndexFunction · 0.85

Tested by

no test coverage detected