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

Function forwardReadableMethods

lib/pipe/setup.js:49–66  ·  view source on GitHub ↗
(promise, destination)

Source from the content-addressed store, hash-verified

47};
48
49const 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
68const forwardAll = (promise, destination) => {
69 if (destination.all === undefined) {

Callers 1

Calls 2

forwardAllFunction · 0.85

Tested by

no test coverage detected