@formatjs/intl-durationformat 0.10.14 → 0.10.15

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-durationformat",
3
- "version": "0.10.14",
3
+ "version": "0.10.15",
4
4
  "description": "Intl.DurationFormat polyfill",
5
5
  "keywords": [
6
6
  "duration",
package/polyfill-force.js CHANGED
@@ -325,7 +325,7 @@ function PartitionDurationFormatPattern(df, duration) {
325
325
  const dataLocaleData = DurationFormat.localeData[dataLocale];
326
326
  if (!dataLocaleData) throw new TypeError("Invalid locale");
327
327
  const numberingSystem = internalSlots.numberingSystem;
328
- const separator = dataLocaleData.digitalFormat[numberingSystem];
328
+ const separator = dataLocaleData.digitalFormat[numberingSystem] ?? dataLocaleData.digitalFormat.default;
329
329
  for (let i = 0; i < TABLE_2.length && !done; i++) {
330
330
  const row = TABLE_2[i];
331
331
  let value = new BigDecimal(duration[row.valueField]);
@@ -1710,13 +1710,14 @@ var DurationFormat = class DurationFormat {
1710
1710
  static {
1711
1711
  this.localeData = Object.keys(TIME_SEPARATORS.localeData).reduce((all, locale) => {
1712
1712
  DurationFormat.availableLocales.add(locale);
1713
- const nu = TIME_SEPARATORS.localeData[locale].nu;
1713
+ const nu = [...TIME_SEPARATORS.localeData[locale].nu];
1714
+ if (!nu.includes("latn")) nu.push("latn");
1714
1715
  all[locale] = {
1715
1716
  nu,
1716
- digitalFormat: TIME_SEPARATORS.localeData[locale].separator || nu.reduce((separators, n) => {
1717
- separators[n] = TIME_SEPARATORS.default;
1718
- return separators;
1719
- }, {})
1717
+ digitalFormat: {
1718
+ default: TIME_SEPARATORS.default,
1719
+ ...TIME_SEPARATORS.localeData[locale].separator
1720
+ }
1720
1721
  };
1721
1722
  return all;
1722
1723
  }, {});