Skip to content
Merged
Changes from 4 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
4 changes: 3 additions & 1 deletion src/lib/converter/nodes/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export class ModuleConverter extends ConverterNodeComponent<ts.ModuleDeclaration
convert(context: Context, node: ts.ModuleDeclaration): Reflection | undefined {
const reflection = context.isInherit && context.inheritParent === node
? <DeclarationReflection> context.scope
: createDeclaration(context, node, ReflectionKind.Namespace);
: createDeclaration(context, node, node.name.kind === 10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the kind is fine (that's all the function does) but the inline constant could break across different TS versions. We should instead use the enum.

Suggested change
: createDeclaration(context, node, node.name.kind === 10
: createDeclaration(context, node, node.name.kind === ts.SyntaxKind.StringLiteral

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have time later today or tomorrow to pull this down and fix if you don't have time.

? ReflectionKind.Module
: ReflectionKind.Namespace);
context.withScope(reflection, () => {
if (node.body) {
this.owner.convertNode(context, node.body);
Expand Down