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

Function normalizeRuntimeScope

src/api/TaskNotesAPI.ts:3114–3137  ·  view source on GitHub ↗
(
	value: unknown,
	issues: TaskNotesRuntimeQueryIssue[]
)

Source from the content-addressed store, hash-verified

3112}
3113
3114function normalizeRuntimeScope(
3115 value: unknown,
3116 issues: TaskNotesRuntimeQueryIssue[]
3117): TaskNotesRuntimeNormalizedTaskQuery["scope"] {
3118 if (typeof value === "undefined" || value === null) return { includeArchived: true };
3119 if (!isRecord(value)) {
3120 issues.push({
3121 path: "$.scope",
3122 code: "scope_not_object",
3123 message: "Runtime query scope must be an object.",
3124 });
3125 return { includeArchived: true };
3126 }
3127
3128 return {
3129 includeArchived: value["includeArchived"] !== false,
3130 folders: normalizeFolderList(value["folders"], "$.scope.folders", issues),
3131 excludeFolders: normalizeFolderList(
3132 value["excludeFolders"],
3133 "$.scope.excludeFolders",
3134 issues
3135 ),
3136 };
3137}
3138
3139function normalizeFolderList(
3140 value: unknown,

Callers 1

Calls 2

normalizeFolderListFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected