/
lostSun
/
project-client-server-apps
Обзор
Документация
Войти
/
lostSun
/
project-client-server-apps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/shell-quote/quote.js
19 строк
497 B
1lostsun
initial commit
05 май 2025, 11:35
05 май 2025, 11:35
fe8f535
Код
Авторство
О чём код?
'use strict'; module.exports = function quote(xs) { return xs.map(function (s) { if (s === '') { return '\'\''; } if (s && typeof s === 'object') { return s.op.replace(/(.)/g, '\\$1'); } if ((/["\s]/).test(s) && !(/'/).test(s)) { return "'" + s.replace(/(['\\])/g, '\\$1') + "'"; } if ((/["'\s]/).test(s)) { return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"'; } return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2'); }).join(' '); };