From 896a1564ef40136ad63c809cd065c685acc2d912 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 14 Apr 2015 13:20:49 +0100 Subject: [PATCH] chore(doc-gen): only clone docs that are actually being re-exported to a new module Closes #1353 --- .../processors/cloneExportedFromDocs.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/dgeni-package/processors/cloneExportedFromDocs.js b/docs/dgeni-package/processors/cloneExportedFromDocs.js index e647d7caa8..a32e52db77 100644 --- a/docs/dgeni-package/processors/cloneExportedFromDocs.js +++ b/docs/dgeni-package/processors/cloneExportedFromDocs.js @@ -20,11 +20,13 @@ module.exports = function cloneExportedFromDocs(modules, EXPORT_DOC_TYPES) { 'Referenced in "@exportedAs" tag on class: "' + doc.moduleDoc.id + '/' + doc.name + '"'); } else { - // Add a clone of export to its "exportedAs" module - var clonedDoc = _.clone(doc); - clonedDoc.moduleDoc = exportedAsModule; - exportedAsModule.exports.push(clonedDoc); - extraPublicDocs.push(clonedDoc); + 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); + } } }); });