@@ -18,14 +18,14 @@ const allVersions = Object.keys(require('./all-versions'))
18
18
module . exports = async function buildSiteTree ( pages , site , redirects ) {
19
19
const siteTree = { }
20
20
21
- languageCodes . map ( languageCode => {
21
+ languageCodes . forEach ( languageCode => {
22
22
siteTree [ languageCode ] = { }
23
23
24
- allVersions . map ( version => {
24
+ allVersions . forEach ( version => {
25
25
siteTree [ languageCode ] [ version ] = { }
26
26
const productTree = { }
27
27
28
- products . map ( item => {
28
+ products . forEach ( item => {
29
29
const product = { title : item . name }
30
30
31
31
// return early if the product has external docs, like Atom
@@ -60,7 +60,7 @@ function buildCategoriesTree (tocItems, productHref, pages, redirects, version,
60
60
const categoryTree = { }
61
61
62
62
// for every category in a product TOC...
63
- tocItems . map ( item => {
63
+ tocItems . forEach ( item => {
64
64
const category = { }
65
65
66
66
const categoryHref = path . join ( productHref , item . href )
@@ -110,7 +110,7 @@ function buildMaptopicsTree (tocItems, categoryHref, pages, redirects, version,
110
110
// for every maptopic in a category TOC...
111
111
tocItems
112
112
. filter ( item => item . type === 'maptopic' )
113
- . map ( item => {
113
+ . forEach ( item => {
114
114
const maptopic = { }
115
115
116
116
const maptopicHref = path . join ( categoryHref , item . href )
@@ -155,7 +155,7 @@ function buildArticlesTree (tocItems, categoryHref, pages, redirects, version, l
155
155
if ( ! tocItems ) return articleTree
156
156
157
157
// for every article in a maptopic (or category) TOC...
158
- tocItems . map ( item => {
158
+ tocItems . forEach ( item => {
159
159
const article = { }
160
160
161
161
const articleHref = path . join ( categoryHref , item . href )
@@ -194,5 +194,6 @@ function getChildArticles (tocItems, maptopicPath) {
194
194
} else {
195
195
if ( withinMaptopic ) return item . href
196
196
}
197
+ return false
197
198
} )
198
199
}
0 commit comments