Browse Source

Task/refactor common helper (#6251)

* Refactoring
pull/6254/head^2
Thomas Kaul 2 days ago
committed by GitHub
parent
commit
5de2b02a04
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 14
      libs/common/src/lib/helper.ts

14
libs/common/src/lib/helper.ts

@ -223,8 +223,8 @@ export function getDateFormatString(aLocale?: string) {
);
return formatObject
.map((object) => {
switch (object.type) {
.map(({ type, value }) => {
switch (type) {
case 'day':
return 'dd';
case 'month':
@ -232,7 +232,7 @@ export function getDateFormatString(aLocale?: string) {
case 'year':
return 'yyyy';
default:
return object.value;
return value;
}
})
.join('');
@ -271,8 +271,8 @@ export function getLowercase(object: object, path: string) {
export function getNumberFormatDecimal(aLocale?: string) {
const formatObject = new Intl.NumberFormat(aLocale).formatToParts(9999.99);
return formatObject.find((object) => {
return object.type === 'decimal';
return formatObject.find(({ type }) => {
return type === 'decimal';
})?.value;
}
@ -281,8 +281,8 @@ export function getNumberFormatGroup(aLocale = getLocale()) {
useGrouping: true
}).formatToParts(9999.99);
return formatObject.find((object) => {
return object.type === 'group';
return formatObject.find(({ type }) => {
return type === 'group';
})?.value;
}

Loading…
Cancel
Save