File tree 4 files changed +12
-12
lines changed
4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ const pool = mysql.createPool({
16
16
if ( ! values ) {
17
17
return query
18
18
}
19
- return query . replace ( / \: ( \w + ) / g, function ( matchedSubstring , key ) {
20
- if ( values . hasOwnProperty ( key ) ) {
21
- return this . escape ( values [ key ] )
19
+ return query . replace ( / \: ( \w + ) / g, function ( matchedSubstring , capturedValue ) {
20
+ if ( values . hasOwnProperty ( capturedValue ) ) {
21
+ return this . escape ( values [ capturedValue ] )
22
22
}
23
23
return matchedSubstring
24
24
} . bind ( this ) )
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ const pool = mysql.createPool({
17
17
if ( ! values ) {
18
18
return query
19
19
}
20
- return query . replace ( / \: ( \w + ) / g, function ( matchedSubstring , key ) {
21
- if ( values . hasOwnProperty ( key ) ) {
22
- return this . escape ( values [ key ] )
20
+ return query . replace ( / \: ( \w + ) / g, function ( matchedSubstring , capturedValue ) {
21
+ if ( values . hasOwnProperty ( capturedValue ) ) {
22
+ return this . escape ( values [ capturedValue ] )
23
23
}
24
24
return matchedSubstring
25
25
} . bind ( this ) )
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ const pool = mysql.createPool({
17
17
return query
18
18
}
19
19
<% - // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_the_replacement -%>
20
- return query .replace (/ \: (\w + )/ g , function (matchedSubstring , key ) {
21
- if (values .hasOwnProperty (key )) {
22
- return this .escape (values[key ])
20
+ return query .replace (/ \: (\w + )/ g , function (matchedSubstring , capturedValue ) {
21
+ if (values .hasOwnProperty (capturedValue )) {
22
+ return this .escape (values[capturedValue ])
23
23
}
24
24
return matchedSubstring
25
25
}.bind (this ))
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ const pool = mysql.createPool({
18
18
return query
19
19
}
20
20
<% - // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_the_replacement -%>
21
- return query .replace (/ \: (\w + )/ g , function (matchedSubstring , key ) {
22
- if (values .hasOwnProperty (key )) {
23
- return this .escape (values[key ])
21
+ return query .replace (/ \: (\w + )/ g , function (matchedSubstring , capturedValue ) {
22
+ if (values .hasOwnProperty (capturedValue )) {
23
+ return this .escape (values[capturedValue ])
24
24
}
25
25
return matchedSubstring
26
26
}.bind (this ))
You can’t perform that action at this time.
0 commit comments