Skip to content

Commit

Permalink
Removes unreachable if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
JirkaChadima committed Dec 27, 2024
1 parent e38ab2a commit 0b7ba64
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,13 @@ export const cleanupInput = (input, replacements = [], options = {}) => {
if (options.abbreviate && input.country_code && country2lang[input.country_code]) {
for (let i = 0; i < country2lang[input.country_code].length; i++) {
const lang = country2lang[input.country_code][i];
if (abbreviations[lang]) {
for (let j = 0; j < abbreviations[lang].length; j++) {
if (input[abbreviations[lang][j].component]) {
for (let k = 0; k < abbreviations[lang][j].replacements.length; k++) {
input[abbreviations[lang][j].component] = input[abbreviations[lang][j].component].replace(
new RegExp(`(^|\\s)${abbreviations[lang][j].replacements[k].src}\\b`),
for (let j = 0; j < abbreviations[lang].length; j++) {
if (input[abbreviations[lang][j].component]) {
for (let k = 0; k < abbreviations[lang][j].replacements.length; k++) {
input[abbreviations[lang][j].component] = input[abbreviations[lang][j].component].replace(
new RegExp(`(^|\\s)${abbreviations[lang][j].replacements[k].src}\\b`),
`$1${abbreviations[lang][j].replacements[k].dest}`
);
}
);
}
}
}
Expand Down

0 comments on commit 0b7ba64

Please sign in to comment.