indexOf instead of includes to avoid a polyfill

This commit is contained in:
Matteo Manzinello 2020-07-31 10:34:34 +02:00
parent 6a56467515
commit 1326cc3249
11 changed files with 13 additions and 13 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/mailgo.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -300,7 +300,7 @@ var mailgoInit = function mailgoInit() {
var _ref = i18n,
translations = _ref.translations; // if a default language is defined use it
if (((_config = config) === null || _config === void 0 ? void 0 : _config.lang) && i18n.languages.includes(config.lang)) {
if (((_config = config) === null || _config === void 0 ? void 0 : _config.lang) && i18n.languages.indexOf(config.lang) !== -1) {
lang = config.lang;
} // if is defined <html lang=""> use it!
@ -309,7 +309,7 @@ var mailgoInit = function mailgoInit() {
// keep the lang from html
var htmlLang = document.documentElement.lang; // if there are translations...
if (i18n.languages.includes(htmlLang)) {
if (i18n.languages.indexOf(htmlLang) !== -1) {
lang = document.documentElement.lang;
}
} // strings

File diff suppressed because one or more lines are too long

View File

@ -93,7 +93,7 @@ const mailgoInit = (): void => {
}: { translations: MailgoTranslations } = i18n as MailgoI18n;
// if a default language is defined use it
if (config?.lang && i18n.languages.includes(config.lang)) {
if (config?.lang && i18n.languages.indexOf(config.lang) !== -1) {
lang = config.lang;
}
@ -103,7 +103,7 @@ const mailgoInit = (): void => {
let htmlLang: string = document.documentElement.lang;
// if there are translations...
if (i18n.languages.includes(htmlLang)) {
if (i18n.languages.indexOf(htmlLang) !== -1) {
lang = document.documentElement.lang;
}
}