Skip to content

Commit 6c7da59

Browse files
committed
Improve d.ts comments generation
Remove empty @returns.
1 parent af1345c commit 6c7da59

3 files changed

Lines changed: 346 additions & 402 deletions

File tree

tasks/buildtsdoc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var TypeScriptDocGenerator = (function () {
5959
var startLinePosition = this.lineMap.getLineStartPosition(lc.line());
6060
var comment = "\r\n" + this.repeatSpaces(nbSpaces) + "/**\r\n";
6161
for (var j = 0; j < commentLines.length; j++) {
62-
comment += this.repeatSpaces(nbSpaces) + "* " + commentLines[j].trim() + "\r\n";
62+
comment += this.repeatSpaces(nbSpaces) + "* " + commentLines[j] + "\r\n";
6363
}
6464
comment += this.repeatSpaces(nbSpaces) + "*/\r\n";
6565
this.tsDefFileContent = this.tsDefFileContent.substr(0, startLinePosition + this.nbCharsAdded) + comment + this.tsDefFileContent.substr(startLinePosition + this.nbCharsAdded);
@@ -175,7 +175,7 @@ var TypeScriptDocGenerator = (function () {
175175
}
176176

177177
}
178-
if (f.returns != null) {
178+
if ((f.returns != null) && (f.returns.description.trim().length > 0)) {
179179
var returnComments = this.cleanEndLine(f.returns.description).split("\n");
180180
for (var l = 0; l < returnComments.length; l++) {
181181
if (l === 0) {

0 commit comments

Comments
 (0)