({stdioOption, fdNumber, options, isSync})
| 37 | }; |
| 38 | |
| 39 | const getFileDescriptor = ({stdioOption, fdNumber, options, isSync}) => { |
| 40 | const optionName = getStreamName(fdNumber); |
| 41 | const {stdioItems: initialStdioItems, isStdioArray} = initializeStdioItems({ |
| 42 | stdioOption, |
| 43 | fdNumber, |
| 44 | options, |
| 45 | optionName, |
| 46 | }); |
| 47 | const direction = getStreamDirection(initialStdioItems, fdNumber, optionName); |
| 48 | const stdioItems = initialStdioItems.map(stdioItem => handleNativeStream({ |
| 49 | stdioItem, |
| 50 | isStdioArray, |
| 51 | fdNumber, |
| 52 | direction, |
| 53 | isSync, |
| 54 | })); |
| 55 | const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options); |
| 56 | const objectMode = getFdObjectMode(normalizedStdioItems, direction); |
| 57 | validateFileObjectMode(normalizedStdioItems, objectMode); |
| 58 | return {direction, objectMode, stdioItems: normalizedStdioItems}; |
| 59 | }; |
| 60 | |
| 61 | // We make sure passing an array with a single item behaves the same as passing that item without an array. |
| 62 | // This is what users would expect. |
no test coverage detected