* Finds the index of the first pipe operator in parsed shell command
(parsed: ParseEntry[])
| 103 | * Finds the index of the first pipe operator in parsed shell command |
| 104 | */ |
| 105 | function findFirstPipeOperator(parsed: ParseEntry[]): number { |
| 106 | for (let i = 0; i < parsed.length; i++) { |
| 107 | const entry = parsed[i] |
| 108 | if (isOperator(entry, '|')) { |
| 109 | return i |
| 110 | } |
| 111 | } |
| 112 | return -1 |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Builds command parts from parsed entries, handling strings and operators. |
no test coverage detected