From 5129b7c802629168e8f31aa2e45c5ac7e6abd0c1 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 13 Jan 2022 22:22:42 -0800 Subject: [PATCH] tools: fix small not-quite-a-bug in find-inactive-tsc.mjs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code attempts to count votes from people who were not members at the start of the 3 month period, resulting in `NaN` being tallied for their votes. PR-URL: https://github.com/nodejs/node/pull/41469 Reviewed-By: Gireesh Punathil Reviewed-By: Richard Lau Reviewed-By: Tobias Nießen Reviewed-By: Tierney Cyren --- tools/find-inactive-tsc.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/find-inactive-tsc.mjs b/tools/find-inactive-tsc.mjs index 362e2ee293922c..5c4c37038988b0 100755 --- a/tools/find-inactive-tsc.mjs +++ b/tools/find-inactive-tsc.mjs @@ -118,7 +118,9 @@ async function getVotingRecords(tscMembers, votes) { await fs.promises.readFile(path.join('.tmp', vote), 'utf8') ); for (const member in voteData.votes) { - votingRecords[member]++; + if (tscMembers.includes(member)) { + votingRecords[member]++; + } } } return votingRecords;