Fix sorting for commit messages

This commit is contained in:
Caleb Owens 2024-05-15 07:33:23 +01:00
parent 6200b950c6
commit a4a05b0c4c

View File

@ -86,7 +86,7 @@ export function buildDiff(hunks: Hunk[], limit: number) {
function shuffle<T>(items: T[]): T[] { function shuffle<T>(items: T[]): T[] {
return items return items
.map((item) => ({ item, value: Math.random() })) .map((item) => ({ item, value: Math.random() }))
.sort() .sort(({ value: a }, { value: b }) => a - b)
.map((item) => item.item); .map((item) => item.item);
} }