Pete Bacon Darwin 19e6b8dad5 build(aio): fix addNotYetDocumentedProperty processor (#22770)
It was running too late and so was being confused by the
description being split into `shortDescription` and `description`
properties.

Closes #22748

PR Close #22770
2018-03-15 11:37:31 -07:00

20 lines
568 B
JavaScript

module.exports = function addNotYetDocumentedProperty(log, createDocMessage) {
return {
docTypes: [],
$runAfter: ['tags-extracted'],
$runBefore: ['processing-docs', 'splitDescription'],
$process(docs) {
docs.forEach(doc => {
if (
this.docTypes.indexOf(doc.docType) !== -1 &&
!doc.noDescription &&
(!doc.description || doc.description.trim().length === 0)
) {
doc.notYetDocumented = true;
log.debug(createDocMessage('Not yet documented', doc));
}
});
}
};
};