Skip to content

Commit a11f72f

Browse files
committed
Emit '?' for optional parameter property in declaration file
1 parent d66377d commit a11f72f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/declarationEmitter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ namespace ts {
11291129
// what we want, namely the name expression enclosed in brackets.
11301130
writeTextOfNode(currentText, node.name);
11311131
// If optional property emit ?
1132-
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature) && hasQuestionToken(node)) {
1132+
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature || node.kind === SyntaxKind.Parameter) && hasQuestionToken(node)) {
11331133
write("?");
11341134
}
11351135
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature) && node.parent.kind === SyntaxKind.TypeLiteral) {

0 commit comments

Comments
 (0)