refactor: improve package sorting

This commit is contained in:
afn 2023-08-09 17:08:38 -04:00
parent 7d3c409fdf
commit 7692381ed2

View File

@ -48,9 +48,8 @@ async function patches(): Promise<PatchesData> {
}
// sort packages by patch count to get most relevant apps on top
const packages = Object.entries(packagesWithCount)
.sort((a, b) => b[1] - a[1])
.map((pkg) => pkg[0]);
const packages = Object.keys(packagesWithCount);
packages.sort((a, b) => packagesWithCount[b] - packagesWithCount[a]);
return { patches: json.patches, packages };
}