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

Function closesOnLine

src/resolution/frameworks/express.ts:422–429  ·  view source on GitHub ↗

Whether the quote at `i` has an unescaped closing quote on the same line.

(s: string, i: number)

Source from the content-addressed store, hash-verified

420
421/** Whether the quote at `i` has an unescaped closing quote on the same line. */
422function closesOnLine(s: string, i: number): boolean {
423 const q = s[i];
424 for (let k = i + 1; k < s.length && s[k] !== '\n'; k++) {
425 if (s[k] === '\\') k++;
426 else if (s[k] === q) return true;
427 }
428 return false;
429}
430
431/**
432 * The closing `/` of the regex literal the `/` at `i` opens, or -1 when it

Callers 1

scanCallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected