/
Mikhail823
/
todo
Обзор
Документация
Войти
/
Mikhail823
/
todo
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/shell-quote/quote.js
19 строк
497 B
Mikhail Popov
j
23 фев 2026, 16:12
23 фев 2026, 16:12
ff7232a
Код
Авторство
О чём код?
'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(' '); };