MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / formatScore

Function formatScore

apps/site/scripts/lighthouse/index.mjs:5–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3const stoplight = res => (res >= 90 ? '🟢' : res >= 75 ? '🟠' : '🔴');
4const normalizeScore = res => Math.round(res * 100);
5const formatScore = res => {
6 const normalizedScore = normalizeScore(res);
7 return `${stoplight(normalizedScore)} ${normalizedScore}`;
8};
9
10/**
11 * `core` is in scope from https://github.com/actions/github-script

Callers 1

formatLighthouseResultsFunction · 0.85

Calls 2

normalizeScoreFunction · 0.85
stoplightFunction · 0.85

Tested by

no test coverage detected