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

Function scoreTargetIcon

packages/utils/src/lib/reports/utils.ts:314–337  ·  view source on GitHub ↗
(
  score: number,
  scoreTarget?: number,
  options: {
    passIcon?: string;
    failIcon?: string;
    prefix?: string;
    postfix?: string;
  } = {},
)

Source from the content-addressed store, hash-verified

312}
313
314export function scoreTargetIcon(
315 score: number,
316 scoreTarget?: number,
317 options: {
318 passIcon?: string;
319 failIcon?: string;
320 prefix?: string;
321 postfix?: string;
322 } = {},
323): string {
324 if (scoreTarget != null) {
325 const {
326 passIcon = '✅',
327 failIcon = '❌',
328 prefix = '',
329 postfix = '',
330 } = options;
331 if (score >= scoreTarget) {
332 return `${prefix}${passIcon}${postfix}`;
333 }
334 return `${prefix}${failIcon}${postfix}`;
335 }
336 return '';
337}

Callers 3

binaryIconSuffixFunction · 0.85
binaryIconPrefixFunction · 0.85
utils.unit.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected