Skip to content

Commit 5859496

Browse files
committed
fix: prevent infinite loop while process circular nested type
1 parent ec3fbc8 commit 5859496

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ts-bookshelf",
33
"description": "generate markdown-based documentation from typescript types",
4-
"version": "1.0.0-next.2",
4+
"version": "1.0.0-next.3",
55
"license": "MIT",
66
"source": "src/index.ts",
77
"main": "dist/common.js",

src/generators/class.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export function generateForClass(classType: ClassType, options?: DocumentOptions
4242
if (combineNestedFields) {
4343
const customClasses = fields.filter(f => f.isCustom);
4444
for (const customClass of customClasses) {
45+
if (customClass.type === classType) {
46+
continue;
47+
}
48+
4549
contents.push(
4650
...generateForClass(customClass.type, {
4751
...options,

0 commit comments

Comments
 (0)