We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48b8d58 commit 0252b28Copy full SHA for 0252b28
1 file changed
packages/jsondiffpatch/src/formatters/html.ts
@@ -30,7 +30,10 @@ class HtmlFormatter extends BaseFormatter<HtmlFormatterContext> {
30
}
31
32
formatValue(context: HtmlFormatterContext, value: unknown) {
33
- context.out(`<pre>${htmlEscape(JSON.stringify(value, null, 2))}</pre>`);
+ const valueAsHtml = typeof value === "undefined"
34
+ ? "undefined"
35
+ : htmlEscape(JSON.stringify(value, null, 2));
36
+ context.out(`<pre>${valueAsHtml}</pre>`);
37
38
39
formatTextDiffString(context: HtmlFormatterContext, value: string) {
0 commit comments