build(aio): refactor filterMemberDocs to be more general
Now it also filters function-overloads, hence the name change.
This commit is contained in:

committed by
Pete Bacon Darwin

parent
433d479a1e
commit
57cfcb0830
17
aio/tools/transforms/angular-api-package/processors/filterContainedDocs.js
vendored
Normal file
17
aio/tools/transforms/angular-api-package/processors/filterContainedDocs.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Remove docs that are contained in (owned by) another doc
|
||||
* so that they don't get rendered as files in themselves.
|
||||
*/
|
||||
module.exports = function filterContainedDocs() {
|
||||
return {
|
||||
docTypes: ['member', 'function-overload'],
|
||||
$runAfter: ['extra-docs-added'],
|
||||
$runBefore: ['computing-paths'],
|
||||
$process: function(docs) {
|
||||
var docTypes = this.docTypes;
|
||||
return docs.filter(function(doc) {
|
||||
return docTypes.indexOf(doc.docType) === -1;
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
@ -1,7 +0,0 @@
|
||||
module.exports = function filterMemberDocs() {
|
||||
return {
|
||||
$runAfter: ['extra-docs-added'], $runBefore: ['computing-paths'], $process: function(docs) {
|
||||
return docs.filter(function(doc) { return doc.docType !== 'member'; });
|
||||
}
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user