(f)
| 158 | } |
| 159 | |
| 160 | function addSignatureReturns(f) { |
| 161 | var attribs = [] |
| 162 | var attribsString = '' |
| 163 | var returnTypes = [] |
| 164 | var returnTypesString = '' |
| 165 | var source = f.yields || f.returns |
| 166 | |
| 167 | // jam all the return-type attributes into an array. this could create odd results (for example, |
| 168 | // if there are both nullable and non-nullable return types), but let's assume that most people |
| 169 | // who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa. |
| 170 | if (source) { |
| 171 | source.forEach(function(item) { |
| 172 | helper.getAttribs(item).forEach(function(attrib) { |
| 173 | if (attribs.indexOf(attrib) === -1) { |
| 174 | attribs.push(attrib) |
| 175 | } |
| 176 | }) |
| 177 | }) |
| 178 | |
| 179 | attribsString = buildAttribsString(attribs) |
| 180 | } |
| 181 | |
| 182 | if (source) { |
| 183 | returnTypes = addNonParamAttributes(source) |
| 184 | } |
| 185 | if (returnTypes.length) { |
| 186 | returnTypesString = util.format( ' → %s{%s}', attribsString, returnTypes.join('|') ) |
| 187 | } |
| 188 | |
| 189 | f.signature = '<span class="signature">' + (f.signature || '') + '</span>' + |
| 190 | '<span class="type-signature">' + returnTypesString + '</span>' |
| 191 | } |
| 192 | |
| 193 | function addSignatureTypes(f) { |
| 194 | var types = f.type ? buildItemTypeStrings(f) : [] |
no test coverage detected
searching dependent graphs…