Every class, struct and union node, as `kind qualifiedName`, with the members it contains.
(cg: CodeGraph)
| 45 | |
| 46 | /** Every class, struct and union node, as `kind qualifiedName`, with the members it contains. */ |
| 47 | function classes(cg: CodeGraph): Record<string, string[]> { |
| 48 | const out: Record<string, string[]> = {}; |
| 49 | for (const n of [...cg.getNodesByKind('class'), ...cg.getNodesByKind('struct'), ...cg.getNodesByKind('union')]) { |
| 50 | const members = cg.getOutgoingEdgesFrom([n.id], ['contains']) |
| 51 | .map((e) => cg.getNode(e.target)) |
| 52 | .filter((m): m is Node => m !== null && (m.kind === 'method' || m.kind === 'field' || m.kind === 'property')) |
| 53 | .map((m) => m.qualifiedName) |
| 54 | .sort(); |
| 55 | out[`${n.kind} ${n.qualifiedName}`] = members; |
| 56 | } |
| 57 | return out; |
| 58 | } |
| 59 | |
| 60 | const SKIPLIST = lines( |
| 61 | 'namespace leveldb {', |
no test coverage detected