MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isEscaped

Function isEscaped

src/utils/settings/permissionValidation.ts:15–23  ·  view source on GitHub ↗

* Checks if a character at a given index is escaped (preceded by odd number of backslashes).

(str: string, index: number)

Source from the content-addressed store, hash-verified

13 * Checks if a character at a given index is escaped (preceded by odd number of backslashes).
14 */
15function isEscaped(str: string, index: number): boolean {
16 let backslashCount = 0
17 let j = index - 1
18 while (j >= 0 && str[j] === '\\') {
19 backslashCount++
20 j--
21 }
22 return backslashCount % 2 !== 0
23}
24
25/**
26 * Counts unescaped occurrences of a character in a string.

Callers 2

countUnescapedCharFunction · 0.85
hasUnescapedEmptyParensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected