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

Function formatBaseAuditOutput

packages/plugin-lighthouse/src/lib/runner/utils.ts:41–63  ·  view source on GitHub ↗
(lhrAudit: Result)

Source from the content-addressed store, hash-verified

39}
40
41function formatBaseAuditOutput(lhrAudit: Result): AuditOutput {
42 const {
43 id: slug,
44 score,
45 numericValue,
46 displayValue,
47 scoreDisplayMode,
48 } = lhrAudit;
49 return {
50 slug,
51 score: score ?? 1,
52 value: numericValue ?? score ?? 0,
53 displayValue:
54 displayValue ??
55 (scoreDisplayMode === 'binary'
56 ? score === 1
57 ? 'passed'
58 : 'failed'
59 : score
60 ? `${formatReportScore(score)}%`
61 : undefined),
62 };
63}
64
65function processAuditDetails(
66 auditOutput: AuditOutput,

Callers 1

toAuditOutputsFunction · 0.85

Calls 1

formatReportScoreFunction · 0.90

Tested by

no test coverage detected