shell.coffee 290 Bytes RawBlameHistoryPermalink 1 2 3 4 5 6 7 8 9 10 exports.unescape = (w) -> w = if w.charAt(0) is '"' w.replace(/^"|([^\\])"$/g, '$1') else w.replace(/\\ /g, ' ') w.replace(/\\("|'|\$|`|\\)/g, '$1') exports.escape = (w) -> w = w.replace(/(["'$`\\])/g,'\\$1') if w.match(/\s+/) then '"' + w + '"' else w