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

Function modelOf

__tests__/framework-resolve-language.test.ts:183–186  ·  view source on GitHub ↗
(page: string)

Source from the content-addressed store, hash-verified

181
182 it('still links each page’s `@model` to the PageModel beside it', () => {
183 const modelOf = (page: string) => {
184 const ids = cg.getNodesInFile(page).map((n) => n.id);
185 return cg.getOutgoingEdgesFrom(ids).filter((e) => e.kind === 'references').map((e) => cg.getNode(e.target)!.filePath);
186 };
187 expect(modelOf('Pages/Index.cshtml')).toEqual(['Pages/Index.cshtml.cs']);
188 expect(modelOf('Pages/Basket/Index.cshtml')).toEqual(['Pages/Basket/Index.cshtml.cs']);
189 });

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected