chore(doc-gen): only clone docs that are actually being re-exported to a new module

Closes #1353
This commit is contained in:
Peter Bacon Darwin 2015-04-14 13:20:49 +01:00
parent 8b97cf1479
commit 896a1564ef
1 changed files with 7 additions and 5 deletions

View File

@ -20,12 +20,14 @@ module.exports = function cloneExportedFromDocs(modules, EXPORT_DOC_TYPES) {
'Referenced in "@exportedAs" tag on class: "' + doc.moduleDoc.id + '/' + doc.name + '"');
} else {
if(exportedAsModule !== doc.moduleDoc) {
// Add a clone of export to its "exportedAs" module
var clonedDoc = _.clone(doc);
clonedDoc.moduleDoc = exportedAsModule;
exportedAsModule.exports.push(clonedDoc);
extraPublicDocs.push(clonedDoc);
}
}
});
});