From 88a7a36c4b80789a5bcd7c5aa2a0373534f6d343 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 13 Apr 2026 11:14:34 +0200 Subject: [PATCH] . --- modules/core/src/common/helpers/index.ts | 5 +++-- modules/core/src/common/helpers/number-helper.ts | 3 +++ .../{percentage-dto-helpers.ts => percentage-dto-helper.ts} | 0 .../{quantity-dto-helpers.ts => quantity-dto-helper.ts} | 0 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 modules/core/src/common/helpers/number-helper.ts rename modules/core/src/common/helpers/{percentage-dto-helpers.ts => percentage-dto-helper.ts} (100%) rename modules/core/src/common/helpers/{quantity-dto-helpers.ts => quantity-dto-helper.ts} (100%) diff --git a/modules/core/src/common/helpers/index.ts b/modules/core/src/common/helpers/index.ts index 5450b54c..c5f50933 100644 --- a/modules/core/src/common/helpers/index.ts +++ b/modules/core/src/common/helpers/index.ts @@ -2,5 +2,6 @@ export * from "./date-helper"; export * from "./dto-compare-helper"; export * from "./money-dto-helper"; export * from "./money-helper"; -export * from "./percentage-dto-helpers"; -export * from "./quantity-dto-helpers"; +export * from "./number-helper"; +export * from "./percentage-dto-helper"; +export * from "./quantity-dto-helper"; diff --git a/modules/core/src/common/helpers/number-helper.ts b/modules/core/src/common/helpers/number-helper.ts new file mode 100644 index 00000000..71ef4834 --- /dev/null +++ b/modules/core/src/common/helpers/number-helper.ts @@ -0,0 +1,3 @@ +export const toSafeNumber = (value: number | null | undefined): number => { + return value ?? 0; +}; diff --git a/modules/core/src/common/helpers/percentage-dto-helpers.ts b/modules/core/src/common/helpers/percentage-dto-helper.ts similarity index 100% rename from modules/core/src/common/helpers/percentage-dto-helpers.ts rename to modules/core/src/common/helpers/percentage-dto-helper.ts diff --git a/modules/core/src/common/helpers/quantity-dto-helpers.ts b/modules/core/src/common/helpers/quantity-dto-helper.ts similarity index 100% rename from modules/core/src/common/helpers/quantity-dto-helpers.ts rename to modules/core/src/common/helpers/quantity-dto-helper.ts