( segment: UrlSegmentGroup, fn: (v: UrlSegmentGroup, k: string) => T[], )
| 388 | } |
| 389 | |
| 390 | export function mapChildrenIntoArray<T>( |
| 391 | segment: UrlSegmentGroup, |
| 392 | fn: (v: UrlSegmentGroup, k: string) => T[], |
| 393 | ): T[] { |
| 394 | let res: T[] = []; |
| 395 | Object.entries(segment.children).forEach(([childOutlet, child]) => { |
| 396 | if (childOutlet === PRIMARY_OUTLET) { |
| 397 | res = res.concat(fn(child, childOutlet)); |
| 398 | } |
| 399 | }); |
| 400 | Object.entries(segment.children).forEach(([childOutlet, child]) => { |
| 401 | if (childOutlet !== PRIMARY_OUTLET) { |
| 402 | res = res.concat(fn(child, childOutlet)); |
| 403 | } |
| 404 | }); |
| 405 | return res; |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * @description |
no test coverage detected
searching dependent graphs…