MCPcopy Create free account
hub / github.com/codeaashu/claude-code / isEscapedAtPosition

Function isEscapedAtPosition

src/tools/BashTool/bashSecurity.ts:1727–1735  ·  view source on GitHub ↗

* Checks if a character at position `pos` in `content` is escaped by counting * consecutive backslashes before it. An odd number means it's escaped.

(content: string, pos: number)

Source from the content-addressed store, hash-verified

1725 * consecutive backslashes before it. An odd number means it's escaped.
1726 */
1727function isEscapedAtPosition(content: string, pos: number): boolean {
1728 let backslashCount = 0
1729 let i = pos - 1
1730 while (i >= 0 && content[i] === '\\') {
1731 backslashCount++
1732 i--
1733 }
1734 return backslashCount % 2 === 1
1735}
1736
1737/**
1738 * Detects unquoted brace expansion syntax that Bash expands but shell-quote/tree-sitter

Callers 1

validateBraceExpansionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected