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