bpms_site/.svn/pristine/5c/5c193b2f05ed8eecca7289fb59dca10bae084a5a.svn-base
2025-11-02 16:38:49 +03:30

26 lines
959 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "detectDomainLocale", {
enumerable: true,
get: function() {
return detectDomainLocale;
}
});
function detectDomainLocale(domainItems, hostname, detectedLocale) {
if (!domainItems) return;
if (detectedLocale) {
detectedLocale = detectedLocale.toLowerCase();
}
for (const item of domainItems){
var _item_domain, _item_locales;
// remove port if present
const domainHostname = (_item_domain = item.domain) == null ? void 0 : _item_domain.split(":")[0].toLowerCase();
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? void 0 : _item_locales.some((locale)=>locale.toLowerCase() === detectedLocale))) {
return item;
}
}
}
//# sourceMappingURL=detect-domain-locale.js.map