@formatjs/intl-displaynames 6.1.2 → 6.1.3

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.
@@ -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,sBAI3C"}
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"}
@@ -37,7 +37,12 @@ export function _shouldPolyfillWithoutLocale() {
37
37
  }
38
38
  export function shouldPolyfill(locale) {
39
39
  if (locale === void 0) { locale = 'en'; }
40
- if (_shouldPolyfillWithoutLocale() || !supportedLocalesOf(locale)) {
41
- return match([locale], supportedLocales, 'en');
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.2",
3
+ "version": "6.1.3",
4
4
  "description": "Polyfill for: https://tc39.es/proposal-intl-displaynames",
5
5
  "keywords": [
6
6
  "i18n",
package/polyfill.iife.js CHANGED
@@ -687,8 +687,12 @@
687
687
  if (locale === void 0) {
688
688
  locale = "en";
689
689
  }
690
- if (_shouldPolyfillWithoutLocale() || !supportedLocalesOf(locale)) {
691
- return match([locale], supportedLocales, "en");
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
 
@@ -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,sBAI3C"}
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"}
@@ -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
- if (_shouldPolyfillWithoutLocale() || !supportedLocalesOf(locale)) {
45
- return (0, intl_localematcher_1.match)([locale], supported_locales_generated_1.supportedLocales, 'en');
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;