* Look for classes or functions with the same name as modules (which indicates that the module * exports only that class or function), then attach the classes or functions to the `module` * property of the appropriate module doclets. The name of each class or function is also updated * for displa
(doclets, modules)
| 272 | * @param {Array.<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search. |
| 273 | */ |
| 274 | function attachModuleSymbols(doclets, modules) { |
| 275 | const symbols = {}; |
| 276 | |
| 277 | // build a lookup table |
| 278 | doclets.forEach(symbol => { |
| 279 | symbols[symbol.longname] = symbols[symbol.longname] || []; |
| 280 | symbols[symbol.longname].push(symbol); |
| 281 | }); |
| 282 | |
| 283 | modules.forEach(module => { |
| 284 | if (symbols[module.longname]) { |
| 285 | module.modules = symbols[module.longname] |
| 286 | // Only show symbols that have a description. Make an exception for classes, because |
| 287 | // we want to show the constructor-signature heading no matter what. |
| 288 | .filter(({description, kind}) => description || kind === 'class') |
| 289 | .map(symbol => { |
| 290 | symbol = doop(symbol); |
| 291 | |
| 292 | if (symbol.kind === 'class' || symbol.kind === 'function') { |
| 293 | symbol.name = `${symbol.name.replace('module:', '(require("')}"))`; |
| 294 | } |
| 295 | |
| 296 | return symbol; |
| 297 | }); |
| 298 | } |
| 299 | }); |
| 300 | } |
| 301 | |
| 302 | function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) { |
| 303 | let nav = ''; |
no test coverage detected
searching dependent graphs…