File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ class Graph {
6363 let paramType = typeof paramValue ;
6464 if ( paramType == "string" ) {
6565 let strValue = "" ;
66- paramValue = paramValue . replace ( / [ \\ " ' ] / g, '\\$&' ) ;
66+ paramValue = paramValue . replace ( / [ \\ " ' ] / g, '\\$&' ) ;
6767 if ( paramValue [ 0 ] != '"' ) strValue += '"' ;
6868 strValue += paramValue ;
69- if ( paramValue [ paramValue . length - 1 ] != '"' ) strValue += '"' ;
69+ if ( ( paramValue [ paramValue . length - 1 ] != '"' ) || ( ( paramValue [ paramValue . length - 1 ] == '"' ) && ( paramValue [ paramValue . length - 2 ] == '\\' ) ) ) strValue += '"' ;
7070 return strValue ;
7171 }
7272 if ( Array . isArray ( paramValue ) ) {
Original file line number Diff line number Diff line change @@ -412,11 +412,14 @@ describe("RedisGraphAPI Test", () => {
412412 [ 1 , 2 , 3 ] ,
413413 [ "1" , "2" , "3" ] ,
414414 null ,
415- 'test"abc'
415+ 'test"abc' ,
416+ "test\"abc2" ,
417+ "\"testabc3" ,
418+ "testabc4\""
416419 ] ;
417420 let promises = [ ] ;
418421 for ( var i = 0 ; i < params . length ; i ++ ) {
419- let param = { param : params [ i ] } ;
422+ let param = { param : params [ i ] } ;
420423 promises . push ( api . query ( "RETURN $param" , param ) ) ;
421424 }
422425 let values = await Promise . all ( promises ) ;
You can’t perform that action at this time.
0 commit comments