@formatjs/intl-listformat 8.1.1 → 8.2.0

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/polyfill.js CHANGED
@@ -1,10 +1,10 @@
1
- import ListFormat from './index.js';
2
- import { shouldPolyfill } from './should-polyfill.js';
1
+ import ListFormat from "./index.js";
2
+ import { shouldPolyfill } from "./should-polyfill.js";
3
3
  if (shouldPolyfill()) {
4
- Object.defineProperty(Intl, 'ListFormat', {
5
- value: ListFormat,
6
- writable: true,
7
- enumerable: false,
8
- configurable: true,
9
- });
4
+ Object.defineProperty(Intl, "ListFormat", {
5
+ value: ListFormat,
6
+ writable: true,
7
+ enumerable: false,
8
+ configurable: true
9
+ });
10
10
  }
@@ -1,16 +1,14 @@
1
- import { match } from '@formatjs/intl-localematcher';
2
- import { supportedLocales } from './supported-locales.generated.js';
1
+ import { match } from "@formatjs/intl-localematcher";
2
+ import { supportedLocales } from "./supported-locales.generated.js";
3
3
  function supportedLocalesOf(locale) {
4
- if (!locale) {
5
- return true;
6
- }
7
- var locales = Array.isArray(locale) ? locale : [locale];
8
- return (Intl.ListFormat.supportedLocalesOf(locales).length ===
9
- locales.length);
4
+ if (!locale) {
5
+ return true;
6
+ }
7
+ const locales = Array.isArray(locale) ? locale : [locale];
8
+ return Intl.ListFormat.supportedLocalesOf(locales).length === locales.length;
10
9
  }
11
- export function shouldPolyfill(locale) {
12
- if (locale === void 0) { locale = 'en'; }
13
- if (!('ListFormat' in Intl) || !supportedLocalesOf(locale)) {
14
- return locale ? match([locale], supportedLocales, 'en') : undefined;
15
- }
10
+ export function shouldPolyfill(locale = "en") {
11
+ if (!("ListFormat" in Intl) || !supportedLocalesOf(locale)) {
12
+ return locale ? match([locale], supportedLocales, "en") : undefined;
13
+ }
16
14
  }