mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 11:52:12 +01:00
utils/verifyLanguageCode: fix variable names
This commit is contained in:
parent
fb6f384e46
commit
2f898f7dde
1 changed files with 2 additions and 2 deletions
|
@ -27,9 +27,9 @@ export function cleanString(string) {
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
export function verifyLanguageCode(code) {
|
export function verifyLanguageCode(code) {
|
||||||
const code = String(code.slice(0, 2).toLowerCase());
|
const langCode = String(code.slice(0, 2).toLowerCase());
|
||||||
if (RegExp(/[a-z]{2}/).test(code)) {
|
if (RegExp(/[a-z]{2}/).test(code)) {
|
||||||
return code
|
return langCode
|
||||||
}
|
}
|
||||||
return "en"
|
return "en"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue