2017-05-03 16:44:30 -04:00
|
|
|
module.exports = function computeSearchTitleProcessor() {
|
|
|
|
return {
|
|
|
|
$runAfter: ['ids-computed'],
|
|
|
|
$runBefore: ['generateKeywordsProcessor'],
|
|
|
|
$process(docs) {
|
2017-05-03 17:45:36 -04:00
|
|
|
docs.forEach(doc => {
|
|
|
|
switch(doc.docType) {
|
|
|
|
case 'function':
|
|
|
|
doc.searchTitle = `${doc.name}()`;
|
|
|
|
break;
|
2018-06-22 11:58:29 -04:00
|
|
|
case 'package':
|
2017-05-03 17:45:36 -04:00
|
|
|
doc.searchTitle = `${doc.id} package`;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
2017-05-03 16:44:30 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|