(stdioItems, optionName, direction, {encoding})
| 11 | ]; |
| 12 | |
| 13 | const getTransforms = (stdioItems, optionName, direction, {encoding}) => { |
| 14 | const transforms = stdioItems.filter(({type}) => TRANSFORM_TYPES.has(type)); |
| 15 | const newTransforms = Array.from({length: transforms.length}); |
| 16 | |
| 17 | for (const [index, stdioItem] of Object.entries(transforms)) { |
| 18 | newTransforms[index] = normalizeTransform({ |
| 19 | stdioItem, |
| 20 | index: Number(index), |
| 21 | newTransforms, |
| 22 | optionName, |
| 23 | direction, |
| 24 | encoding, |
| 25 | }); |
| 26 | } |
| 27 | |
| 28 | return sortTransforms(newTransforms, direction); |
| 29 | }; |
| 30 | |
| 31 | const normalizeTransform = ({stdioItem, stdioItem: {type}, index, newTransforms, optionName, direction, encoding}) => { |
| 32 | if (type === 'duplex') { |
no test coverage detected