mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-17 13:55:54 +08:00
fix: i.find is not a function (#18945)
This commit is contained in:
parent
8299614e60
commit
03ac2d0f17
@ -596,17 +596,16 @@ const getIterationItemType = ({
|
|||||||
arrayType = curr.find((v: any) => v.variable === (valueSelector).join('.'))?.type
|
arrayType = curr.find((v: any) => v.variable === (valueSelector).join('.'))?.type
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
(valueSelector).slice(1).forEach((key, i) => {
|
for (let i = 1; i < valueSelector.length - 1; i++) {
|
||||||
|
const key = valueSelector[i]
|
||||||
const isLast = i === valueSelector.length - 2
|
const isLast = i === valueSelector.length - 2
|
||||||
curr = curr?.find((v: any) => v.variable === key)
|
curr = Array.isArray(curr) ? curr.find(v => v.variable === key) : []
|
||||||
if (isLast) {
|
|
||||||
arrayType = curr?.type
|
if (isLast)
|
||||||
}
|
arrayType = curr?.type
|
||||||
else {
|
else if (curr?.type === VarType.object || curr?.type === VarType.file)
|
||||||
if (curr?.type === VarType.object || curr?.type === VarType.file)
|
curr = curr.children || []
|
||||||
curr = curr.children
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (arrayType as VarType) {
|
switch (arrayType as VarType) {
|
||||||
@ -631,7 +630,7 @@ const getLoopItemType = ({
|
|||||||
}: {
|
}: {
|
||||||
valueSelector: ValueSelector
|
valueSelector: ValueSelector
|
||||||
beforeNodesOutputVars: NodeOutPutVar[]
|
beforeNodesOutputVars: NodeOutPutVar[]
|
||||||
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
||||||
}): VarType => {
|
}): VarType => {
|
||||||
const outputVarNodeId = valueSelector[0]
|
const outputVarNodeId = valueSelector[0]
|
||||||
const isSystem = isSystemVar(valueSelector)
|
const isSystem = isSystemVar(valueSelector)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user