Skip to content

Commit

Permalink
fix: improved comment layout with more colors ;-)
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll committed Feb 21, 2023
1 parent 5ec5ef9 commit 4359fc6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import { b, fragment, table, tbody, tr, th } from "./html.js";
import { percentage } from "./lcov.js";
import { LvocList } from "./app.js";

/**
* Compares two arrays of objects and returns with unique lines update
* @param {number} pdiff value from diff percentage
* @returns {string} emoji string for negative/positive pdiff
*/
const renderEmoji = (pdiff: number) => {
if (pdiff < 0) return "❌";
if (pdiff < 0.01) return ":x:";

if (pdiff > 0.01) return ":heavy_check_mark:";

return "";
return ":white_check_mark:";
};

/**
Expand Down Expand Up @@ -52,6 +49,7 @@ export const generateDiffForMonorepo = (
plus,
pdiff.toFixed(2),
"%",
pdiff > 10 ? " :green_heart:" : "",
)
: th(" N/A ");

Expand Down

0 comments on commit 4359fc6

Please sign in to comment.