Permalink
Browse files

Other: Minor tsd-jsdoc refactor

  • Loading branch information...
dcodeIO committed Dec 30, 2016
1 parent 20d8a2d commit c5160217ea95996375460c5403dfe37b913d392e
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/tsd-jsdoc/publish.js
@@ -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(", ");
});

0 comments on commit c516021

Please sign in to comment.