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

Function codeEndBefore

src/resolution/frameworks/express.ts:162–165  ·  view source on GitHub ↗

The offset after the last character before `at` that is not white space.

(text: string, at: number)

Source from the content-addressed store, hash-verified

160
161/** The offset after the last character before `at` that is not white space. */
162function codeEndBefore(text: string, at: number): number {
163 while (at > 0 && isSpace(text[at - 1])) at--;
164 return at;
165}
166
167/** The name that ends at `end`, or null: `routes` of `routes.get(`, nothing of `request(app).get(`. */
168function nameEndingAt(text: string, end: number): { name: string; start: number } | null {

Callers 3

chainStartFunction · 0.85
routeReceiversFunction · 0.85
extractFunction · 0.85

Calls 1

isSpaceFunction · 0.70

Tested by

no test coverage detected