(filePath, pattern)
| 161 | } |
| 162 | |
| 163 | function matchesPathPattern(filePath, pattern) { |
| 164 | if (!pattern) return false; |
| 165 | const normalized = String(pattern).replace(/\\/g, '/'); |
| 166 | if (normalized.endsWith('/')) return filePath.startsWith(normalized); |
| 167 | if (normalized.includes('*') || normalized.includes('?') || normalized.includes('{')) { |
| 168 | return globToRegex(normalized).test(filePath); |
| 169 | } |
| 170 | return filePath === normalized || filePath.startsWith(normalized.replace(/\/$/, '') + '/'); |
| 171 | } |
| 172 | |
| 173 | function shouldBlockViolation(org, relativePath) { |
| 174 | if (org.locked !== true) return false; |
no test coverage detected