MCPcopy Index your code
hub / github.com/angular/angular / mapChildrenIntoArray

Function mapChildrenIntoArray

packages/router/src/url_tree.ts:390–406  ·  view source on GitHub ↗
(
  segment: UrlSegmentGroup,
  fn: (v: UrlSegmentGroup, k: string) => T[],
)

Source from the content-addressed store, hash-verified

388}
389
390export 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

Callers 1

serializeSegmentFunction · 0.85

Calls 3

fnFunction · 0.50
forEachMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…