Skip to content

Commit

Permalink
Don't error if there are no exports (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane authored Jun 9, 2024
1 parent ebe90e7 commit 1495808
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx_js/js/convertTopLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ class PathComputer implements ReflectionVisitor {
project(project: ProjectReflection) {
// Compute the set of documentation roots.
// This consists of all children of the Project and all children of Modules.
for (const child of project.children!) {
for (const child of project.children || []) {
this.documentationRoots.add(child);
}
for (const module of project.getChildrenByKind(ReflectionKind.Module)) {
for (const child of module.children!) {
for (const child of module.children || []) {
this.documentationRoots.add(child);
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/test_build_ts/source/empty.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Test that we don't crash on a file with no exports

0 comments on commit 1495808

Please sign in to comment.