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

Function deepForEach

packages/core/src/util/array_utils.ts:42–44  ·  view source on GitHub ↗
(input: (T | any[])[], fn: (value: T) => void)

Source from the content-addressed store, hash-verified

40}
41
42export function deepForEach<T>(input: (T | any[])[], fn: (value: T) => void): void {
43 input.forEach((value) => (Array.isArray(value) ? deepForEach(value, fn) : fn(value)));
44}
45
46export function addToArray(arr: any[], index: number, value: any): void {
47 // perf: array.push is faster than array.splice!

Callers 4

walkProviderTreeFunction · 0.90

Calls 3

isArrayMethod · 0.80
fnFunction · 0.50
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…