From c1e2858330a03f140fb0b3e8152f485928056e98 Mon Sep 17 00:00:00 2001 From: Zohan Subhash Date: Tue, 17 Jan 2023 15:47:39 +0530 Subject: [PATCH] Update repo-card.js --- src/cards/repo-card.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/cards/repo-card.js b/src/cards/repo-card.js index 1c86b8d2..8d63f889 100644 --- a/src/cards/repo-card.js +++ b/src/cards/repo-card.js @@ -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");