Skip to content

Commit

Permalink
Fix JSON escaping (FlowiseAI#2461)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokeyish committed May 24, 2024
1 parent 50c53de commit 82899d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/server/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ export const getVariableValue = (
const variableValue = variableDict[path]
// Replace all occurrence
if (typeof variableValue === 'object') {
returnVal = returnVal.split(path).join(JSON.stringify(variableValue).replace(/"/g, '\\"'))
returnVal = returnVal.split(path).join(JSON.stringify(variableValue).replaceAll('"', '\\"').replaceAll('\\n', '\\\\n'))
} else {
returnVal = returnVal.split(path).join(variableValue)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"lib": ["es2017"],
"target": "es2017" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"lib": ["es2021"],
"target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */,
"emitDecoratorMetadata": true /* Emit design-type metadata for decorated declarations in source files. */,
"module": "commonjs" /* Specify what module code is generated. */,
Expand Down

0 comments on commit 82899d9

Please sign in to comment.