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

Function functionBodyEnd

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

Source from the content-addressed store, hash-verified

459
460
461function functionBodyEnd(text: string, fnAt: number): number {
462 const paramsOpen = text.indexOf('(', fnAt);
463 const paramsClose = paramsOpen >= 0 ? matchDelim(text, paramsOpen, '(', ')') : -1;
464 if (paramsClose < 0) return -1;
465 const braceAt = text.indexOf('{', paramsClose);
466 return braceAt >= 0 ? matchDelim(text, braceAt, '{', '}') : -1;
467}
468
469/** `args` split at its top-level commas, each piece with its offset into `args`. */
470function topLevelArgs(args: string): Array<{ text: string; start: number }> {

Callers 1

handlerRefsFunction · 0.85

Calls 1

matchDelimFunction · 0.85

Tested by

no test coverage detected