angular-cn/aio/tools/transforms/angular-api-package/processors/collectPackageContentDocs.js

19 lines
517 B
JavaScript

const { dirname } = require('canonical-path');
module.exports = function collectPackageContentDocsProcessor() {
return {
$runAfter: ['tags-extracted'],
$runBefore: ['computing-ids', 'processPackages'],
packageContentFiles: {},
$process(docs) {
return docs.filter(doc => {
if (doc.docType === 'package-content') {
this.packageContentFiles[dirname(doc.fileInfo.filePath)] = doc;
return false;
} else {
return true;
}
});
}
};
};