Skip to content

Commit 65ba25e

Browse files
aidenybaiamiagent
andcommitted
simplify doctor face to single-line emoticon
Generated with [Ami](https://ami.dev) Co-Authored-By: Ami <noreply@ami.dev>
1 parent 7aa7b3f commit 65ba25e

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

packages/react-doctor/src/scan.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,26 +159,21 @@ const printScoreGauge = (score: number, label: string): void => {
159159
logger.break();
160160
};
161161

162-
const getDocterFace = (score: number): string[] => {
163-
if (score >= SCORE_GOOD_THRESHOLD) {
164-
return [" ┌─────┐", " │ ◠ ◠ │", " │ ▽ │", " └─────┘"];
165-
}
166-
if (score >= SCORE_OK_THRESHOLD) {
167-
return [" ┌─────┐", " │ • • │", " │ ─ │", " └─────┘"];
168-
}
169-
return [" ┌─────┐", " │ x x │", " │ ▽ │", " └─────┘"];
162+
const getDoctorFace = (score: number): string => {
163+
if (score >= SCORE_GOOD_THRESHOLD) return "◠‿◠";
164+
if (score >= SCORE_OK_THRESHOLD) return "•_•";
165+
return "x_x";
170166
};
171167

172168
const printBranding = (score?: number): void => {
173169
logger.break();
174170
if (score !== undefined) {
175-
const face = getDocterFace(score);
176-
for (const line of face) {
177-
logger.log(colorizeByScore(line, score));
178-
}
179-
logger.break();
171+
logger.log(
172+
` ${colorizeByScore(getDoctorFace(score), score)} ${highlighter.dim("React Doctor (www.react.doctor)")}`,
173+
);
174+
} else {
175+
logger.dim(" React Doctor (www.react.doctor)");
180176
}
181-
logger.dim(" React Doctor (www.react.doctor)");
182177
};
183178

184179
const printSummary = (

0 commit comments

Comments
 (0)