(promise, destination)
| 47 | }; |
| 48 | |
| 49 | const forwardReadableMethods = (promise, destination) => { |
| 50 | const subprocessOptions = SUBPROCESS_OPTIONS.get(destination); |
| 51 | SUBPROCESS_OPTIONS.set(promise, subprocessOptions); |
| 52 | promise.stdio = destination.stdio; |
| 53 | promise.all = destination.all; |
| 54 | |
| 55 | const {options: {encoding}} = subprocessOptions; |
| 56 | const concurrentStreams = initializeConcurrentStreams(); |
| 57 | promise[Symbol.asyncIterator] = createIterable.bind(undefined, promise, encoding, {}); |
| 58 | promise.iterable = createIterable.bind(undefined, promise, encoding); |
| 59 | promise.readable = createPipeReadable.bind(undefined, promise, { |
| 60 | subprocess: promise, |
| 61 | concurrentStreams, |
| 62 | encoding, |
| 63 | }); |
| 64 | promise.readableStream = createReadableStream.bind(undefined, promise); |
| 65 | forwardAll(promise, destination); |
| 66 | }; |
| 67 | |
| 68 | const forwardAll = (promise, destination) => { |
| 69 | if (destination.all === undefined) { |
no test coverage detected