utils: fix variable name shadowing

This commit is contained in:
wukko 2024-05-15 22:50:58 +06:00
parent b4364c4921
commit 58e525de61
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -27,9 +27,9 @@ export function cleanString(string) {
return string;
}
export function verifyLanguageCode(code) {
const languageCode = String(code.slice(0, 2).toLowerCase());
if (RegExp(/[a-z]{2}/).test(languageCode)) {
return languageCode
const code = String(code.slice(0, 2).toLowerCase());
if (RegExp(/[a-z]{2}/).test(code)) {
return code
}
return "en"
}