Skip to content

Commit 407a434

Browse files
committed
fix: fix for option parameter
1 parent 05edabe commit 407a434

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

lib/jsdoc/doclet.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,36 @@ Doclet.prototype.postTypedef = function() {
400400
this.type = {names: ['TSInterface']};
401401
}
402402
this.properties = this.properties || [];
403-
interfaceInfo.body.forEach(function(child, i) {
403+
var childs = interfaceInfo.body;
404+
var length = childs.length;
405+
406+
for (var i = 0, j = 0; j < length; ++i) {
404407
var prevProperty = self.properties[i] || {};
408+
var child;
409+
410+
if ((prevProperty.name || '').indexOf('.') > 0) {
411+
child = {
412+
key: {
413+
string: ''
414+
},
415+
optional: false,
416+
type: '',
417+
typeAnnotation: {
418+
string: ''
419+
}
420+
};
421+
} else {
422+
child = childs[j];
423+
++j;
424+
}
405425

406426
self.properties[i] = ({
407427
name: prevProperty.name || child.key.string,
408428
optional: prevProperty.optional || child.optional,
409429
type: prevProperty.type || {names: [TypeScriptParser.getTypeId(child.type || child.typeAnnotation.string, self.filename)]},
410430
description: prevProperty.description || ''
411431
});
412-
});
432+
}
413433

414434
return;
415435
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daybrush/jsdoc",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "An API documentation generator for JavaScript and Typescript.",
55
"keywords": [
66
"documentation",

0 commit comments

Comments
 (0)