From bd6c24d35a21c54d6263af6ec55f3c13ae1fdb47 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Wed, 22 Mar 2023 18:58:23 -0800 Subject: [PATCH] ensure exhaustive checks --- frontend/components/global/DetailsSection/types.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/components/global/DetailsSection/types.ts b/frontend/components/global/DetailsSection/types.ts index a7086d0..74135fb 100644 --- a/frontend/components/global/DetailsSection/types.ts +++ b/frontend/components/global/DetailsSection/types.ts @@ -46,8 +46,13 @@ export function filterZeroValues(details: Details): Details { return !!detail.text; case "link": return !!detail.text && !!detail.href; - default: + case undefined: + case "text": + case "markdown": return detail.text !== null && detail.text !== "" && detail.text !== undefined; + default: + console.warn("Unknown detail type (this should never happen)", detail); + return false; } }); }