* Compare specificities: returns negative if s1 < s2, positive if s1 > s2, 0 if equal.
(
s1: { a: number; b: number; c: number },
s2: { a: number; b: number; c: number }
)
| 213 | * Compare specificities: returns negative if s1 < s2, positive if s1 > s2, 0 if equal. |
| 214 | */ |
| 215 | function compareSpecificity( |
| 216 | s1: { a: number; b: number; c: number }, |
| 217 | s2: { a: number; b: number; c: number } |
| 218 | ): number { |
| 219 | if (s1.a !== s2.a) return s1.a - s2.a; |
| 220 | if (s1.b !== s2.b) return s1.b - s2.b; |
| 221 | return s1.c - s2.c; |
| 222 | } |
| 223 | |
| 224 | // ─── Core Functions ───────────────────────────────────────────── |
| 225 |