MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / makeContext

Function makeContext

__tests__/frameworks.test.ts:570–588  ·  view source on GitHub ↗
(opts: {
    files?: Record<string, string>;
    nodes?: Node[];
  })

Source from the content-addressed store, hash-verified

568 }
569
570 function makeContext(opts: {
571 files?: Record<string, string>;
572 nodes?: Node[];
573 }) {
574 const files = opts.files ?? {};
575 const all = opts.nodes ?? [];
576 return {
577 getNodesInFile: (fp: string) => all.filter((n) => n.filePath === fp),
578 getNodesByName: (name: string) => all.filter((n) => n.name === name),
579 getNodesByQualifiedName: () => [],
580 getNodesByKind: (kind: Node['kind']) => all.filter((n) => n.kind === kind),
581 fileExists: (fp: string) => files[fp] !== undefined,
582 readFile: (fp: string) => files[fp] ?? null,
583 getProjectRoot: () => '/test',
584 getAllFiles: () => Object.keys(files),
585 getNodesByLowerName: () => [],
586 getImportMappings: () => [],
587 } as any;
588 }
589
590 it('prepends RouterModule prefix to a controller route (top-level register)', () => {
591 const ctx = makeContext({

Callers 1

frameworks.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected