MCPcopy Create free account
hub / github.com/code-pushup/cli / enrichFlags

Function enrichFlags

packages/plugin-lighthouse/src/lib/runner/utils.ts:179–197  ·  view source on GitHub ↗
(
  flags: LighthouseCliFlags,
  urlIndex?: number,
)

Source from the content-addressed store, hash-verified

177}
178
179export 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.

Callers 2

createRunnerFunctionFunction · 0.85
utils.unit.test.tsFile · 0.85

Calls 1

determineAndSetLogLevelFunction · 0.85

Tested by

no test coverage detected