(pattern: string)
| 193 | // `vercel.dns` → 5 (2 literal segments, exact — beats same-prefix wildcard) |
| 194 | // `vercel.dns.create` → 7 (3 literal segments, exact) |
| 195 | export const patternSpecificity = (pattern: string): number => { |
| 196 | if (pattern === "*") return 0; |
| 197 | if (pattern.endsWith(".*")) { |
| 198 | const prefix = pattern.slice(0, -2); |
| 199 | return prefix.split(".").length * 2; |
| 200 | } |
| 201 | return pattern.split(".").length * 2 + 1; |
| 202 | }; |
| 203 | |
| 204 | /** |
| 205 | * Position key for a new rule among an owner's existing rules, placed just |
no outgoing calls
no test coverage detected