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

Function applyRuntimeQueryScope

src/api/TaskNotesAPI.ts:3298–3310  ·  view source on GitHub ↗
(
	tasks: TaskInfo[],
	scope: TaskNotesRuntimeNormalizedTaskQuery["scope"]
)

Source from the content-addressed store, hash-verified

3296}
3297
3298function applyRuntimeQueryScope(
3299 tasks: TaskInfo[],
3300 scope: TaskNotesRuntimeNormalizedTaskQuery["scope"]
3301): TaskInfo[] {
3302 return tasks.filter((task) => {
3303 if (!scope.includeArchived && task.archived) return false;
3304 if (scope.folders && !scope.folders.some((folder) => taskIsInFolder(task, folder))) {
3305 return false;
3306 }
3307 if (scope.excludeFolders?.some((folder) => taskIsInFolder(task, folder))) return false;
3308 return true;
3309 });
3310}
3311
3312function taskIsInFolder(task: TaskInfo, folder: string): boolean {
3313 const normalizedFolder = normalizePath(folder);

Callers 1

queryTasksMethod · 0.85

Calls 1

taskIsInFolderFunction · 0.85

Tested by

no test coverage detected