lepu-test-platform-web/node_modules/coa/lib/shell.js

15 lines
358 B
JavaScript
Raw Permalink Normal View History

// 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;
}
};