tools: fix small not-quite-a-bug in find-inactive-tsc.mjs

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 <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tierney Cyren <hello@bnb.im>
pull/41515/head
Rich Trott 2022-01-13 22:22:42 -08:00 committed by GitHub
parent 79e07a42f9
commit 426df1b836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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;