Find a package config from the root config, supporting glob patterns
(config: BumpyConfig, pkgName: string)
| 79 | |
| 80 | /** Find a package config from the root config, supporting glob patterns */ |
| 81 | function findPackageConfig(config: BumpyConfig, pkgName: string): PackageConfig { |
| 82 | // Exact match first |
| 83 | if (config.packages[pkgName]) return config.packages[pkgName]; |
| 84 | // Try glob matches |
| 85 | for (const [pattern, pkgConfig] of Object.entries(config.packages)) { |
| 86 | if (matchGlob(pkgName, pattern)) return pkgConfig; |
| 87 | } |
| 88 | return {}; |
| 89 | } |
| 90 | |
| 91 | /** Simple glob matching for package names (supports * and **) */ |
| 92 | export function matchGlob(name: string, pattern: string): boolean { |
no test coverage detected
searching dependent graphs…