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

19 lines
439 B
JavaScript
Raw Normal View History

module.exports = function computeSearchTitleProcessor() {
return {
$runAfter: ['ids-computed'],
$runBefore: ['generateKeywordsProcessor'],
$process(docs) {
docs.forEach(doc => {
switch(doc.docType) {
case 'function':
doc.searchTitle = `${doc.name}()`;
break;
case 'package':
doc.searchTitle = `${doc.id} package`;
break;
}
});
}
};
};