MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / renderTree

Function renderTree

lib/aria.js:174–185  ·  view source on GitHub ↗
(nodes, depth = 0)

Source from the content-addressed store, hash-verified

172}
173
174function renderTree(nodes, depth = 0) {
175 const items = groupByConsecutiveRole(nodes).flatMap(group => collapseGroup(group, depth))
176 return items
177 .map(item => {
178 if (typeof item === 'string') return item
179 const indent = ' '.repeat(depth)
180 const head = `${indent}- ${formatNode(item)}`
181 if (item.children.length === 0) return head
182 return `${head}:\n${renderTree(item.children, depth + 1)}`
183 })
184 .join('\n')
185}
186
187// ─────────────────────────────────────────────────────────────────
188// STEP 4 · Diff: collect interactive summaries → bag diff → text

Callers 1

compactAriaSnapshotFunction · 0.85

Calls 3

groupByConsecutiveRoleFunction · 0.85
collapseGroupFunction · 0.85
formatNodeFunction · 0.85

Tested by

no test coverage detected