MCPcopy Create free account
hub / github.com/sindresorhus/execa / forwardDestinationMethods

Function forwardDestinationMethods

lib/pipe/setup.js:40–47  ·  view source on GitHub ↗
(promise, destination, pipeFailureSignal)

Source from the content-addressed store, hash-verified

38The return value of `.pipe()` exposes the destination subprocess' output, but its iteration and stream conversion methods must await the whole pipe so source failures are propagated too. The destination is `undefined` when `.pipe()` was passed invalid arguments, in which case the promise rejects and there is nothing to forward.
39*/
40const forwardDestinationMethods = (promise, destination, pipeFailureSignal) => {
41 if (destination === undefined) {
42 return;
43 }
44
45 forwardReadableMethods(promise, destination);
46 forwardIpcMethods(promise, destination, pipeFailureSignal);
47};
48
49const forwardReadableMethods = (promise, destination) => {
50 const subprocessOptions = SUBPROCESS_OPTIONS.get(destination);

Callers 1

pipeToSubprocessFunction · 0.85

Calls 2

forwardReadableMethodsFunction · 0.85
forwardIpcMethodsFunction · 0.85

Tested by

no test coverage detected