MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / naming

Function naming

__tests__/daemon-project-gone.test.ts:128–134  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

126 // The record files themselves: listDaemons leaves out a record whose pid is dead.
127 const registry = path.join(os.homedir(), '.codegraph', 'daemons');
128 const naming = (pid: number) => {
129 let files: string[] = [];
130 try { files = fs.readdirSync(registry); } catch { return 0; }
131 return files.filter((f) => {
132 try { const r = JSON.parse(fs.readFileSync(path.join(registry, f), 'utf8')); return r.root === root && r.pid === pid; } catch { return false; }
133 }).length;
134 };
135 try {
136 registerDaemon({ root, pid: 4343, version: '0.0.0-test', socketPath: 'x', startedAt: Date.now() });
137 expect(naming(4343)).toBe(1);

Callers 1

Calls 2

parseMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected