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

Function checkIfDocLoaderShouldBeIgnored

packages/server/src/utils/index.ts:449–477  ·  view source on GitHub ↗
(
    reactFlowNode: IReactFlowNode,
    reactFlowNodes: IReactFlowNode[],
    reactFlowEdges: IReactFlowEdge[]
)

Source from the content-addressed store, hash-verified

447 * @returns {boolean}
448 */
449const checkIfDocLoaderShouldBeIgnored = (
450 reactFlowNode: IReactFlowNode,
451 reactFlowNodes: IReactFlowNode[],
452 reactFlowEdges: IReactFlowEdge[]
453): boolean => {
454 let outputId = ''
455
456 if (reactFlowNode.data.outputAnchors.length) {
457 if (Object.keys(reactFlowNode.data.outputs || {}).length) {
458 const output = reactFlowNode.data.outputs?.output
459 const node = reactFlowNode.data.outputAnchors[0].options?.find((anchor) => anchor.name === output)
460 if (node) outputId = (node as ICommonObject).id
461 } else {
462 outputId = (reactFlowNode.data.outputAnchors[0] as ICommonObject).id
463 }
464 }
465
466 const targetNodeId = reactFlowEdges.find((edge) => edge.sourceHandle === outputId)?.target
467
468 if (targetNodeId) {
469 const targetNodeCategory = reactFlowNodes.find((nd) => nd.id === targetNodeId)?.data.category || ''
470 const targetNodeName = reactFlowNodes.find((nd) => nd.id === targetNodeId)?.data.name || ''
471 if (targetNodeCategory === 'Vector Stores' && targetNodeName !== 'memoryVectorStore') {
472 return true
473 }
474 }
475
476 return false
477}
478
479type BuildFlowParams = {
480 startingNodeIds: string[]

Callers 1

buildFlowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected