From c361180c07d114e21efc2e2fd24392a4a417c19a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 19 Sep 2019 00:50:49 +0200 Subject: [PATCH] tools: make mailmap processing for author list case-insensitive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to accommodate Myles Borins otherwise ending up with multiple entries due to different casing in the email 🙂 PR-URL: https://github.com/nodejs/node/pull/29608 Reviewed-By: Rich Trott Reviewed-By: Jiawen Geng Reviewed-By: Yongsheng Zhang Reviewed-By: Saúl Ibarra Corretgé Reviewed-By: Luigi Pinca --- tools/update-authors.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/update-authors.js b/tools/update-authors.js index 3d7fcb14b2f461..312f253c4854e5 100755 --- a/tools/update-authors.js +++ b/tools/update-authors.js @@ -7,6 +7,13 @@ const path = require('path'); const fs = require('fs'); const readline = require('readline'); +class CaseIndifferentMap { + _map = new Map(); + + get(key) { return this._map.get(key.toLowerCase()); } + set(key, value) { return this._map.set(key.toLowerCase(), value); } +} + const log = spawn( 'git', // Inspect author name/email and body. @@ -23,7 +30,7 @@ else output.write('# Authors ordered by first contribution.\n\n'); -const mailmap = new Map(); +const mailmap = new CaseIndifferentMap(); { const lines = fs.readFileSync(path.resolve(__dirname, '../', '.mailmap'), { encoding: 'utf8' }).split('\n');