Update repo-card.js

This commit is contained in:
Zohan Subhash
2023-01-17 15:47:39 +05:30
committed by GitHub
parent 01f726c316
commit c1e2858330
+14 -3
View File
@@ -151,9 +151,20 @@ const renderRepoCard = (repo, options = {}) => {
const svgLanguage = primaryLanguage
? createLanguageNode(langName, langColor)
: "";
const totalStars = kFormatter(starCount);
const totalForks = kFormatter(forkCount);
let totalStars
let totalForks
if (isNaN(starCount)) {
totalStars = starCount;
} else {
totalStars = kFormatter(starCount);
}
if (isNaN(forkCount)) {
totalForks = forkCount;
} else {
totalForks = kFormatter(forkCount);
}
const svgStars = iconWithLabel(icons.star, totalStars, "stargazers");
const svgForks = iconWithLabel(icons.fork, totalForks, "forkcount");