Skip to content

Commit c516021

Browse files
committed
Other: Minor tsd-jsdoc refactor
1 parent 20d8a2d commit c516021

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/tsd-jsdoc/publish.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,21 @@ function writeFunctionSignature(element, isConstructor, isTypeDef) {
247247
type: getTypeOf(param),
248248
variable: param.variable === true,
249249
optional: param.optional === true,
250-
defaultValue: param.defaultvalue // TODO
250+
defaultValue: param.defaultvalue // TODO
251251
};
252252
else // Property syntax (TODO)
253253
params[path[0]].type = "{ [k: string]: any }";
254254
});
255255

256256
var paramNames = Object.keys(params);
257257
paramNames.forEach(function(name, i) {
258-
var param = params[name];
258+
var param = params[name];
259259
var type = param.type;
260260
if (param.variable) {
261261
name = "..." + name;
262262
type = param.type.charAt(0) === "(" ? "any[]" : param.type + "[]";
263263
}
264-
write(name, param.optional ? "?: " : ": ", type);
264+
write(name, !param.variable && param.optional ? "?: " : ": ", type);
265265
if (i < paramNames.length - 1)
266266
write(", ");
267267
});

0 commit comments

Comments
 (0)