MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / getStarsCount

Function getStarsCount

src/utils/utils.js:22–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20};
21
22export const getStarsCount = async () => {
23 try {
24 const response = await fetch('https://api.github.com/repos/DavidHDev/react-bits');
25 const data = await response.json();
26
27 if (typeof data.stargazers_count !== 'number') {
28 return null;
29 }
30
31 return String(formatNumber(data.stargazers_count)).toUpperCase();
32 } catch (error) {
33 console.error('Error fetching stargazers count:', error);
34 return null;
35 }
36};
37
38export const decodeLabel = label =>
39 label

Callers 1

fetchStarsFunction · 0.90

Calls 1

formatNumberFunction · 0.85

Tested by

no test coverage detected