* Get adjacent edges based on direction
(
nodeId: string,
direction: 'outgoing' | 'incoming' | 'both',
edgeKinds?: EdgeKind[]
)
| 233 | * Get adjacent edges based on direction |
| 234 | */ |
| 235 | private getAdjacentEdges( |
| 236 | nodeId: string, |
| 237 | direction: 'outgoing' | 'incoming' | 'both', |
| 238 | edgeKinds?: EdgeKind[] |
| 239 | ): Edge[] { |
| 240 | const kinds = edgeKinds && edgeKinds.length > 0 ? edgeKinds : undefined; |
| 241 | |
| 242 | if (direction === 'outgoing') { |
| 243 | return this.queries.getOutgoingEdges(nodeId, kinds); |
| 244 | } else if (direction === 'incoming') { |
| 245 | return this.queries.getIncomingEdges(nodeId, kinds); |
| 246 | } else { |
| 247 | // Both directions |
| 248 | const outgoing = this.queries.getOutgoingEdges(nodeId, kinds); |
| 249 | const incoming = this.queries.getIncomingEdges(nodeId, kinds); |
| 250 | return [...outgoing, ...incoming]; |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * Find all callers of a function/method |
no test coverage detected