(filePath: string, pattern: string)
| 108 | } |
| 109 | |
| 110 | function doesFileMatchRegex(filePath: string, pattern: string): boolean { |
| 111 | try { |
| 112 | const regex = new RegExp(pattern) |
| 113 | return regex.test(filePath) |
| 114 | } catch (error) { |
| 115 | console.error(`Invalid regex pattern: ${pattern}`, error) |
| 116 | return false |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | export function isToolAllowedForMode( |
| 121 | tool: string, |
no test coverage detected