REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.50 KB
Close
//opt/alt/alt-nodejs16/root/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/escape.js
Text
Base64
'use strict' // eslint-disable-next-line max-len // this code adapted from: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ const cmd = (input, doubleEscape) => { if (!input.length) { return '""' } let result if (!/[ \t\n\v"]/.test(input)) { result = input } else { result = '"' for (let i = 0; i <= input.length; ++i) { let slashCount = 0 while (input[i] === '\\') { ++i ++slashCount } if (i === input.length) { result += '\\'.repeat(slashCount * 2) break } if (input[i] === '"') { result += '\\'.repeat(slashCount * 2 + 1) result += input[i] } else { result += '\\'.repeat(slashCount) result += input[i] } } result += '"' } // and finally, prefix shell meta chars with a ^ result = result.replace(/[ !%^&()<>|"]/g, '^$&') if (doubleEscape) { result = result.replace(/[ !%^&()<>|"]/g, '^$&') } return result } const sh = (input) => { if (!input.length) { return `''` } if (!/[\t\n\r "#$&'()*;<>?\\`|~]/.test(input)) { return input } // replace single quotes with '\'' and wrap the whole result in a fresh set of quotes const result = `'${input.replace(/'/g, `'\\''`)}'` // if the input string already had single quotes around it, clean those up .replace(/^(?:'')+(?!$)/, '') .replace(/\\'''/g, `\\'`) return result } module.exports = { cmd, sh, }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
node-gyp-bin
DIR
-
drwxr-xr-x
2026-03-19 07:09:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
escape.js
1.50 KB
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
is-server-package.js
314 B
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
is-windows.js
113 B
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
make-spawn-args.js
1.97 KB
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package-envs.js
699 B
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
run-script-pkg.js
2.69 KB
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
run-script.js
516 B
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
set-path.js
1.47 KB
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
signal-manager.js
820 B
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
validate-options.js
1.18 KB
lrw-r--r--
2026-03-09 06:51:27
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).