(f)
| 141 | } |
| 142 | |
| 143 | function addSignatureReturns(f) { |
| 144 | var attribs = []; |
| 145 | var attribsString = ''; |
| 146 | var returnTypes = []; |
| 147 | var returnTypesString = ''; |
| 148 | |
| 149 | // jam all the return-type attributes into an array. this could create odd results (for example, |
| 150 | // if there are both nullable and non-nullable return types), but let's assume that most people |
| 151 | // who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa. |
| 152 | if (f.returns) { |
| 153 | f.returns.forEach(function(item) { |
| 154 | helper.getAttribs(item).forEach(function(attrib) { |
| 155 | if (attribs.indexOf(attrib) === -1) { |
| 156 | attribs.push(attrib); |
| 157 | } |
| 158 | }); |
| 159 | }); |
| 160 | |
| 161 | attribsString = buildAttribsString(attribs); |
| 162 | } |
| 163 | |
| 164 | if (f.returns) { |
| 165 | returnTypes = addNonParamAttributes(f.returns); |
| 166 | } |
| 167 | if (returnTypes.length) { |
| 168 | returnTypesString = util.format( ' → %s{%s}', attribsString, returnTypes.join('|') ); |
| 169 | } |
| 170 | |
| 171 | f.signature = '<span class="signature">' + (f.signature || '') + '</span>' + |
| 172 | '<span class="type-signature">' + returnTypesString + '</span>'; |
| 173 | } |
| 174 | |
| 175 | function addSignatureTypes(f) { |
| 176 | var types = f.type ? buildItemTypeStrings(f) : []; |
no test coverage detected
searching dependent graphs…