MCPcopy Index your code
hub / github.com/remix-run/react-router / packageNameComparator

Function packageNameComparator

scripts/changes/changes.ts:340–352  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

338}
339
340function 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

Callers 1

parseAllChangeFilesFunction · 0.85

Calls 1

orderFunction · 0.70

Tested by

no test coverage detected