From c403a1424a2158d95fff977d3f663a646e398d25 Mon Sep 17 00:00:00 2001 From: Vlad-Stefan Harbuz Date: Fri, 20 Sep 2024 15:12:24 +0100 Subject: [PATCH] Sort by dollars per dev after sorting by devs Closes #134 --- src/members.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/members.ts b/src/members.ts index 2ec3053..87b6e01 100644 --- a/src/members.ts +++ b/src/members.ts @@ -83,7 +83,13 @@ export function sortMembersByDevs(members: MemberWithId[]): MemberWithId[] { } const devs1 = m1.data.annualReports[0].averageNumberOfDevs; const devs2 = m2.data.annualReports[0].averageNumberOfDevs; - return devs2 - devs1; + if (devs1 == devs2) { + const dpd1 = getDollarsPerDev(m1.data.annualReports[0]); + const dpd2 = getDollarsPerDev(m2.data.annualReports[0]); + return dpd2 - dpd1; + } else { + return devs2 - devs1; + } }); }