MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / flattenItems

Function flattenItems

packages/ui-components/src/Containers/Sidebar/index.tsx:15–21  ·  view source on GitHub ↗
(
  items: Array<SidebarItemType>
)

Source from the content-addressed store, hash-verified

13};
14
15const flattenItems = (
16 items: Array<SidebarItemType>
17): Array<SidebarItemType> => {
18 return items.flatMap((item: SidebarItemType) =>
19 item.items && item.items.length ? flattenItems(item.items) : [item]
20 );
21};
22
23type SidebarProps = {
24 groups: Array<

Callers 1

SideBarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected