MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / buildTaskListGroupedScopePaths

Function buildTaskListGroupedScopePaths

src/bases/taskListGrouping.ts:136–153  ·  view source on GitHub ↗
(
	groups: readonly TaskListGroup[],
	taskNotes: readonly TaskInfo[],
	convertGroupKeyToString: (key: unknown) => string
)

Source from the content-addressed store, hash-verified

134}
135
136export function buildTaskListGroupedScopePaths(
137 groups: readonly TaskListGroup[],
138 taskNotes: readonly TaskInfo[],
139 convertGroupKeyToString: (key: unknown) => string
140): Map<string | null, string[]> {
141 const taskPaths = new Set(taskNotes.map((task) => task.path));
142 const groupedPaths = new Map<string | null, string[]>();
143
144 for (const group of groups) {
145 const groupKey = convertGroupKeyToString(group.key);
146 const paths = group.entries
147 .map((entry) => entry.file?.path)
148 .filter((path: string | undefined): path is string => !!path && taskPaths.has(path));
149 groupedPaths.set(groupKey, paths);
150 }
151
152 return groupedPaths;
153}
154
155export function buildTaskListSubPropertyScopePaths(
156 groupedTasks: ReadonlyMap<string, readonly TaskInfo[]>

Callers 2

renderGroupedMethod · 0.90

Calls 3

convertGroupKeyToStringFunction · 0.85
hasMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected