( flags: LighthouseCliFlags, urlIndex?: number, )
| 177 | } |
| 178 | |
| 179 | export function enrichFlags( |
| 180 | flags: LighthouseCliFlags, |
| 181 | urlIndex?: number, |
| 182 | ): LighthouseOptions { |
| 183 | const { outputPath, ...parsedFlags }: Partial<LighthouseCliFlags> = flags; |
| 184 | |
| 185 | const logLevel = determineAndSetLogLevel(parsedFlags); |
| 186 | |
| 187 | const urlSpecificOutputPath = |
| 188 | urlIndex && outputPath |
| 189 | ? outputPath.replace(/(\.[^.]+)?$/, `-${urlIndex}$1`) |
| 190 | : outputPath; |
| 191 | |
| 192 | return { |
| 193 | ...parsedFlags, |
| 194 | logLevel, |
| 195 | outputPath: urlSpecificOutputPath, |
| 196 | }; |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Wraps Lighthouse runner with `TEMP` directory override for Windows, to prevent permissions error on cleanup. |
no test coverage detected