| 2072 | * @returns {string[]} |
| 2073 | */ |
| 2074 | export const getAllNodesInPath = (startNode: string, graph: INodeDirectedGraph): string[] => { |
| 2075 | const nodes = new Set<string>() |
| 2076 | const queue = [startNode] |
| 2077 | |
| 2078 | while (queue.length > 0) { |
| 2079 | const current = queue.shift()! |
| 2080 | if (nodes.has(current)) continue |
| 2081 | |
| 2082 | nodes.add(current) |
| 2083 | if (graph[current]) { |
| 2084 | queue.push(...graph[current]) |
| 2085 | } |
| 2086 | } |
| 2087 | |
| 2088 | return Array.from(nodes) |
| 2089 | } |
| 2090 | |
| 2091 | export const _removeCredentialId = (obj: any): any => { |
| 2092 | if (!obj || typeof obj !== 'object') return obj |