diff options
Diffstat (limited to 'node_modules/coa/lib/shell.js')
| -rw-r--r-- | node_modules/coa/lib/shell.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/node_modules/coa/lib/shell.js b/node_modules/coa/lib/shell.js new file mode 100644 index 00000000..f3d49662 --- /dev/null +++ b/node_modules/coa/lib/shell.js @@ -0,0 +1,14 @@ +// Generated by CoffeeScript 1.6.3 +exports.unescape = function(w) { + w = w.charAt(0) === '"' ? w.replace(/^"|([^\\])"$/g, '$1') : w.replace(/\\ /g, ' '); + return w.replace(/\\("|'|\$|`|\\)/g, '$1'); +}; + +exports.escape = function(w) { + w = w.replace(/(["'$`\\])/g, '\\$1'); + if (w.match(/\s+/)) { + return '"' + w + '"'; + } else { + return w; + } +}; |
