@formatjs/intl-localematcher
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -30,2 +30,3 @@ "use strict"; | ||
var foundLocale; | ||
var extension; | ||
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) { | ||
@@ -37,2 +38,5 @@ var l = requestedLocales_1[_i]; | ||
var noExtensionLocale = l.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, ''); | ||
if (l !== noExtensionLocale) { | ||
extension = l.slice(noExtensionLocale.length, l.length); | ||
} | ||
if (availableLocales.has(noExtensionLocale)) { | ||
@@ -65,4 +69,5 @@ foundLocale = noExtensionLocale; | ||
foundLocale, | ||
extension: extension, | ||
}; | ||
} | ||
exports.BestFitMatcher = BestFitMatcher; |
@@ -21,3 +21,3 @@ "use strict"; | ||
if (locale !== noExtensionLocale) { | ||
result.extension = locale.slice(noExtensionLocale.length + 1, locale.length); | ||
result.extension = locale.slice(noExtensionLocale.length, locale.length); | ||
} | ||
@@ -24,0 +24,0 @@ return result; |
@@ -27,2 +27,3 @@ import { BestAvailableLocale } from './BestAvailableLocale'; | ||
var foundLocale; | ||
var extension; | ||
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) { | ||
@@ -34,2 +35,5 @@ var l = requestedLocales_1[_i]; | ||
var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, ''); | ||
if (l !== noExtensionLocale) { | ||
extension = l.slice(noExtensionLocale.length, l.length); | ||
} | ||
if (availableLocales.has(noExtensionLocale)) { | ||
@@ -62,3 +66,4 @@ foundLocale = noExtensionLocale; | ||
foundLocale, | ||
extension: extension, | ||
}; | ||
} |
@@ -18,3 +18,3 @@ import { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils'; | ||
if (locale !== noExtensionLocale) { | ||
result.extension = locale.slice(noExtensionLocale.length + 1, locale.length); | ||
result.extension = locale.slice(noExtensionLocale.length, locale.length); | ||
} | ||
@@ -21,0 +21,0 @@ return result; |
{ | ||
"name": "@formatjs/intl-localematcher", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Intl.LocaleMatcher ponyfill", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
36803
731