| 2081 | * @returns {string[]} |
| 2082 | */ |
| 2083 | export const getAllNodesInPath = (startNode: string, graph: INodeDirectedGraph): string[] => { |
| 2084 | const nodes = new Set<string>() |
| 2085 | const queue = [startNode] |
| 2086 | |
| 2087 | while (queue.length > 0) { |
| 2088 | const current = queue.shift()! |
| 2089 | if (nodes.has(current)) continue |
| 2090 | |
| 2091 | nodes.add(current) |
| 2092 | if (graph[current]) { |
| 2093 | queue.push(...graph[current]) |
| 2094 | } |
| 2095 | } |
| 2096 | |
| 2097 | return Array.from(nodes) |
| 2098 | } |
| 2099 | |
| 2100 | export const _removeCredentialId = (obj: any): any => { |
| 2101 | if (!obj || typeof obj !== 'object') return obj |