@aarhus-university/au-lib-react-components 9.11.18 → 9.11.19
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 +1 -1
- package/src/lib/helpers.js +4 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "@aarhus-university/au-lib-react-components",
|
|
4
|
-
"version": "9.11.
|
|
4
|
+
"version": "9.11.19",
|
|
5
5
|
"description": "Library for shared React components for various applications on au.dk",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
7
7
|
"scripts": {
|
package/src/lib/helpers.js
CHANGED
|
@@ -182,7 +182,10 @@ const splitPhoneNumber = (countryCodes, phoneNumber) => {
|
|
|
182
182
|
const prettyPrintPhone = (countryCodes, phone) => {
|
|
183
183
|
if (phone) {
|
|
184
184
|
const { prefix, number } = splitPhoneNumber(countryCodes, phone);
|
|
185
|
-
|
|
185
|
+
if (prefix) {
|
|
186
|
+
return `${prefix} ${number.match(/\d{1,2}/g).join(' ')}`;
|
|
187
|
+
}
|
|
188
|
+
return number.match(/\d{1,2}/g).join(' ');
|
|
186
189
|
}
|
|
187
190
|
return '';
|
|
188
191
|
};
|