@neovici/cosmoz-utils 5.37.0 → 5.38.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useAbortSignal: () => AbortSignal;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useEffect, useMemo } from 'haunted';
|
|
2
|
+
export const useAbortSignal = () => {
|
|
3
|
+
const { controller, signal } = useMemo(() => {
|
|
4
|
+
const controller = new AbortController(), signal = controller.signal;
|
|
5
|
+
return { controller, signal };
|
|
6
|
+
}, []);
|
|
7
|
+
useEffect(() => () => controller.abort(), []);
|
|
8
|
+
return signal;
|
|
9
|
+
};
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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.
|
|
3
|
+
"version": "5.38.0",
|
|
4
4
|
"description": "Date, money and template management functions commonly needed in Cosmoz views.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polymer",
|
|
@@ -74,15 +74,15 @@
|
|
|
74
74
|
"haunted": "^5.0.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@commitlint/cli": "^
|
|
78
|
-
"@commitlint/config-conventional": "^
|
|
77
|
+
"@commitlint/cli": "^18.0.0",
|
|
78
|
+
"@commitlint/config-conventional": "^18.0.0",
|
|
79
79
|
"@neovici/cfg": "^1.15.1",
|
|
80
80
|
"@open-wc/testing": "^3.1.0",
|
|
81
81
|
"@polymer/polymer": "^3.3.1",
|
|
82
82
|
"@semantic-release/changelog": "^6.0.0",
|
|
83
83
|
"@semantic-release/git": "^10.0.0",
|
|
84
84
|
"husky": "^8.0.0",
|
|
85
|
-
"lit-html": "^2.0.0",
|
|
85
|
+
"lit-html": "^2.0.0 || ^3.0.0",
|
|
86
86
|
"semantic-release": "^21.0.0",
|
|
87
87
|
"sinon": "^15.0.0"
|
|
88
88
|
}
|