()
| 20 | }; |
| 21 | |
| 22 | export 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 | |
| 38 | export const decodeLabel = label => |
| 39 | label |
no test coverage detected