Files
angular/aio/tools/transforms/angular-api-package/processors/removeInjectableAndInternalConstructors.js
T
Matthieu Riegler d0f6d31228 docs(docs-infra): Remove internal constructors from the doc. (#50282)
Internal constructor should not be exposed in the doc. This removes them.

Related to #50281

PR Close #50282
2023-05-15 09:24:58 -07:00

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;
}
});
}
};
};