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

Function normalizeContextList

src/components/TaskContextMenu.ts:73–86  ·  view source on GitHub ↗
(contexts: string[] | undefined)

Source from the content-addressed store, hash-verified

71}
72
73function normalizeContextList(contexts: string[] | undefined): string[] {
74 const seen = new Set<string>();
75 const normalized: string[] = [];
76
77 for (const context of contexts ?? []) {
78 if (typeof context !== "string") continue;
79 const value = normalizeContextValue(context);
80 if (!value || seen.has(value)) continue;
81 seen.add(value);
82 normalized.push(value);
83 }
84
85 return normalized;
86}
87
88export function addContextToList(
89 contexts: string[] | undefined,

Callers 5

addContextToListFunction · 0.85
removeContextFromListFunction · 0.85
toggleContextInListFunction · 0.85
addContextMenuItemsMethod · 0.85
getContextOptionsMethod · 0.85

Calls 2

normalizeContextValueFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected