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