Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

17 righe
457 B

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