MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / getTaskModalSubtaskCandidates

Function getTaskModalSubtaskCandidates

src/modals/taskModalSubtasks.ts:19–29  ·  view source on GitHub ↗
(
	allTasks: readonly T[],
	selectedSubtaskFiles: readonly PathLike[],
	currentTaskPath?: string
)

Source from the content-addressed store, hash-verified

17}
18
19export function getTaskModalSubtaskCandidates<T extends Pick<TaskInfo, "path">>(
20 allTasks: readonly T[],
21 selectedSubtaskFiles: readonly PathLike[],
22 currentTaskPath?: string
23): T[] {
24 const selectedPaths = new Set(selectedSubtaskFiles.map((file) => file.path));
25 return allTasks.filter((candidate) => {
26 if (currentTaskPath && candidate.path === currentTaskPath) return false;
27 return !selectedPaths.has(candidate.path);
28 });
29}
30
31export function addTaskModalSubtaskFile<T extends PathLike>(
32 selectedSubtaskFiles: readonly T[],

Callers 2

openSubtaskSelectorFunction · 0.90

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected