MCPcopy Index your code
hub / github.com/IABTechLab/uid2docs / removeItems

Function removeItems

sidebars.js:1–19  ·  view source on GitHub ↗
(sidebar, ...remove)

Source from the content-addressed store, hash-verified

1function removeItems(sidebar, ...remove) {
2 const result = [];
3 for (let item of sidebar) {
4 if (typeof item === 'string')
5 {
6 if (!remove.includes(item)) result.push({
7 type: 'ref', id: item
8 });
9 }
10 else {
11 if (!remove.includes(item.label)) {
12 const {items, ...rest} = item;
13 const keepItems = removeItems(items, ...remove);
14 if (keepItems?.length > 0 || rest.link) result.push({...rest, items: keepItems});
15 }
16 }
17 }
18 return result;
19}
20
21const fullSidebar = [
22

Callers 1

sidebars.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected