mirror of
https://github.com/angular/angular.git
synced 2026-11-23 15:07:51 -05:00
Internal constructor should not be exposed in the doc. This removes them. Related to #50281 PR Close #50282
22 lines
719 B
JavaScript
22 lines
719 B
JavaScript
module.exports = function removeInjectableAndInternalConstructors() {
|
|
return {
|
|
$runAfter: ['processing-docs', 'splitDescription'],
|
|
$runBefore: ['docs-processed'],
|
|
injectableDecorators: ['Injectable', 'Directive', 'Component', 'Pipe', 'NgModule'],
|
|
$process(docs) {
|
|
docs.forEach(doc => {
|
|
if (
|
|
doc.constructorDoc &&
|
|
!doc.constructorDoc.shortDescription &&
|
|
doc.decorators &&
|
|
doc.decorators.some(decorator => this.injectableDecorators.indexOf(decorator.name) !== -1)) {
|
|
delete doc.constructorDoc;
|
|
}
|
|
if(doc.constructorDoc && doc.constructorDoc.internal) {
|
|
delete doc.constructorDoc;
|
|
}
|
|
});
|
|
}
|
|
};
|
|
};
|