| 73 | }; |
| 74 | |
| 75 | const getStandardStreamDirection = value => { |
| 76 | if ([0, process.stdin].includes(value)) { |
| 77 | return 'input'; |
| 78 | } |
| 79 | |
| 80 | if ([1, 2, process.stdout, process.stderr].includes(value)) { |
| 81 | return 'output'; |
| 82 | } |
| 83 | }; |
| 84 | |
| 85 | // When ambiguous, we initially keep the direction as `undefined`. |
| 86 | // This allows arrays of `stdio` values to resolve the ambiguity. |