(v)
| 114 | function collectReferencedNames(ast) { |
| 115 | const referenced = new Set() |
| 116 | const walk = (v) => { |
| 117 | if (Array.isArray(v)) { |
| 118 | v.forEach(walk) |
| 119 | } else if (v && typeof v === 'object') { |
| 120 | if (v.Type === 'group' && typeof v.Value === 'string') referenced.add(v.Value) |
| 121 | for (const key in v) if (key !== 'Name') walk(v[key]) |
| 122 | } |
| 123 | } |
| 124 | for (const def of ast) walk(def) |
| 125 | return referenced |
| 126 | } |
no test coverage detected