MCPcopy
hub / github.com/reduxjs/redux-devtools / visit

Function visit

packages/map2tree/src/index.ts:11–27  ·  view source on GitHub ↗
(
  parent: Node,
  visitFn: (parent: Node) => void,
  childrenFn: (parent: Node) => Node[] | undefined | null
)

Source from the content-addressed store, hash-verified

9}
10
11function visit(
12 parent: Node,
13 visitFn: (parent: Node) => void,
14 childrenFn: (parent: Node) => Node[] | undefined | null
15) {
16 if (!parent) return;
17
18 visitFn(parent);
19
20 const children = childrenFn(parent);
21 if (children) {
22 const count = children.length;
23 for (let i = 0; i < count; i++) {
24 visit(children[i], visitFn, childrenFn);
25 }
26 }
27}
28
29function getNode(tree: Node, key: string): Node | null {
30 let node = null;

Callers 1

getNodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected