MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / getAllNodesInPath

Function getAllNodesInPath

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

Source from the content-addressed store, hash-verified

2081 * @returns {string[]}
2082 */
2083export 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
2100export const _removeCredentialId = (obj: any): any => {
2101 if (!obj || typeof obj !== 'object') return obj

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected