(pattern: string)
| 150 | // `vercel.dns` → 5 (2 literal segments, exact — beats same-prefix wildcard) |
| 151 | // `vercel.dns.create` → 7 (3 literal segments, exact) |
| 152 | export const patternSpecificity = (pattern: string): number => { |
| 153 | if (pattern === "*") return 0; |
| 154 | if (pattern.endsWith(".*")) { |
| 155 | const prefix = pattern.slice(0, -2); |
| 156 | return prefix.split(".").length * 2; |
| 157 | } |
| 158 | return pattern.split(".").length * 2 + 1; |
| 159 | }; |
| 160 | |
| 161 | /** |
| 162 | * Position key for a new rule among an owner's existing rules, placed just |
no outgoing calls
no test coverage detected