@@ -12,26 +12,24 @@ dotenv.config({
1212} ) ;
1313
1414const credential = JSON . parse (
15- Buffer . from ( process . env . FIREBASE_APP_SERVICE_KEY , "base64" ) . toString (
16- ENCODING ,
17- ) ,
15+ Buffer . from ( process . env . FIREBASE_APP_SERVICE_KEY , "base64" ) . toString ( ENCODING )
1816) ;
1917
2018const definitions = await fs . readFile ( "../libraries.json" , ENCODING ) ;
2119const definitionsJSON = JSON . parse ( definitions ) ;
2220
2321async function fetchDirectoryData ( libraries ) {
2422 return Promise . all (
25- libraries . map ( async ( lib ) => {
23+ libraries . map ( async lib => {
2624 const packageName = getCleanPackageName ( lib ) ;
2725 try {
2826 const response = await fetch (
29- `https://reactnative.directory/api/libraries?search=${ packageName } ` ,
27+ `https://reactnative.directory/api/libraries?search=${ packageName } `
3028 ) ;
3129
3230 if ( ! response . ok ) {
3331 throw new Error (
34- `❌ HTTP ${ response . status } - Cannot fetch directory data for ${ packageName } ` ,
32+ `❌ HTTP ${ response . status } - Cannot fetch directory data for ${ packageName } `
3533 ) ;
3634 }
3735
@@ -41,7 +39,7 @@ async function fetchDirectoryData(libraries) {
4139 console . error ( error ) ;
4240 process . exit ( 1 ) ;
4341 }
44- } ) ,
42+ } )
4543 ) ;
4644}
4745
@@ -63,7 +61,7 @@ async function main() {
6361
6462 const tableDataMap = new Map ( ) ;
6563 const trimmedData = Object . entries ( data [ "nightly-results" ] ) . slice (
66- - DAYS_TO_SHOW ,
64+ - DAYS_TO_SHOW
6765 ) ;
6866
6967 for ( const [ date , entries ] of trimmedData ) {
@@ -78,13 +76,13 @@ async function main() {
7876 const directoryData = await fetchDirectoryData (
7977 installCommand . includes ( " " )
8078 ? installCommand . split ( " " )
81- : [ installCommand ] ,
79+ : [ installCommand ]
8280 ) ;
8381 const cleanDirectoryData = directoryData . filter ( Boolean ) ;
8482
8583 if ( cleanDirectoryData . length > 0 ) {
8684 const repositoryURLs = Object . fromEntries (
87- cleanDirectoryData . map ( ( lib ) => [ lib . npmPkg , lib . githubUrl ] ) ,
85+ cleanDirectoryData . map ( lib => [ lib . npmPkg , lib . githubUrl ] )
8886 ) ;
8987
9088 tableDataMap . set ( library , {
@@ -116,7 +114,7 @@ async function main() {
116114 }
117115
118116 const sortedData = Array . from ( tableDataMap . values ( ) ) . sort ( ( a , b ) =>
119- a . installCommand . localeCompare ( b . installCommand ) ,
117+ a . installCommand . localeCompare ( b . installCommand )
120118 ) ;
121119
122120 const outPath = path . resolve ( "public/data.json" ) ;
@@ -126,7 +124,7 @@ async function main() {
126124 process . exit ( 0 ) ;
127125}
128126
129- main ( ) . catch ( ( error ) => {
127+ main ( ) . catch ( error => {
130128 console . error ( "❌ Error exporting data:" , error ) ;
131129 process . exit ( 1 ) ;
132130} ) ;
0 commit comments