Skip to content

Commit

Permalink
Other: Minor tsd-jsdoc refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 30, 2016
1 parent 20d8a2d commit c516021
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tsd-jsdoc/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,21 @@ function writeFunctionSignature(element, isConstructor, isTypeDef) {
type: getTypeOf(param),
variable: param.variable === true,
optional: param.optional === true,
defaultValue: param.defaultvalue // TODO
defaultValue: param.defaultvalue // TODO
};
else // Property syntax (TODO)
params[path[0]].type = "{ [k: string]: any }";
});

var paramNames = Object.keys(params);
paramNames.forEach(function(name, i) {
var param = params[name];
var param = params[name];
var type = param.type;
if (param.variable) {
name = "..." + name;
type = param.type.charAt(0) === "(" ? "any[]" : param.type + "[]";
}
write(name, param.optional ? "?: " : ": ", type);
write(name, !param.variable && param.optional ? "?: " : ": ", type);
if (i < paramNames.length - 1)
write(", ");
});
Expand Down

0 comments on commit c516021

Please sign in to comment.