From 7a9a5910ade0985ccf7c6e494560752348d15519 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 25 Jan 2026 19:06:01 +0100 Subject: [PATCH] Refactoring --- libs/common/src/lib/helper.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts index 9ee7d6220..4db1fcf2d 100644 --- a/libs/common/src/lib/helper.ts +++ b/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; }