diff --git a/lib/tsd-jsdoc/publish.js b/lib/tsd-jsdoc/publish.js index 0a4948d3e..ac2f60923 100644 --- a/lib/tsd-jsdoc/publish.js +++ b/lib/tsd-jsdoc/publish.js @@ -247,7 +247,7 @@ 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 }"; @@ -255,13 +255,13 @@ function writeFunctionSignature(element, isConstructor, isTypeDef) { 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(", "); });