[Pkg-javascript-commits] [node-shell-quote] 57/137: quote all ops objects

Bastien Roucariès rouca at moszumanska.debian.org
Fri Aug 25 19:19:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-shell-quote.

commit ac7be63574e1da48bc6f495aee363d31863222c3
Author: James Halliday <mail at substack.net>
Date:   Mon May 13 03:33:25 2013 -0700

    quote all ops objects
---
 index.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-shell-quote.git



More information about the Pkg-javascript-commits mailing list