MCPcopy Index your code
hub / github.com/github/docs / minimalMiniToc

Function minimalMiniToc

lib/get-mini-toc-items.js:128–136  ·  view source on GitHub ↗
(toc)

Source from the content-addressed store, hash-verified

126// Strip the bits and pieces from each object in the array that are
127// not needed in the React component rendering.
128function 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
138export async function getAutomatedPageMiniTocItems(
139 items,

Callers 1

getMiniTocItemsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected