Skip to content

Commit

Permalink
fix: prevent infinite loop while process circular nested type
Browse files Browse the repository at this point in the history
  • Loading branch information
async3619 committed Dec 9, 2022
1 parent ec3fbc8 commit 5859496
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ts-bookshelf",
"description": "generate markdown-based documentation from typescript types",
"version": "1.0.0-next.2",
"version": "1.0.0-next.3",
"license": "MIT",
"source": "src/index.ts",
"main": "dist/common.js",
Expand Down
4 changes: 4 additions & 0 deletions src/generators/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export function generateForClass(classType: ClassType, options?: DocumentOptions
if (combineNestedFields) {
const customClasses = fields.filter(f => f.isCustom);
for (const customClass of customClasses) {
if (customClass.type === classType) {
continue;
}

contents.push(
...generateForClass(customClass.type, {
...options,
Expand Down

0 comments on commit 5859496

Please sign in to comment.