* Node identity for cross-referencing edges/refs: the node id itself (both * paths compute the same deterministic ids, and id embeds kind+name+line).
(n)
| 126 | * paths compute the same deterministic ids, and id embeds kind+name+line). |
| 127 | */ |
| 128 | function canonNode(n) { |
| 129 | const out = { |
| 130 | id: n.id, kind: n.kind, name: n.name, qualifiedName: n.qualifiedName, |
| 131 | filePath: n.filePath, language: n.language, |
| 132 | startLine: n.startLine, endLine: n.endLine, |
| 133 | startColumn: n.startColumn, endColumn: n.endColumn, |
| 134 | }; |
| 135 | for (const k of ['docstring', 'signature', 'visibility', 'isExported', 'isAsync', 'isStatic', 'isAbstract', 'returnType']) { |
| 136 | if (n[k] !== undefined) out[k] = n[k]; |
| 137 | } |
| 138 | if (n.decorators !== undefined) out.decorators = n.decorators; |
| 139 | if (n.typeParameters !== undefined) out.typeParameters = n.typeParameters; |
| 140 | return JSON.stringify(out); |
| 141 | } |
| 142 | |
| 143 | function canonEdge(e) { |
| 144 | const out = { source: e.source, target: e.target, kind: e.kind }; |
nothing calls this directly
no outgoing calls
no test coverage detected