me like nix
1'use strict';
2
3module.exports = function quote(xs) {
4 return xs.map(function (s) {
5 if (s === '') {
6 return '\'\'';
7 }
8 if (s && typeof s === 'object') {
9 return s.op.replace(/(.)/g, '\\$1');
10 }
11 if ((/["\s\\]/).test(s) && !(/'/).test(s)) {
12 return "'" + s.replace(/(['])/g, '\\$1') + "'";
13 }
14 if ((/["'\s]/).test(s)) {
15 return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
16 }
17 return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
18 }).join(' ');
19};