@formatjs/intl-displaynames 6.1.2 → 6.1.4
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/lib/should-polyfill.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function _shouldPolyfillWithoutLocale(): boolean;
|
|
2
|
-
export declare function shouldPolyfill(locale?: string): string | undefined;
|
|
2
|
+
export declare function shouldPolyfill(locale?: string): string | true | undefined;
|
|
3
3
|
//# sourceMappingURL=should-polyfill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../should-polyfill.ts"],"names":[],"mappings":"AA4CA,wBAAgB,4BAA4B,YAE3C;AAED,wBAAgB,cAAc,CAAC,MAAM,SAAO,
|
|
1
|
+
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../should-polyfill.ts"],"names":[],"mappings":"AA4CA,wBAAgB,4BAA4B,YAE3C;AAED,wBAAgB,cAAc,CAAC,MAAM,SAAO,6BAQ3C"}
|
package/lib/should-polyfill.js
CHANGED
|
@@ -37,7 +37,12 @@ export function _shouldPolyfillWithoutLocale() {
|
|
|
37
37
|
}
|
|
38
38
|
export function shouldPolyfill(locale) {
|
|
39
39
|
if (locale === void 0) { locale = 'en'; }
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
try {
|
|
41
|
+
if (_shouldPolyfillWithoutLocale() || !supportedLocalesOf(locale)) {
|
|
42
|
+
return match([locale], supportedLocales, 'en');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
return true;
|
|
42
47
|
}
|
|
43
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-displaynames",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.4",
|
|
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.
|
|
24
|
+
"@formatjs/ecma402-abstract": "1.13.0",
|
|
25
25
|
"@formatjs/intl-localematcher": "0.2.31",
|
|
26
26
|
"tslib": "2.4.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@formatjs/intl-getcanonicallocales": "2.0.4",
|
|
30
|
-
"@formatjs/intl-locale": "3.0.
|
|
30
|
+
"@formatjs/intl-locale": "3.0.7"
|
|
31
31
|
},
|
|
32
32
|
"bugs": {
|
|
33
33
|
"url": "https://github.com/formatjs/formatjs/issues"
|
package/polyfill.iife.js
CHANGED
|
@@ -687,8 +687,12 @@
|
|
|
687
687
|
if (locale === void 0) {
|
|
688
688
|
locale = "en";
|
|
689
689
|
}
|
|
690
|
-
|
|
691
|
-
|
|
690
|
+
try {
|
|
691
|
+
if (_shouldPolyfillWithoutLocale() || !supportedLocalesOf(locale)) {
|
|
692
|
+
return match([locale], supportedLocales, "en");
|
|
693
|
+
}
|
|
694
|
+
} catch (e) {
|
|
695
|
+
return true;
|
|
692
696
|
}
|
|
693
697
|
}
|
|
694
698
|
|
package/should-polyfill.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function _shouldPolyfillWithoutLocale(): boolean;
|
|
2
|
-
export declare function shouldPolyfill(locale?: string): string | undefined;
|
|
2
|
+
export declare function shouldPolyfill(locale?: string): string | true | undefined;
|
|
3
3
|
//# sourceMappingURL=should-polyfill.d.ts.map
|
package/should-polyfill.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["should-polyfill.ts"],"names":[],"mappings":"AA4CA,wBAAgB,4BAA4B,YAE3C;AAED,wBAAgB,cAAc,CAAC,MAAM,SAAO,
|
|
1
|
+
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["should-polyfill.ts"],"names":[],"mappings":"AA4CA,wBAAgB,4BAA4B,YAE3C;AAED,wBAAgB,cAAc,CAAC,MAAM,SAAO,6BAQ3C"}
|
package/should-polyfill.js
CHANGED
|
@@ -41,8 +41,13 @@ function _shouldPolyfillWithoutLocale() {
|
|
|
41
41
|
exports._shouldPolyfillWithoutLocale = _shouldPolyfillWithoutLocale;
|
|
42
42
|
function shouldPolyfill(locale) {
|
|
43
43
|
if (locale === void 0) { locale = 'en'; }
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
try {
|
|
45
|
+
if (_shouldPolyfillWithoutLocale() || !supportedLocalesOf(locale)) {
|
|
46
|
+
return (0, intl_localematcher_1.match)([locale], supported_locales_generated_1.supportedLocales, 'en');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
return true;
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
exports.shouldPolyfill = shouldPolyfill;
|