From 350ea6be6e280598c1df2e802f51d213343f6880 Mon Sep 17 00:00:00 2001 From: twwu Date: Thu, 5 Jun 2025 17:32:03 +0800 Subject: [PATCH] fix: correct spacing and formatting in variable utility functions --- .../workflow/nodes/_base/components/variable/utils.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/variable/utils.ts b/web/app/components/workflow/nodes/_base/components/variable/utils.ts index 1f6a9ea008..0c6b643879 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -53,7 +53,7 @@ export const isConversationVar = (valueSelector: ValueSelector) => { } export const isRagVariableVar = (valueSelector: ValueSelector) => { - if(!valueSelector) + if (!valueSelector) return false return valueSelector[0] === 'rag' } @@ -152,7 +152,7 @@ const findExceptVarInObject = (obj: any, filterVar: (payload: Var, selector: Val if (isStructuredOutput) { childrenResult = findExceptVarInStructuredOutput(children, filterVar) } - else if (Array.isArray(children)) { + else if (Array.isArray(children)) { childrenResult = children.filter((item: Var) => { const { children: itemChildren } = item const currSelector = [...value_selector, item.variable] @@ -164,7 +164,7 @@ const findExceptVarInObject = (obj: any, filterVar: (payload: Var, selector: Val return filteredObj.children && (filteredObj.children as Var[])?.length > 0 }) } - else { + else { childrenResult = [] } @@ -638,7 +638,6 @@ export const toNodeOutputVars = ( let ragVariablesInDataSource: RAGPipelineVariable[] = [] if (node.data.type === BlockEnum.DataSource) ragVariablesInDataSource = ragVariables.filter(ragVariable => ragVariable.belong_to_node_id === node.id) - console.log(ragVariables, ragVariablesInDataSource, node.id) return { ...formatItem(node, isChatMode, filterVar, ragVariablesInDataSource.map( (ragVariable: RAGPipelineVariable) => ({ @@ -682,9 +681,9 @@ const getIterationItemType = ({ curr = Array.isArray(curr) ? curr.find(v => v.variable === key) : [] if (isLast) - arrayType = curr?.type + arrayType = curr?.type else if (curr?.type === VarType.object || curr?.type === VarType.file) - curr = curr.children || [] + curr = curr.children || [] } }