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

Function closingText

src/extraction/razor-script.ts:95–105  ·  view source on GitHub ↗

Where the ` ` closing the ` ` at `open` starts, nested ones counted; -1 if none before `to`.

(s: string, open: number, to: number)

Source from the content-addressed store, hash-verified

93
94/** Where the `</text>` closing the `<text>` at `open` starts, nested ones counted; -1 if none before `to`. */
95function closingText(s: string, open: number, to: number): number {
96 let depth = 0;
97 const tag = /<(\/?)text>/g;
98 tag.lastIndex = open;
99 let m: RegExpExecArray | null;
100 while ((m = tag.exec(s)) !== null && m.index < to) {
101 depth += m[1] ? -1 : 1;
102 if (depth === 0) return m.index;
103 }
104 return -1;
105}
106
107/** Keep what a statement block emits as JavaScript, and blank the C# around it. */
108function keepEmittedScript(s: string, out: string[], from: number, to: number): void {

Callers 1

keepEmittedScriptFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected