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

Function unescapeRuleContent

src/utils/permissions/permissionRuleParser.ts:74–79  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

72 * unescapeRuleContent('echo "test\\\\nvalue"') // => 'echo "test\\nvalue"'
73 */
74export function unescapeRuleContent(content: string): string {
75 return content
76 .replace(/\\\(/g, '(') // Unescape opening parentheses
77 .replace(/\\\)/g, ')') // Unescape closing parentheses
78 .replace(/\\\\/g, '\\') // Unescape backslashes last
79}
80
81/**
82 * Parses a permission rule string into its components.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected