security/codeql-dependabot-gitleaks
| 1 | import { Sidebar } from "types" |
| 2 | |
| 3 | const commonOptions: Partial<Sidebar.RawSidebarItem> = { |
| 4 | loaded: true, |
| 5 | } |
| 6 | |
| 7 | export function sidebarAttachCommonOptions( |
| 8 | sidebar: Sidebar.RawSidebarItem[] |
| 9 | ): Sidebar.RawSidebarItem[] { |
| 10 | return sidebar.map((item) => { |
| 11 | if (item.type === "separator") { |
| 12 | return item |
| 13 | } |
| 14 | |
| 15 | return { |
| 16 | ...commonOptions, |
| 17 | ...item, |
| 18 | children: sidebarAttachCommonOptions(item.children || []), |
| 19 | } |
| 20 | }) |
| 21 | } |