refactor(docs-infra): refactors `createOverviewDump` (#37141)

This commit removes the dependency on the `lodash` module and refactors
the `createOverviewDump` method.

PR Close #37141
This commit is contained in:
Sonu Kapoor 2020-05-15 16:59:06 -04:00 committed by Kara Erickson
parent 593e07bd21
commit 22d80a6780
1 changed files with 4 additions and 4 deletions

View File

@ -1,23 +1,23 @@
var _ = require('lodash');
module.exports = function createOverviewDump() {
return {
$runAfter: ['processing-docs'],
$runBefore: ['docs-processed'],
$process: function(docs) {
var overviewDoc = {
const overviewDoc = {
id: 'overview-dump',
aliases: ['overview-dump'],
path: 'overview-dump',
outputPath: 'overview-dump.html',
modules: []
};
_.forEach(docs, function(doc) {
docs.forEach(doc => {
if (doc.docType === 'package') {
overviewDoc.modules.push(doc);
}
});
docs.push(overviewDoc);
}
};