Fixed JSON parser(s)
This commit is contained in:
@@ -2531,14 +2531,16 @@ const AngularWorkflow = (props) => {
|
||||
|
||||
foundResult.result = foundResult.result.trim()
|
||||
foundResult.result = foundResult.result.split(" None").join(" \"None\"")
|
||||
foundResult.result = foundResult.result.split(" False").join(" false")
|
||||
foundResult.result = foundResult.result.split(" True").join(" true")
|
||||
foundResult.result = foundResult.result.split("\'").join("\"")
|
||||
|
||||
var jsonvalid = true
|
||||
try {
|
||||
const tmp = String(JSON.parse(foundResult.result))
|
||||
if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
jsonvalid = false
|
||||
}
|
||||
//if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
// jsonvalid = false
|
||||
//}
|
||||
} catch (e) {
|
||||
jsonvalid = false
|
||||
}
|
||||
@@ -2625,9 +2627,9 @@ const AngularWorkflow = (props) => {
|
||||
var jsonvalid = true
|
||||
try {
|
||||
const tmp = String(JSON.parse(actionItem.example))
|
||||
if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
jsonvalid = false
|
||||
}
|
||||
//if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
// jsonvalid = false
|
||||
//}
|
||||
} catch (e) {
|
||||
jsonvalid = false
|
||||
}
|
||||
@@ -5344,13 +5346,15 @@ const AngularWorkflow = (props) => {
|
||||
var showResult = executionData.execution_argument.trim()
|
||||
showResult = showResult.split(" None").join(" \"None\"")
|
||||
showResult = showResult.split("\'").join("\"")
|
||||
showResult = showResult.split(" False").join(" false")
|
||||
showResult = showResult.split(" True").join(" true")
|
||||
|
||||
var jsonvalid = true
|
||||
try {
|
||||
const tmp = String(JSON.parse(showResult))
|
||||
if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
jsonvalid = false
|
||||
}
|
||||
//if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
// jsonvalid = false
|
||||
//}
|
||||
} catch (e) {
|
||||
jsonvalid = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user