Skip to content

Commit 8d5ffd0

Browse files
committed
Fix an issue where AstFileGenerator generated empty assignments when a value was not emitted in the .d.ts input file
1 parent 163649a commit 8d5ffd0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/api-extractor/src/generators/ApiFileGenerator.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ export class ApiFileGenerator extends AstItemVisitor {
155155
protected visitAstModuleVariable(astModuleVariable: AstModuleVariable): void {
156156
this._writeAedocSynopsis(astModuleVariable);
157157

158-
this._indentedWriter.write(`${astModuleVariable.name}: ${astModuleVariable.type} = ${astModuleVariable.value};`);
158+
if (astModuleVariable.value) {
159+
this._indentedWriter.write(`${astModuleVariable.name}: ${astModuleVariable.type} = ${astModuleVariable.value};`);
160+
} else {
161+
this._indentedWriter.write(`${astModuleVariable.name}: ${astModuleVariable.type};`);
162+
}
159163
}
160164

161165
protected visitAstMember(astMember: AstMember): void {

0 commit comments

Comments
 (0)