(filePath: string, blacklist: RegExp[], whitelist: RegExp[])
| 214 | } |
| 215 | |
| 216 | function isPathAllowed(filePath: string, blacklist: RegExp[], whitelist: RegExp[]): boolean { |
| 217 | const normalizedPath = resolveFilePath(filePath); |
| 218 | |
| 219 | if (blacklist.length > 0 && matchesCompiledPatterns(blacklist, normalizedPath)) { |
| 220 | return false; |
| 221 | } |
| 222 | |
| 223 | if (whitelist.length > 0) { |
| 224 | return matchesCompiledPatterns(whitelist, normalizedPath); |
| 225 | } |
| 226 | |
| 227 | return true; |
| 228 | } |
| 229 | |
| 230 | export function copyFiles(sourceDir: string, destDir: string, config: CopyConfig = {}) { |
| 231 | // Precompile patterns for efficiency. |
no test coverage detected