blob: 3672042cba14e9a8d351c03a059d1d21084b1fdd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
'use strict';
module.exports = function escapeshellarg(arg) {
// discuss at: http://locutus.io/php/escapeshellarg/
// original by: Felix Geisendoerfer (http://www.debuggable.com/felix)
// improved by: Brett Zamir (http://brett-zamir.me)
// example 1: escapeshellarg("kevin's birthday")
// returns 1: "'kevin\\'s birthday'"
var ret = '';
ret = arg.replace(/[^\\]'/g, function (m, i, s) {
return m.slice(0, 1) + '\\\'';
});
return "'" + ret + "'";
};
//# sourceMappingURL=escapeshellarg.js.map
|