From 80f66bde0a617f42c4af41bbb613c5802a6b5fe7 Mon Sep 17 00:00:00 2001 From: Sylvain Gougouzian Date: Thu, 18 Apr 2024 10:37:04 +0200 Subject: [PATCH] fix: :bug: bugfix if no rating --- package.json | 2 +- src/DTO.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 211aaa1..6b895d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "choc", - "version": "0.1.1", + "version": "0.1.2", "module": "src/index.ts", "type": "module", "devDependencies": { diff --git a/src/DTO.ts b/src/DTO.ts index f0d6c10..61cfb45 100644 --- a/src/DTO.ts +++ b/src/DTO.ts @@ -51,7 +51,7 @@ export const DTO = ( speakers: speakerHash.get(uid)?.name, ...addCompanies, ...addLanguages, - rating: Number(rating.toFixed(2)), + rating: Number((rating ?? "0").toFixed(2)), loves, hates, }); @@ -115,7 +115,7 @@ export const DTOExport = ( .join(", "), ...addCompanies, ...addLanguages, - rating: Number(rating.toFixed(2)), + rating: Number((rating ?? "0").toFixed(2)), loves, hates, };