Skip to content

Commit ad1ae16

Browse files
committed
fix: formatting a object in object
1 parent fb23b8b commit ad1ae16

File tree

3 files changed

+4411
-2
lines changed

3 files changed

+4411
-2
lines changed

src/utils/json-to-markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function serializeJson(json: JSON, pad: number): string {
119119
return Object.entries(json as Record<string, JSON>)
120120
.filter(([key, value]) => !isEmpty(value))
121121
.map(([key, value], index) => {
122-
const indentLevel = pad === 0 ? 0 : 1;
122+
const indentLevel = pad;
123123
const prefix = `${getIndent(indentLevel, true)}${key}:`;
124124
if (isOneLiner(value)) {
125125
return `${prefix} ${serializeJson(value, -1)}`;

0 commit comments

Comments
 (0)