Skip to content

Commit 522f9c7

Browse files
committed
Fix a regression where namespaces weren't handled correctly, introduced with TypeScript 3
1 parent f3239c8 commit 522f9c7

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

apps/api-extractor/src/ast/AstNamespace.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class AstNamespace extends AstModule {
7979

8080
const declaration: ts.Declaration = declarations[0];
8181

82-
if (declaration.parent && declaration.parent.flags !== ts.NodeFlags.Const) {
82+
if (declaration.parent && (declaration.parent.flags & ts.NodeFlags.Const) === 0) {
8383
this.reportWarning(`Export "${exportSymbol.name}" is missing the "const" ` +
8484
'modifier. Currently the "namespace" block only supports constant variables.');
8585
continue;
@@ -92,11 +92,6 @@ export class AstNamespace extends AstModule {
9292
continue;
9393
}
9494

95-
if (!propertySignature.initializer) {
96-
this.reportWarning(`Export "${exportSymbol.name}" must have an initialized value`);
97-
continue;
98-
}
99-
10095
// Typescript's VariableDeclaration AST nodes have an VariableDeclarationList parent,
10196
// and the VariableDeclarationList exists within a VariableStatement, which is where
10297
// the JSDoc comment Node can be found.

0 commit comments

Comments
 (0)