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

Function getFdObjectMode

lib/transform/object-mode.js:32–41  ·  view source on GitHub ↗
(stdioItems, direction)

Source from the content-addressed store, hash-verified

30
31// Retrieve the `objectMode` of a file descriptor, e.g. `stdout` or `stderr`
32export const getFdObjectMode = (stdioItems, direction) => {
33 const lastTransform = stdioItems.findLast(({type}) => TRANSFORM_TYPES.has(type));
34 if (lastTransform === undefined) {
35 return false;
36 }
37
38 return direction === 'input'
39 ? lastTransform.value.writableObjectMode
40 : lastTransform.value.readableObjectMode;
41};

Callers 1

getFileDescriptorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected