(name: string, pattern: string)
| 90 | |
| 91 | /** |
| 92 | * Resolve `config.fixed` glob groups to concrete package-name groups. |
| 93 | * Returns one entry per configured group (possibly empty if nothing matches). |
| 94 | */ |
| 95 | export function resolveFixedGroups(config: BumpyConfig, packageNames: Iterable<string>): string[][] { |
| 96 | const names = [...packageNames]; |
| 97 | return config.fixed.map((group) => names.filter((name) => group.some((pattern) => matchGlob(name, pattern)))); |
| 98 | } |
| 99 | |
| 100 | /** Simple glob matching for package names (supports * and **) */ |
| 101 | export function matchGlob(name: string, pattern: string): boolean { |
| 102 | // Exact match |
| 103 | if (name === pattern) return true; |
| 104 | // Convert glob to regex |
| 105 | const regexStr = pattern |
| 106 | .replace(/[.+^${}()|[\]\\]/g, '\\$&') // escape regex special chars |
no outgoing calls
no test coverage detected
searching dependent graphs…