Skip to content

Commit d21c3ba

Browse files
committed
fix: Fix descrition complex examples render
1 parent 9694680 commit d21c3ba

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/includer/traverse/description.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,15 @@ function concatConstraint(
112112
}
113113

114114
function prepareConstraintValue(value: unknown, notWrapValueIntoCode: boolean) {
115-
return notWrapValueIntoCode ? value : `\`${value}\``;
115+
if (notWrapValueIntoCode) {
116+
return value;
117+
}
118+
119+
if (typeof value === 'string') {
120+
return '`' + value + '`';
121+
}
122+
123+
return '\n' + ['```', JSON.stringify(value, null, 2), '```'].join('\n');
116124
}
117125

118126
export {fields, prepareComplexDescription};

0 commit comments

Comments
 (0)