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

Function removeCodeGraphToolset

src/installer/targets/hermes.ts:334–350  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

332}
333
334function removeCodeGraphToolset(content: string): string {
335 const lines = splitLines(content);
336 const parent = topLevelRange(lines, 'platform_toolsets');
337 const cli = parent ? listChildBlock(lines, parent, 'cli') : null;
338 if (!cli) return content;
339
340 const hasEntry = lines
341 .slice(cli.start + 1, cli.end)
342 .some((line) => line.trim() === '- mcp-codegraph');
343 if (!hasEntry) return content;
344
345 const next = lines.filter((line, idx) => {
346 if (idx <= cli.start || idx >= cli.end) return true;
347 return line.trim() !== '- mcp-codegraph';
348 });
349 return joinLines(next);
350}
351
352function arrayEqual(a: string[], b: string[]): boolean {
353 return a.length === b.length && a.every((value, idx) => value === b[idx]);

Callers 1

uninstallMethod · 0.85

Calls 4

splitLinesFunction · 0.85
topLevelRangeFunction · 0.85
listChildBlockFunction · 0.85
joinLinesFunction · 0.85

Tested by

no test coverage detected