(a: string, b: string)
| 338 | } |
| 339 | |
| 340 | function packageNameComparator(a: string, b: string) { |
| 341 | const order = (name: string): [number, string] => { |
| 342 | if (name === "react-router") return [0, name]; |
| 343 | if (name.startsWith("@react-router/")) return [1, name]; |
| 344 | return [2, name]; |
| 345 | }; |
| 346 | |
| 347 | const [orderA, nameA] = order(a); |
| 348 | const [orderB, nameB] = order(b); |
| 349 | |
| 350 | if (orderA !== orderB) return orderA - orderB; |
| 351 | return nameA.localeCompare(nameB); |
| 352 | } |
| 353 | |
| 354 | /** |
| 355 | * Formats validation errors for display |
no test coverage detected