Fix misuse of in instead of includes method for checking array

This commit is contained in:
Suyun 2024-11-12 19:22:36 +08:00 committed by SamTV12345
parent 95f189c5c1
commit 8c1a519465

View file

@ -538,7 +538,7 @@ export class Html10n {
for (let i=0, n=langs.length; i < n; i++) { for (let i=0, n=langs.length; i < n; i++) {
lang = langs[i] lang = langs[i]
if(!lang) continue; if(!lang) continue;
if(!(lang in langs)) {// uh, we don't have this lang availbable.. if(!langs.includes(lang)) {// uh, we don't have this lang availbable..
// then check for related langs // then check for related langs
if(~lang.indexOf('-') != -1) { if(~lang.indexOf('-') != -1) {
lang = lang.split('-')[0]; lang = lang.split('-')[0];