MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / isEscaped

Function isEscaped

src/pkg/utils/regex_to_glob.ts:138–146  ·  view source on GitHub ↗
(s: string, idx: number)

Source from the content-addressed store, hash-verified

136 return [...r].reverse().join("");
137 }
138 function isEscaped(s: string, idx: number): boolean {
139 let k = idx - 1,
140 cnt = 0;
141 while (k >= 0 && s[k] === "\\") {
142 cnt++;
143 k--;
144 }
145 return cnt % 2 === 1;
146 }
147
148 // 提取字面头/尾(解转义)及其源长度
149 function literalHeadInfo(s: string): { lit: string; srcLen: number } {

Callers 2

literalTailInfoFunction · 0.85
tailSrcLenForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected