(content: string)
| 53 | * escapeRuleContent('echo "test\\nvalue"') // => 'echo "test\\\\nvalue"' |
| 54 | */ |
| 55 | export function escapeRuleContent(content: string): string { |
| 56 | return content |
| 57 | .replace(/\\/g, '\\\\') // Escape backslashes first |
| 58 | .replace(/\(/g, '\\(') // Escape opening parentheses |
| 59 | .replace(/\)/g, '\\)') // Escape closing parentheses |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Unescapes special characters in rule content after parsing from permission rules. |
no outgoing calls
no test coverage detected