@os-team/i18next-tld-language-detector
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,13 +0,22 @@ | ||
const tldLocaleMap = { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = exports.detectLanguageByHost = void 0; | ||
var tldLocaleMap = { | ||
com: 'en', | ||
ru: 'ru' | ||
}; | ||
export const detectLanguageByHost = host => { | ||
const tld = host.slice(host.lastIndexOf('.') + 1); | ||
var detectLanguageByHost = host => { | ||
var tld = host.slice(host.lastIndexOf('.') + 1); | ||
return tldLocaleMap[tld]; | ||
}; | ||
const tldLanguageDetector = { | ||
exports.detectLanguageByHost = detectLanguageByHost; | ||
var tldLanguageDetector = { | ||
name: 'tld', | ||
lookup: req => { | ||
const host = typeof window === 'undefined' ? req.get('host') : window.location.hostname; | ||
var host = typeof window === 'undefined' ? req.get('host') : window.location.hostname; | ||
if (!host) return undefined; | ||
@@ -17,3 +26,4 @@ return detectLanguageByHost(host); | ||
}; | ||
export default tldLanguageDetector; | ||
var _default = tldLanguageDetector; | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@os-team/i18next-tld-language-detector", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -36,3 +36,3 @@ "repository": "git@gitlab.com:os-team/libs/utils.git", | ||
}, | ||
"gitHead": "07e4b2ac448f33eb1ab9f2a19e9f8896fdf7356c" | ||
"gitHead": "13c1eb95a749a3eff99931c905b7436388091b34" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8245
55