You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
739 B

/**
* IE11-safe version of getCanonicalLocales since it's ES2016
* @param locales locales
*/
export function getCanonicalLocales(locales) {
// IE11
var getCanonicalLocales = Intl.getCanonicalLocales;
if (typeof getCanonicalLocales === 'function') {
return getCanonicalLocales(locales);
}
// NOTE: we must NOT call `supportedLocalesOf` of a formatjs polyfill, or their implementation
// will even eventually call this method recursively. Here we use `Intl.DateTimeFormat` since it
// is not polyfilled by `@formatjs`.
// TODO: Fix TypeScript type def for this bc undefined is just fine
return Intl.DateTimeFormat.supportedLocalesOf(locales);
}
//# sourceMappingURL=get-canonical-locales.js.map