fix(docs): ensure no duplicates in alias names of docs

Having multiple identical names in a doc's aliases would cause Ambiguous Link warnings
for each reference to one of the aliases.

Related to #2452
This commit is contained in:
Jeff Cross 2015-06-11 17:48:57 -07:00
parent 796fc66771
commit 05d02fa90b
1 changed files with 7 additions and 1 deletions

View File

@ -146,13 +146,19 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo
}
});
//Make sure duplicate aliases aren't created, so "Ambiguous link" warnings are prevented
var aliasNames = [name];
if (typeParamString) {
aliasNames.push(name + typeParamString);
}
var exportDoc = {
docType: getExportDocType(exportSymbol),
name: name,
id: name,
typeParams: typeParamString,
heritage: heritageString,
aliases: [name, name + typeParamString],
aliases: aliasNames,
moduleDoc: moduleDoc,
content: getContent(exportSymbol),
fileInfo: getFileInfo(exportSymbol, basePath),