Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions src/lib/converter/nodes/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,25 @@ export class ExportConverter extends ConverterNodeComponent<ts.ExportAssignment>
}
if (symbol) {
const project = context.project;
symbol.declarations.forEach((declaration) => {
if (!declaration.symbol) {
return;
}
const id = project.symbolMapping[context.getSymbolID(declaration.symbol)];
if (!id) {
return;
}

const reflection = project.reflections[id];
if (node.isExportEquals && reflection instanceof DeclarationReflection) {
(<DeclarationReflection> reflection).setFlag(ReflectionFlag.ExportAssignment, true);
}
markAsExported(reflection);
});
// if the symbol declarations are undefined due to an export, we skip it
// fixes https://github.com/TypeStrong/typedoc/issues/513
if (symbol.declarations) {
symbol.declarations.forEach((declaration) => {
if (!declaration.symbol) {
return;
}
const id = project.symbolMapping[context.getSymbolID(declaration.symbol)];
if (!id) {
return;
}

const reflection = project.reflections[id];
if (node.isExportEquals && reflection instanceof DeclarationReflection) {
(<DeclarationReflection> reflection).setFlag(ReflectionFlag.ExportAssignment, true);
}
markAsExported(reflection);
});
}
}

function markAsExported(reflection: Reflection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h1>Class DefaultExportedClass</h1>
<div class="lead">
<p>This class is exported via es6 export syntax.</p>
</div>
<pre><code><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DefaultExportedClass</span></span>
<pre><code><span class="hljs-builtin-name">export</span><span class="hljs-built_in"> default </span>class DefaultExportedClass
</code></pre>
</div>
</section>
Expand Down