From 46bf6b70b3fc7f464e6d5a661281103ff8eb29a3 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Sat, 21 Jan 2023 10:25:19 +0100 Subject: [PATCH] Regognize null as a distinct type --- frontend/src/components/objectgrid.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/objectgrid.svelte b/frontend/src/components/objectgrid.svelte index 558acad..e018a66 100644 --- a/frontend/src/components/objectgrid.svelte +++ b/frontend/src/components/objectgrid.svelte @@ -45,7 +45,10 @@ // else if (new Date(value).toString() !== 'Invalid Date') { // return 'date'; // } - else if ((typeof value === 'object') && (value !== null)) { + else if (value === null) { + return 'null'; + } + else if (typeof value === 'object') { const keys = Object.keys(value); return `object (${keys.length} item${keys.length === 1 ? '' : 's'})`; }