Skip to content
Myr

Upgrade `is-stream` to `4.0.1` (#835)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 28acdbc · Browse files · 7 files+28 added−16 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+28 added−16 removed

  • tests:+1 added−1 removed
  • other:+27 added−15 removed

7 files+28 added−16 removed

modified:lib/stdio/direction.js+22 added-10 removed
modified:lib/stdio/input.js+1 added-1 removed
modified:lib/stdio/native.js+1 added-1 removed
modified:lib/stdio/type.js+1 added-1 removed
17 unmodified lines
18 if (isWebStream(stdioOption)) {19 return 'webStream';20 }2122 if (isNodeStream(stdioOption)) {22 if (isNodeStream(stdioOption, {checkOpen: false})) {23 return 'native';24 }2526 if (isUint8Array(stdioOption)) {
74 unmodified lines
modified:lib/stream.js+1 added-1 removed
128 unmodified lines
129// Some `stdin`/`stdout`/`stderr` options create a stream, e.g. when passing a file path.130// The `.pipe()` method automatically ends that stream when `childProcess` ends.131// This makes sure we wait for the completion of those streams, in order to catch any error.132const waitForCustomStreamsEnd = (stdioStreamsGroups, streamInfo) => stdioStreamsGroups.flatMap((stdioStreams, index) => stdioStreams133 .filter(({value}) => isStream(value) && !isStandardStream(value))133 .filter(({value}) => isStream(value, {checkOpen: false}) && !isStandardStream(value))134 .map(({type, value}) => waitForStream(value, index, streamInfo, {135 isSameDirection: type === 'generator',136 stopOnExit: type === 'native',137 })));
83 unmodified lines
modified:test/stdio/node-stream.js+1 added-1 removed
245 unmodified lines
246247const testInputDuplexStream = async (t, index) => {248 const stream = new PassThrough();249 stream.end(foobarString);250 const {stdout} = await execa('stdin-fd.js', [`${index}`], getStdio(index, [stream, 'pipe']));250 const {stdout} = await execa('stdin-fd.js', [`${index}`], getStdio(index, [stream, new Uint8Array()]));251 t.is(stdout, foobarString);252};253254test('Can pass Duplex streams to stdin', testInputDuplexStream, 0);
14 unmodified lines
modified:package.json+1 added-1 removed
47 unmodified lines
48 "@sindresorhus/merge-streams": "^2.0.1",49 "cross-spawn": "^7.0.3",50 "get-stream": "^8.0.1",51 "human-signals": "^6.0.0",52 "is-stream": "^3.0.0",52 "is-stream": "^4.0.1",53 "npm-run-path": "^5.2.0",54 "signal-exit": "^4.1.0",55 "strip-final-newline": "^4.0.0"56 },
36 unmodified lines