@neovici/cosmoz-utils 5.37.0 → 5.37.1

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.
Files changed (2) hide show
  1. package/dist/money.js +12 -5
  2. package/package.json +1 -1
package/dist/money.js CHANGED
@@ -4,11 +4,18 @@ const CURRENCY_FORMATTERS = {}, NUMBER_FORMATTERS = {}, _getCurrencyFormatter =
4
4
  }
5
5
  const key = currency.toUpperCase() + (locale || '');
6
6
  if (CURRENCY_FORMATTERS[key] == null) {
7
- CURRENCY_FORMATTERS[key] = new Intl.NumberFormat(locale, {
8
- style: 'currency',
9
- currency,
10
- currencyDisplay,
11
- });
7
+ try {
8
+ CURRENCY_FORMATTERS[key] = new Intl.NumberFormat(locale, {
9
+ style: 'currency',
10
+ currency,
11
+ currencyDisplay,
12
+ });
13
+ }
14
+ catch (e) {
15
+ // eslint-disable-next-line no-console
16
+ console.error('Invalid format', e);
17
+ return;
18
+ }
12
19
  }
13
20
  return CURRENCY_FORMATTERS[key];
14
21
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-utils",
3
- "version": "5.37.0",
3
+ "version": "5.37.1",
4
4
  "description": "Date, money and template management functions commonly needed in Cosmoz views.",
5
5
  "keywords": [
6
6
  "polymer",