( required: string, executor?: CommandExecutor, )
| 193 | * If AXe is missing or the version cannot be parsed, returns false. |
| 194 | */ |
| 195 | export async function isAxeAtLeastVersion( |
| 196 | required: string, |
| 197 | executor?: CommandExecutor, |
| 198 | ): Promise<boolean> { |
| 199 | const axePath = getAxePath(); |
| 200 | if (!axePath) return false; |
| 201 | |
| 202 | const exec = executor ?? getDefaultCommandExecutor(); |
| 203 | try { |
| 204 | const res = await exec([axePath, '--version'], 'AXe Version', true); |
| 205 | if (!res.success) return false; |
| 206 | |
| 207 | const output = res.output ?? ''; |
| 208 | const versionMatch = output.match(/(\d+\.\d+\.\d+)/); |
| 209 | if (!versionMatch) return false; |
| 210 | |
| 211 | const current = versionMatch[1]; |
| 212 | return compareSemver(current, required) >= 0; |
| 213 | } catch { |
| 214 | return false; |
| 215 | } |
| 216 | } |
nothing calls this directly
no test coverage detected