( result: TraversalResult, rootUri: URI )
| 184 | } |
| 185 | |
| 186 | export function serializeTraversalResult( |
| 187 | result: TraversalResult, |
| 188 | rootUri: URI |
| 189 | ): JsonTraversalResult { |
| 190 | return { |
| 191 | nodes: result.nodes.map(n => ({ |
| 192 | uri: uriToOutputString(n.uri, rootUri), |
| 193 | title: n.title, |
| 194 | type: n.type, |
| 195 | distance: n.distance, |
| 196 | })), |
| 197 | edges: result.edges.map(e => ({ |
| 198 | source: uriToOutputString(e.source, rootUri), |
| 199 | target: uriToOutputString(e.target, rootUri), |
| 200 | label: e.label, |
| 201 | })), |
| 202 | }; |
| 203 | } |
no test coverage detected