File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,13 @@ const findSimilarFiles = (files: Map<string, Buffer>): string[][] => {
1717 const hash = createHash ( 'sha256' ) . update ( content ) . digest ( 'hex' ) ;
1818 const existingFiles = contentComparer . get ( hash ) ;
1919
20- if ( existingFiles ) {
21- existingFiles . push ( filename ) ;
22- } else {
23- contentComparer . set ( hash , [ filename ] ) ;
24- }
20+ if ( existingFiles ) existingFiles . push ( filename ) ;
21+ else contentComparer . set ( hash , [ filename ] ) ;
2522 }
2623
2724 const result : string [ ] [ ] = [ ] ;
2825 for ( const filenames of contentComparer . values ( ) ) {
29- if ( filenames . length > 1 ) {
30- result . push ( filenames ) ;
31- }
26+ if ( filenames . length > 1 ) result . push ( filenames ) ;
3227 }
3328
3429 return result ;
Original file line number Diff line number Diff line change @@ -55,9 +55,7 @@ const formatCompressionLog = (
5555 const ratio = calculateCompressionRatio ( originalSize , compressedSize ) ;
5656 const sizeInfo = `(${ originalSize } -> ${ compressedSize } = ${ ratio } %)` ;
5757
58- if ( useGzip ) {
59- return greenLog ( ` [${ filename } ] ${ padding } ✓ gzip used ${ sizeInfo } ` ) ;
60- }
58+ if ( useGzip ) return greenLog ( ` [${ filename } ] ${ padding } ✓ gzip used ${ sizeInfo } ` ) ;
6159
6260 const tooSmall = originalSize <= GZIP_MIN_SIZE ? '(too small) ' : '' ;
6361 return yellowLog ( ` [${ filename } ] ${ padding } x gzip unused ${ tooSmall } ${ sizeInfo } ` ) ;
@@ -90,11 +88,8 @@ const createSourceEntry = (
9088 */
9189const updateExtensionGroup = ( extension : string ) : void => {
9290 const group = filesByExtension . find ( ( fe ) => fe . extension === extension ) ;
93- if ( group ) {
94- group . count += 1 ;
95- } else {
96- filesByExtension . push ( { extension, count : 1 } ) ;
97- }
91+ if ( group ) group . count += 1 ;
92+ else filesByExtension . push ( { extension, count : 1 } ) ;
9893} ;
9994
10095console . log ( 'Collecting source files' ) ;
You can’t perform that action at this time.
0 commit comments