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

Function functionBodyEnd

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

Source from the content-addressed store, hash-verified

710
711
712function functionBodyEnd(text: string, fnAt: number): number {
713 const paramsOpen = text.indexOf('(', fnAt);
714 const paramsClose = paramsOpen >= 0 ? matchDelim(text, paramsOpen, '(', ')') : -1;
715 if (paramsClose < 0) return -1;
716 const braceAt = text.indexOf('{', paramsClose);
717 return braceAt >= 0 ? matchDelim(text, braceAt, '{', '}') : -1;
718}
719
720/** `args` split at its top-level commas, each piece with its offset into `args`. */
721export 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