MCPcopy Create free account
hub / github.com/backnotprop/plannotator / addRoot

Function addRoot

packages/shared/annotate-reference-roots-node.ts:14–24  ·  view source on GitHub ↗
(root: string | null | undefined)

Source from the content-addressed store, hash-verified

12export function getAnnotateReferenceRootPaths(options: AnnotateReferenceRootOptions): string[] {
13 const roots: string[] = [];
14 const addRoot = (root: string | null | undefined) => {
15 if (!root) return;
16 const resolved = resolveUserPath(root);
17 if (!roots.includes(resolved)) roots.push(resolved);
18 try {
19 const real = realpathSync(resolved);
20 if (!roots.includes(real)) roots.push(real);
21 } catch {
22 /* Missing source paths still contribute their lexical parent. */
23 }
24 };
25
26 if (options.mode === "annotate-folder" && options.folderPath) {
27 addRoot(options.folderPath);

Callers 1

Calls 2

resolveUserPathFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected