fix(JSON DIff): wrap and indent diffs

Fix #434, #413
This commit is contained in:
ShareVB committed 2025-12-07 21:41:17 +01:00
1 parent cb0725dc7c
commit 8fad71868a
1 file changed
+2 -2
@@ -104,7 +104,7 @@ function formatValue(value: unknown) {
return 'null';
}
return JSON.stringify(value);
return JSON.stringify(value, null, 8);
}
function Value({ value, status }: { value: unknown; status: string }) {
@@ -113,7 +113,7 @@ function Value({ value, status }: { value: unknown; status: string }) {
const { copy } = useCopy({ source: formatedValue });
return (
<span class={['value', status]} onClick={() => copy()}>
<span class={['value', status]} style="word-break: break-word; white-space: pre-wrap" onClick={() => copy()}>
{formatedValue}
</span>
);