Files
goTorrent/goTorrentWebUI/node_modules/react-scripts/node_modules/coa/src/shell.coffee

11 lines
290 B
CoffeeScript

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