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

Function isLayoutFile

src/resolution/frameworks/tanstack-router.ts:126–130  ·  view source on GitHub ↗

* True for a file that wraps a subtree rather than rendering a page at its own * address. * * ` ` is where children render, so a route file that has one is the * layout AROUND an address and the index route beside it is the page AT it — * `_auth.invoices.tsx` and `_auth.invoices.index.

(filePath: string, content: string)

Source from the content-addressed store, hash-verified

124 * then the extra screen is already in the index.
125 */
126function isLayoutFile(filePath: string, content: string): boolean {
127 const base = filePath.slice(filePath.lastIndexOf('/') + 1);
128 if (/(?:^|\.)route\.(?:tsx|ts|jsx|js)$/.test(base)) return true;
129 return /<Outlet\b/.test(content);
130}
131
132function languageForFile(filePath: string): Language {
133 if (filePath.endsWith('.tsx')) return 'tsx';

Callers 1

extractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected