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
This commit is contained in:
Schalk Neethling 2022-03-05 17:27:40 +02:00
commit ce5f6dd318
No known key found for this signature in database
GPG key ID: A270B41E87AFBCE1

View file

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