Skip to content

Commit 05d02fa

Browse files
committed
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 angular#2452
1 parent 796fc66 commit 05d02fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/dgeni-package/processors/readTypeScriptModules.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,19 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo
146146
}
147147
});
148148

149+
//Make sure duplicate aliases aren't created, so "Ambiguous link" warnings are prevented
150+
var aliasNames = [name];
151+
if (typeParamString) {
152+
aliasNames.push(name + typeParamString);
153+
}
154+
149155
var exportDoc = {
150156
docType: getExportDocType(exportSymbol),
151157
name: name,
152158
id: name,
153159
typeParams: typeParamString,
154160
heritage: heritageString,
155-
aliases: [name, name + typeParamString],
161+
aliases: aliasNames,
156162
moduleDoc: moduleDoc,
157163
content: getContent(exportSymbol),
158164
fileInfo: getFileInfo(exportSymbol, basePath),

0 commit comments

Comments
 (0)