const validateInputSync = ({input}) => { if (isStream(input)) { throw new TypeError('The `input` option cannot be a stream in sync mode'); } }
// `input` option const handleInput = (spawned, input) => { // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 if (input === undefined || spawned.stdin === undefined) { return; } if (isStream(input)) { input.pipe(spawned.stdin); } else { spawned.stdin.end(input); } }