@@ -378,13 +378,14 @@ class Chunk {
378378 otherChunk . _groups . clear ( ) ;
379379
380380 if ( this . name && otherChunk . name ) {
381- if ( this . name . length !== otherChunk . name . length )
381+ if ( this . name . length !== otherChunk . name . length ) {
382382 this . name =
383383 this . name . length < otherChunk . name . length
384384 ? this . name
385385 : otherChunk . name ;
386- else
386+ } else {
387387 this . name = this . name < otherChunk . name ? this . name : otherChunk . name ;
388+ }
388389 }
389390
390391 return true ;
@@ -420,12 +421,16 @@ class Chunk {
420421 for ( const chunkGroup of queue ) {
421422 if ( a . isInGroup ( chunkGroup ) ) continue ;
422423 if ( chunkGroup . isInitial ( ) ) return false ;
423- for ( const parent of chunkGroup . parentsIterable ) queue . add ( parent ) ;
424+ for ( const parent of chunkGroup . parentsIterable ) {
425+ queue . add ( parent ) ;
426+ }
424427 }
425428 return true ;
426429 } ;
427430
428- if ( this . preventIntegration || otherChunk . preventIntegration ) return false ;
431+ if ( this . preventIntegration || otherChunk . preventIntegration ) {
432+ return false ;
433+ }
429434
430435 if ( this . hasRuntime ( ) !== otherChunk . hasRuntime ( ) ) {
431436 if ( this . hasRuntime ( ) ) {
@@ -436,7 +441,11 @@ class Chunk {
436441 return false ;
437442 }
438443 }
439- if ( this . hasEntryModule ( ) || otherChunk . hasEntryModule ( ) ) return false ;
444+
445+ if ( this . hasEntryModule ( ) || otherChunk . hasEntryModule ( ) ) {
446+ return false ;
447+ }
448+
440449 return true ;
441450 }
442451
@@ -509,14 +518,20 @@ class Chunk {
509518 ) ;
510519
511520 for ( const chunkGroup of this . groupsIterable ) {
512- for ( const child of chunkGroup . childrenIterable ) queue . add ( child ) ;
521+ for ( const child of chunkGroup . childrenIterable ) {
522+ queue . add ( child ) ;
523+ }
513524 }
514525
515526 for ( const chunkGroup of queue ) {
516527 for ( const chunk of chunkGroup . chunks ) {
517- if ( ! initialChunks . has ( chunk ) ) chunks . add ( chunk ) ;
528+ if ( ! initialChunks . has ( chunk ) ) {
529+ chunks . add ( chunk ) ;
530+ }
531+ }
532+ for ( const child of chunkGroup . childrenIterable ) {
533+ queue . add ( child ) ;
518534 }
519- for ( const child of chunkGroup . childrenIterable ) queue . add ( child ) ;
520535 }
521536
522537 return chunks ;
@@ -530,11 +545,14 @@ class Chunk {
530545 for ( const chunk of this . getAllAsyncChunks ( ) ) {
531546 chunkHashMap [ chunk . id ] = realHash ? chunk . hash : chunk . renderedHash ;
532547 for ( const key of Object . keys ( chunk . contentHash ) ) {
533- if ( ! chunkContentHashMap [ key ] )
548+ if ( ! chunkContentHashMap [ key ] ) {
534549 chunkContentHashMap [ key ] = Object . create ( null ) ;
550+ }
535551 chunkContentHashMap [ key ] [ chunk . id ] = chunk . contentHash [ key ] ;
536552 }
537- if ( chunk . name ) chunkNameMap [ chunk . id ] = chunk . name ;
553+ if ( chunk . name ) {
554+ chunkNameMap [ chunk . id ] = chunk . name ;
555+ }
538556 }
539557
540558 return {
@@ -572,12 +590,16 @@ class Chunk {
572590 const cmp = b . order - a . order ;
573591 if ( cmp !== 0 ) return cmp ;
574592 // TOOD webpack 5 remove this check of compareTo
575- if ( a . group . compareTo ) return a . group . compareTo ( b . group ) ;
593+ if ( a . group . compareTo ) {
594+ return a . group . compareTo ( b . group ) ;
595+ }
576596 return 0 ;
577597 } ) ;
578598 result [ name ] = Array . from (
579599 list . reduce ( ( set , item ) => {
580- for ( const chunk of item . group . chunks ) set . add ( chunk . id ) ;
600+ for ( const chunk of item . group . chunks ) {
601+ set . add ( chunk . id ) ;
602+ }
581603 return set ;
582604 } , new Set ( ) )
583605 ) ;
@@ -592,8 +614,9 @@ class Chunk {
592614 const data = chunk . getChildIdsByOrders ( ) ;
593615 for ( const key of Object . keys ( data ) ) {
594616 let chunkMap = chunkMaps [ key ] ;
595- if ( chunkMap === undefined )
617+ if ( chunkMap === undefined ) {
596618 chunkMaps [ key ] = chunkMap = Object . create ( null ) ;
619+ }
597620 chunkMap [ chunk . id ] = data [ key ] ;
598621 }
599622 }
@@ -642,12 +665,17 @@ class Chunk {
642665 if ( ! chunksProcessed . has ( chunk ) ) {
643666 chunksProcessed . add ( chunk ) ;
644667 if ( ! filterChunkFn || filterChunkFn ( chunk ) ) {
645- for ( const module of chunk . modulesIterable )
646- if ( filterFn ( module ) ) return true ;
668+ for ( const module of chunk . modulesIterable ) {
669+ if ( filterFn ( module ) ) {
670+ return true ;
671+ }
672+ }
647673 }
648674 }
649675 }
650- for ( const child of chunkGroup . childrenIterable ) queue . add ( child ) ;
676+ for ( const child of chunkGroup . childrenIterable ) {
677+ queue . add ( child ) ;
678+ }
651679 }
652680 return false ;
653681 }
0 commit comments