(nav: LMobileNavItem[])
| 304 | } |
| 305 | |
| 306 | function createMobileNavigation(nav: LMobileNavItem[]) { |
| 307 | return nav.map((item): LMobileNavItem => { |
| 308 | if ("items" in item) { |
| 309 | return { |
| 310 | ...item, |
| 311 | id: nanoid(6), |
| 312 | items: createMobileNavigation(item.items), |
| 313 | active: false, |
| 314 | }; |
| 315 | } |
| 316 | return { |
| 317 | ...item, |
| 318 | id: nanoid(6), |
| 319 | active: false, |
| 320 | }; |
| 321 | }); |
| 322 | } |
| 323 | |
| 324 | export function markActiveNavigation(link: string, navigation: LMobileNavItem[]) { |
| 325 | // We want to mutate the array and items inside. |
no test coverage detected
searching dependent graphs…