File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/server/src/utils Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -782,7 +782,13 @@ export const getVariableValue = (
782
782
const variableValue = variableDict [ path ]
783
783
// Replace all occurrence
784
784
if ( typeof variableValue === 'object' ) {
785
- returnVal = returnVal . split ( path ) . join ( JSON . stringify ( JSON . stringify ( variableValue ) ) )
785
+ const stringifiedValue = JSON . stringify ( JSON . stringify ( variableValue ) )
786
+ if ( stringifiedValue . startsWith ( '"' ) && stringifiedValue . endsWith ( '"' ) ) {
787
+ // get rid of the double quotes
788
+ returnVal = returnVal . split ( path ) . join ( stringifiedValue . substring ( 1 , stringifiedValue . length - 1 ) )
789
+ } else {
790
+ returnVal = returnVal . split ( path ) . join ( JSON . stringify ( variableValue ) . replace ( / " / g, '\\"' ) )
791
+ }
786
792
} else {
787
793
returnVal = returnVal . split ( path ) . join ( variableValue )
788
794
}
You can’t perform that action at this time.
0 commit comments