Fix remaining localeCompare without locale set
This commit is contained in:
@@ -195,7 +195,8 @@ export function compareInputOutput(a: string, b: string): number {
|
||||
|
||||
// If either one is unknown, it is sorted last
|
||||
if (aIndex === -1 && bIndex === -1) {
|
||||
return a.localeCompare(b);
|
||||
// Use en-US because these are well-known strings that are not localized
|
||||
return a.localeCompare(b, "en-US");
|
||||
}
|
||||
if (aIndex === -1) {
|
||||
return 1;
|
||||
|
||||
@@ -94,8 +94,9 @@ export function compareRepository(
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back on name compare
|
||||
return left.fullName.localeCompare(right.fullName, undefined, {
|
||||
// Fall back on name compare. Use en-US because the repository name does not contain
|
||||
// special characters due to restrictions in GitHub owner/repository names.
|
||||
return left.fullName.localeCompare(right.fullName, "en-US", {
|
||||
sensitivity: "base",
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user