(toc)
| 126 | // Strip the bits and pieces from each object in the array that are |
| 127 | // not needed in the React component rendering. |
| 128 | function minimalMiniToc(toc) { |
| 129 | return toc.map(({ platform, contents, items }) => { |
| 130 | const minimal = { contents } |
| 131 | const subItems = minimalMiniToc(items) |
| 132 | if (subItems.length) minimal.items = subItems |
| 133 | if (platform) minimal.platform = platform |
| 134 | return minimal |
| 135 | }) |
| 136 | } |
| 137 | |
| 138 | export async function getAutomatedPageMiniTocItems( |
| 139 | items, |