Support nullable params and returns in generated externs

This commit is contained in:
Andreas Hocevar
2014-08-27 18:18:49 +02:00
parent 4e8abb62f9
commit 663fef3dfd
2 changed files with 13 additions and 3 deletions
+9 -1
View File
@@ -103,11 +103,19 @@ exports.publish = function(data, opts) {
if (typeof param.optional == 'boolean') {
paramInfo.optional = param.optional;
}
if (typeof param.nullable == 'boolean') {
paramInfo.nullable = param.nullable;
}
});
symbol.params = params;
}
if (doc.returns) {
symbol.returns = getTypes(doc.returns[0].type.names);
symbol.returns = {
types: getTypes(doc.returns[0].type.names)
};
if (typeof doc.returns[0].nullable == 'boolean') {
symbol.returns.nullable = doc.returns[0].nullable;
}
}
if (doc.tags) {
doc.tags.every(function(tag) {