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

Function functionBodyEnd

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

Source from the content-addressed store, hash-verified

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