From dc92faa8a452e74ee47ea227bd1dd430c9bd42f6 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Thu, 7 Mar 2024 16:47:24 +0100 Subject: [PATCH] Improve display of `UInt8Array` values in Raw vis --- packages/lib/src/vis/raw/RawVis.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/lib/src/vis/raw/RawVis.tsx b/packages/lib/src/vis/raw/RawVis.tsx index 0eed23456..a00757fec 100644 --- a/packages/lib/src/vis/raw/RawVis.tsx +++ b/packages/lib/src/vis/raw/RawVis.tsx @@ -8,7 +8,11 @@ interface Props { function RawVis(props: Props) { const { value } = props; - const valueAsStr = JSON.stringify(value, null, 2); + + const valueAsStr = + value instanceof Uint8Array + ? `Uint8Array [ ${value.toString()} ]` + : JSON.stringify(value, null, 2); return (