Sort things by public/private

This commit is contained in:
mitchellhamilton
2019-09-17 12:43:32 +10:00
parent 902339ecb3
commit 564f71feba
5 changed files with 70 additions and 5 deletions
+13
View File
@@ -124,3 +124,16 @@ export async function execWithOutput(
stderr: myError
};
}
export function sortTheThings(
a: { private: boolean; highestLevel: number },
b: { private: boolean; highestLevel: number }
) {
if (a.private === b.private) {
return b.highestLevel - a.highestLevel;
}
if (a.private) {
return 1;
}
return -1;
}