File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ export function discoverTitles(inputDir: string): number[] {
9595 return readdirSync ( inputDir )
9696 . map ( ( name ) => USC_XML_RE . exec ( name ) )
9797 . filter ( ( m ) : m is RegExpExecArray => m !== null )
98- . map ( ( m ) => parseInt ( m [ 1 ] ! , 10 ) )
98+ . map ( ( m ) => parseInt ( m [ 1 ] ?? "0" , 10 ) )
9999 . sort ( ( a , b ) => a - b ) ;
100100}
101101
Original file line number Diff line number Diff line change @@ -338,8 +338,8 @@ function extractAllXmlFromZip(
338338 zipFile . on ( "entry" , ( entry : Entry ) => {
339339 const match = USC_XML_RE . exec ( entry . fileName ) ;
340340 if ( match ) {
341- const titleNum = parseInt ( match [ 1 ] ! , 10 ) ;
342- const outPath = join ( outputDir , `usc${ match [ 1 ] ! } .xml` ) ;
341+ const titleNum = parseInt ( match [ 1 ] ?? "0" , 10 ) ;
342+ const outPath = join ( outputDir , `usc${ match [ 1 ] ?? "00" } .xml` ) ;
343343 pending ++ ;
344344
345345 extractEntry ( zipFile , entry , outPath )
You can’t perform that action at this time.
0 commit comments