Server IP : 162.0.209.157 / Your IP : 3.145.2.6 [ Web Server : LiteSpeed System : Linux premium178.web-hosting.com 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : balaoqob ( 2395) PHP Version : 8.0.30 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /lib/node_modules/npm/node_modules/execa/lib/ |
Upload File : |
'use strict'; const alias = ['stdin', 'stdout', 'stderr']; const hasAlias = opts => alias.some(x => Boolean(opts[x])); module.exports = opts => { if (!opts) { return null; } if (opts.stdio && hasAlias(opts)) { throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); } if (typeof opts.stdio === 'string') { return opts.stdio; } const stdio = opts.stdio || []; if (!Array.isArray(stdio)) { throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); } const result = []; const len = Math.max(stdio.length, alias.length); for (let i = 0; i < len; i++) { let value = null; if (stdio[i] !== undefined) { value = stdio[i]; } else if (opts[alias[i]] !== undefined) { value = opts[alias[i]]; } result[i] = value; } return result; };