From c5160217ea95996375460c5403dfe37b913d392e Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Fri, 30 Dec 2016 23:34:40 +0100 Subject: [PATCH] Other: Minor tsd-jsdoc refactor --- lib/tsd-jsdoc/publish.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(", "); });