fixed incorrect validation of words with capital letters
This commit is contained in:
parent
0830c7a87b
commit
e74a532e66
2 changed files with 16 additions and 9 deletions
|
|
@ -66,11 +66,15 @@ async function removeRepeatingWords({ fileName, locale, preferLowercase }) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!wordMap.has(lowercaseKey)) {
|
||||
wordMap.set(lowercaseKey, line);
|
||||
if (wordMap.has(lowercaseKey) && wordMap.get(lowercaseKey) !== line) {
|
||||
if (preferLowercase && lowercaseKey === line) {
|
||||
wordMap.set(lowercaseKey, line);
|
||||
} else if (!preferLowercase && lowercaseKey !== line) {
|
||||
wordMap.set(lowercaseKey, line);
|
||||
}
|
||||
}
|
||||
|
||||
if (!preferLowercase && wordMap.has(lowercaseKey) && !wordMap.has(line)) {
|
||||
if (!wordMap.has(lowercaseKey)) {
|
||||
wordMap.set(lowercaseKey, line);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue