mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
@@ -1,4 +1,5 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import JSON5 from 'json5'
|
||||
|
||||
class Iteration_Agentflow implements INode {
|
||||
label: string
|
||||
@@ -41,10 +42,10 @@ class Iteration_Agentflow implements INode {
|
||||
// Helper function to clean JSON strings with redundant backslashes
|
||||
const safeParseJson = (str: string): string => {
|
||||
try {
|
||||
return JSON.parse(str)
|
||||
return JSON5.parse(str)
|
||||
} catch {
|
||||
// Try parsing after cleaning
|
||||
return JSON.parse(str.replace(/\\(["'[\]{}])/g, '$1'))
|
||||
return JSON5.parse(str.replace(/\\(["'[\]{}])/g, '$1'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user