@@ -43,7 +43,9 @@ print('Extracted nodes.dmp')
4343 )
4444}
4545
46- async function buildChildrenMap ( filePath : string ) : Promise < Map < number , number [ ] > > {
46+ async function buildChildrenMap (
47+ filePath : string ,
48+ ) : Promise < Map < number , number [ ] > > {
4749 const childrenMap = new Map < number , number [ ] > ( )
4850 const rl = readline . createInterface ( {
4951 input : fs . createReadStream ( filePath ) ,
@@ -93,12 +95,20 @@ function collectDescendants(
9395
9496ensureNodesDmp ( )
9597
96- const searchIndex = JSON . parse (
97- fs . readFileSync ( SEARCH_INDEX_PATH , 'utf-8' ) ,
98- ) as [ string , string , string , string , string , string , number ] [ ]
98+ const searchIndex = JSON . parse ( fs . readFileSync ( SEARCH_INDEX_PATH , 'utf-8' ) ) as [
99+ string ,
100+ string ,
101+ string ,
102+ string ,
103+ string ,
104+ string ,
105+ number ,
106+ ] [ ]
99107
100108const indexTaxonIds = new Set ( searchIndex . map ( e => e [ 6 ] ) . filter ( id => id > 0 ) )
101- console . log ( `Search index: ${ searchIndex . length } entries, ${ indexTaxonIds . size } unique taxonIds` )
109+ console . log (
110+ `Search index: ${ searchIndex . length } entries, ${ indexTaxonIds . size } unique taxonIds` ,
111+ )
102112
103113console . log ( 'Parsing nodes.dmp...' )
104114const childrenMap = await buildChildrenMap ( NODES_DMP_PATH )
@@ -114,7 +124,9 @@ for (const { label, taxonId } of CURATED_CLADES) {
114124 }
115125 }
116126 result [ label ] = members
117- console . log ( ` ${ label } (taxonId ${ taxonId } ): ${ members . length } matching taxonIds` )
127+ console . log (
128+ ` ${ label } (taxonId ${ taxonId } ): ${ members . length } matching taxonIds` ,
129+ )
118130}
119131
120132fs . writeFileSync ( OUTPUT_PATH , JSON . stringify ( result ) )
0 commit comments