a545ec3dc01edd7d285994db53096a810b2b3df7a105d6543fff779ea90c7a2d6b5a21344ae96b2661df088ee15fbe441ad3aa51907492d3e4bd83e77adb0e 497 B

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