()
| 168 | } |
| 169 | |
| 170 | function loadContrastAuditScript(): string { |
| 171 | const candidates = [ |
| 172 | join(__dirname, "contrast-audit.browser.js"), |
| 173 | join(__dirname, "commands", "contrast-audit.browser.js"), |
| 174 | ]; |
| 175 | |
| 176 | for (const candidate of candidates) { |
| 177 | if (existsSync(candidate)) return readFileSync(candidate, "utf-8"); |
| 178 | } |
| 179 | |
| 180 | throw new Error("Missing contrast audit browser script"); |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * Pull the `missing_or_empty_sub_composition` lint findings out of a |