@formatjs/intl-displaynames 6.5.1 → 6.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/polyfill.iife.js +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-displaynames",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.2",
|
|
4
4
|
"description": "Polyfill for: https://tc39.es/proposal-intl-displaynames",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"url": "git+https://github.com/formatjs/formatjs.git"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@formatjs/ecma402-abstract": "1.17.
|
|
25
|
-
"@formatjs/intl-localematcher": "0.4.
|
|
24
|
+
"@formatjs/ecma402-abstract": "1.17.2",
|
|
25
|
+
"@formatjs/intl-localematcher": "0.4.2",
|
|
26
26
|
"tslib": "^2.4.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@formatjs/intl-getcanonicallocales": "2.2.1",
|
|
30
|
-
"@formatjs/intl-locale": "3.3.
|
|
30
|
+
"@formatjs/intl-locale": "3.3.4"
|
|
31
31
|
},
|
|
32
32
|
"bugs": {
|
|
33
33
|
"url": "https://github.com/formatjs/formatjs/issues"
|
package/polyfill.iife.js
CHANGED
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
if (availableLocale) {
|
|
248
248
|
result.locale = availableLocale;
|
|
249
249
|
if (locale !== noExtensionLocale) {
|
|
250
|
-
result.extension = locale.slice(noExtensionLocale.length
|
|
250
|
+
result.extension = locale.slice(noExtensionLocale.length, locale.length);
|
|
251
251
|
}
|
|
252
252
|
return result;
|
|
253
253
|
}
|
|
@@ -273,12 +273,16 @@
|
|
|
273
273
|
minimizedAvailableLocales.add(canonicalizedLocale);
|
|
274
274
|
});
|
|
275
275
|
var foundLocale;
|
|
276
|
+
var extension;
|
|
276
277
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
277
278
|
var l = requestedLocales_1[_i];
|
|
278
279
|
if (foundLocale) {
|
|
279
280
|
break;
|
|
280
281
|
}
|
|
281
282
|
var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
283
|
+
if (l !== noExtensionLocale) {
|
|
284
|
+
extension = l.slice(noExtensionLocale.length, l.length);
|
|
285
|
+
}
|
|
282
286
|
if (availableLocales.has(noExtensionLocale)) {
|
|
283
287
|
foundLocale = noExtensionLocale;
|
|
284
288
|
break;
|
|
@@ -300,7 +304,8 @@
|
|
|
300
304
|
return { locale: getDefaultLocale() };
|
|
301
305
|
}
|
|
302
306
|
return {
|
|
303
|
-
locale: availableLocaleMap[foundLocale] || canonicalizedLocaleMap[foundLocale] || minimizedAvailableLocaleMap[foundLocale] || foundLocale
|
|
307
|
+
locale: availableLocaleMap[foundLocale] || canonicalizedLocaleMap[foundLocale] || minimizedAvailableLocaleMap[foundLocale] || foundLocale,
|
|
308
|
+
extension
|
|
304
309
|
};
|
|
305
310
|
}
|
|
306
311
|
|