MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / getAllNodesInPath

Function getAllNodesInPath

packages/server/src/utils/index.ts:2074–2089  ·  view source on GitHub ↗
(startNode: string, graph: INodeDirectedGraph)

Source from the content-addressed store, hash-verified

2072 * @returns {string[]}
2073 */
2074export 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
2091export const _removeCredentialId = (obj: any): any => {
2092 if (!obj || typeof obj !== 'object') return obj

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected