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 GitHub
parent 1d211170a3
commit 68f45bf347
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -538,7 +538,7 @@ export class Html10n {
for (let i=0, n=langs.length; i < n; i++) {
lang = langs[i]
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
if(~lang.indexOf('-') != -1) {
lang = lang.split('-')[0];