Skip to content

Commit

Permalink
[CONJS-161] escape function incorrect use of 'this' #149
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Feb 19, 2021
1 parent dfc000e commit 715d669
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/misc/utils.js
Expand Up @@ -116,7 +116,7 @@ module.exports.escapeId = (opts, info, value) => {
return '`' + value.replace(/`/g, '``') + '`';
};

module.exports.escape = (opts, info, value) => {
const escapeParameters = (opts, info, value) => {
if (value === undefined || value === null) return 'NULL';

switch (typeof value) {
Expand Down Expand Up @@ -148,7 +148,7 @@ module.exports.escape = (opts, info, value) => {
let out = opts.arrayParenthesis ? '(' : '';
for (let i = 0; i < value.length; i++) {
if (i !== 0) out += ',';
out += this.escape(opts, info, value[i]);
out += escapeParameters(opts, info, value[i]);
}
if (opts.arrayParenthesis) out += ')';
return out;
Expand Down Expand Up @@ -292,3 +292,5 @@ const escapeString = (val) => {

return escaped;
};

module.exports.escape = escapeParameters;

0 comments on commit 715d669

Please sign in to comment.