File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 11const GITHUB_TOKEN = process . env . GITHUB_TOKEN ! ;
22const API_URL = "https://api.github.com/graphql" ;
33
4- export async function fetchStars (
5- resources : { slug : string ; stars ?: number } [ ] ,
6- ) {
4+ export async function fetchStars ( resources : { slug : string ; stars ?: number } [ ] ) {
75 try {
86 if ( resources . length === 0 ) return ;
97 const uniqueSlugs = Array . from (
@@ -13,8 +11,8 @@ export async function fetchStars(
1311 . map ( ( r , id ) => ( {
1412 id,
1513 slug : r . slug ,
16- } ) ) ,
17- ) ,
14+ } ) )
15+ )
1816 ) ;
1917
2018 if ( uniqueSlugs . length === 0 ) return ;
@@ -40,7 +38,7 @@ export async function fetchStars(
4038
4139 if ( res . status > 400 ) {
4240 console . error (
43- "Failed to fetch GitHub stars. Make sure you are providing a valid GITHUB_TOKEN in packages/docs/.env" ,
41+ "Failed to fetch GitHub stars. Make sure you are providing a valid GITHUB_TOKEN in packages/docs/.env"
4442 ) ;
4543 if ( process . env . NODE_ENV === "production" ) {
4644 throw new Error ( "Failed to fetch GitHub stars." ) ;
You can’t perform that action at this time.
0 commit comments