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

Function closesOnLine

src/resolution/frameworks/express.ts:436–443  ·  view source on GitHub ↗
(s: string, i: number)

Source from the content-addressed store, hash-verified

434
435/** Whether the quote at `i` has an unescaped closing quote on the same line. */
436export function closesOnLine(s: string, i: number): boolean {
437 const q = s[i];
438 for (let k = i + 1; k < s.length && s[k] !== '\n'; k++) {
439 if (s[k] === '\\') k++;
440 else if (s[k] === q) return true;
441 }
442 return false;
443}
444
445/**
446 * The closing `/` of the regex literal the `/` at `i` opens, or -1 when it

Callers 2

codeFunction · 0.90
scanCallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected