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

Function functionBodyEnd

src/resolution/frameworks/express.ts:476–482  ·  view source on GitHub ↗
(text: string, fnAt: number)

Source from the content-addressed store, hash-verified

474
475
476function functionBodyEnd(text: string, fnAt: number): number {
477 const paramsOpen = text.indexOf('(', fnAt);
478 const paramsClose = paramsOpen >= 0 ? matchDelim(text, paramsOpen, '(', ')') : -1;
479 if (paramsClose < 0) return -1;
480 const braceAt = text.indexOf('{', paramsClose);
481 return braceAt >= 0 ? matchDelim(text, braceAt, '{', '}') : -1;
482}
483
484/** `args` split at its top-level commas, each piece with its offset into `args`. */
485export function topLevelArgs(args: string): Array<{ text: string; start: number }> {

Callers 1

handlerRefsFunction · 0.85

Calls 1

matchDelimFunction · 0.85

Tested by

no test coverage detected