diff --git a/index.js b/index.js index 0aa23ed..dd8103b 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,9 @@ exports.quote = function (xs) { return xs.map(function (s) { - if (/["\s]/.test(s) && !/'/.test(s)) { + if (s && typeof s === 'object') { + return s.op.replace(/(.)/g, '\\$1'); + } + else if (/["\s]/.test(s) && !/'/.test(s)) { return "'" + s.replace(/(['\\])/g, '\\$1') + "'"; } else if (/["'\s]/.test(s)) {