(left: readonly number[], right: readonly number[])
| 168 | } |
| 169 | |
| 170 | function compareVersion(left: readonly number[], right: readonly number[]): number { |
| 171 | const length = Math.max(left.length, right.length) |
| 172 | for (let index = 0; index < length; index += 1) { |
| 173 | const leftValue = left[index] ?? 0 |
| 174 | const rightValue = right[index] ?? 0 |
| 175 | if (leftValue !== rightValue) { |
| 176 | return leftValue - rightValue |
| 177 | } |
| 178 | } |
| 179 | return 0 |
| 180 | } |
| 181 | |
| 182 | function parsePythonVersion(stdout: string): number[] | null { |
| 183 | const match = stdout.trim().match(/^(\d+)\.(\d+)\.(\d+)/) |
no test coverage detected