From ce5f6dd318738242099bc2beddaff8bdbf0651fb Mon Sep 17 00:00:00 2001 From: Schalk Neethling Date: Sat, 5 Mar 2022 17:27:40 +0200 Subject: [PATCH] fix:action lower case strings before comparing When using `includes` with strings, the matching is case-sensitive so, lowercase both strings when matching. fix #10 --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3cb954f..e2b4079 100644 --- a/index.js +++ b/index.js @@ -88,7 +88,9 @@ function diffLabels(oldLabels, newLabels) { let labelModList = []; oldLabelsNames.forEach(oLabel => { - if (newLabelsNames.includes(oLabel)) { + // when using `includes` with strings, the match is case-sensitive + // so we first lowercase both strings when comparing + if (newLabelsNames.toLowerCase().includes(oLabel.toLowerCase())) { const oldLabel = oldLabels.filter(l => l.name === oLabel)[0]; const newLabel = newLabels.filter(l => l.name === oLabel)[0];