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

Function chainAfter

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

* The text of the call chain starting at `at` — `({ … })`, and any `.update({ … })` * or `.lazy(…)` after it, which is where a route's component may be written.

(s: string, at: number)

Source from the content-addressed store, hash-verified

260 * or `.lazy(…)` after it, which is where a route's component may be written.
261 */
262function chainAfter(s: string, at: number): string {
263 let i = at;
264 const start = i;
265 for (let steps = 0; steps < 8; steps++) {
266 while (i < s.length && /\s/.test(s[i]!)) i++;
267 if (s[i] === '.') {
268 i++;
269 while (i < s.length && /[\w$]/.test(s[i]!)) i++;
270 while (i < s.length && /\s/.test(s[i]!)) i++;
271 }
272 if (s[i] !== '(') break;
273 const close = matchBracket(s, i);
274 if (close < 0) break;
275 i = close + 1;
276 }
277 return s.slice(start, i);
278}
279
280/** The component a route names: an identifier, or the file a lazy import names. */
281function componentIn(text: string): string | null {

Callers 1

parseTanstackRoutesFunction · 0.85

Calls 1

matchBracketFunction · 0.90

Tested by

no test coverage detected