diff --git a/tools/dgeni/processors/docs-private-filter.js b/tools/dgeni/processors/docs-private-filter.js index 38dcae5e5fed..de6458f2afbd 100644 --- a/tools/dgeni/processors/docs-private-filter.js +++ b/tools/dgeni/processors/docs-private-filter.js @@ -29,24 +29,24 @@ const INTERNAL_METHODS = [ module.exports = function docsPrivateFilter() { return { $runBefore: ['categorizer'], - $process: docs => docs.filter(doc => validateDocEntry(doc)) + $process: docs => docs.filter(doc => isPublicDoc(doc)) }; }; -function validateDocEntry(doc) { +function isPublicDoc(doc) { if (hasDocsPrivateTag(doc)) { return false; } else if (doc.docType === 'member') { - return validateMemberDoc(doc); + return !isInternalMember(doc); } else if (doc.docType === 'class') { - doc.members = doc.members.filter(memberDoc => validateMemberDoc(memberDoc)); + doc.members = doc.members.filter(memberDoc => isPublicDoc(memberDoc)); } return true; } -function validateMemberDoc(memberDoc) { - return !INTERNAL_METHODS.includes(memberDoc.name) +function isInternalMember(memberDoc) { + return INTERNAL_METHODS.includes(memberDoc.name) } function hasDocsPrivateTag(doc) { diff --git a/tools/dgeni/processors/link-inherited-docs.js b/tools/dgeni/processors/link-inherited-docs.js index daed5774a19f..cd90dd055726 100644 --- a/tools/dgeni/processors/link-inherited-docs.js +++ b/tools/dgeni/processors/link-inherited-docs.js @@ -1,3 +1,8 @@ +/** + * Processor that iterates through all class docs and determines if a class inherits + * another class. Inherited class-docs will be linked to the original class-doc. + */ + const ts = require('typescript'); module.exports = function linkInheritedDocs(readTypeScriptModules, tsParser) { @@ -19,10 +24,12 @@ module.exports = function linkInheritedDocs(readTypeScriptModules, tsParser) { checker = tsParser.parse(sourceFiles, basePath).typeChecker; // Iterate through all class docs and resolve the inherited docs. - docs.filter(doc => doc.docType === 'class').forEach(classDoc => visitClassDoc(classDoc, docs)); + docs.filter(doc => doc.docType === 'class').forEach(classDoc => { + resolveInheritedDoc(classDoc, docs); + }); } - function visitClassDoc(classDoc, docs) { + function resolveInheritedDoc(classDoc, docs) { let inheritedType = resolveInheritedType(classDoc.exportSymbol); let inheritedSymbol = inheritedType && inheritedType.symbol;