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

Function colorByScoreDiff

packages/utils/src/lib/reports/utils.ts:86–89  ·  view source on GitHub ↗
(text: string, diff: number)

Source from the content-addressed store, hash-verified

84}
85
86export function colorByScoreDiff(text: string, diff: number): InlineText {
87 const color = diff > 0 ? 'green' : diff < 0 ? 'red' : 'gray';
88 return shieldsBadge(text, color);
89}
90
91export function shieldsBadge(text: string, color: string): InlineText {
92 return md.image(

Callers 3

formatScoreChangeFunction · 0.85
formatValueChangeFunction · 0.85
utils.unit.test.tsFile · 0.85

Calls 1

shieldsBadgeFunction · 0.85

Tested by

no test coverage detected