@@ -630,10 +630,12 @@ export class DiffFile {
630
630
if ( this . #highlighterType === "class" ) return ;
631
631
632
632
if ( this . #composeByMerge && ! this . #composeByFullMerge) {
633
- __DEV__ &&
633
+ if ( __DEV__ ) {
634
634
console . error (
635
635
`this instance can not do syntax because of the data missing, try to use '_getFullBundle' & '_mergeFullBundle' instead of 'getBundle' & 'mergeBundle'`
636
636
) ;
637
+ }
638
+
637
639
return ;
638
640
}
639
641
@@ -1069,7 +1071,9 @@ export class DiffFile {
1069
1071
}
1070
1072
} else {
1071
1073
if ( current . isLast ) {
1072
- __DEV__ && console . error ( "the last hunk can not expand up!" ) ;
1074
+ if ( __DEV__ ) {
1075
+ console . error ( "the last hunk can not expand up!" ) ;
1076
+ }
1073
1077
return ;
1074
1078
}
1075
1079
for ( let i = current . splitInfo . endHiddenIndex - composeLen ; i < current . splitInfo . endHiddenIndex ; i ++ ) {
@@ -1097,7 +1101,9 @@ export class DiffFile {
1097
1101
this . #splitHunksLines! [ current . splitInfo . endHiddenIndex ] = current ;
1098
1102
}
1099
1103
1100
- needTrigger && this . notifyAll ( ) ;
1104
+ if ( needTrigger ) {
1105
+ this . notifyAll ( ) ;
1106
+ }
1101
1107
} ;
1102
1108
1103
1109
getUnifiedLine = ( index : number ) => {
@@ -1148,7 +1154,9 @@ export class DiffFile {
1148
1154
}
1149
1155
} else {
1150
1156
if ( current . isLast ) {
1151
- __DEV__ && console . error ( "the last hunk can not expand up!" ) ;
1157
+ if ( __DEV__ ) {
1158
+ console . error ( "the last hunk can not expand up!" ) ;
1159
+ }
1152
1160
return ;
1153
1161
}
1154
1162
for ( let i = current . unifiedInfo . endHiddenIndex - composeLen ; i < current . unifiedInfo . endHiddenIndex ; i ++ ) {
@@ -1174,7 +1182,9 @@ export class DiffFile {
1174
1182
this . #unifiedHunksLines! [ current . unifiedInfo . endHiddenIndex ] = current ;
1175
1183
}
1176
1184
1177
- needTrigger && this . notifyAll ( ) ;
1185
+ if ( needTrigger ) {
1186
+ this . notifyAll ( ) ;
1187
+ }
1178
1188
} ;
1179
1189
1180
1190
onAllExpand = ( mode : "split" | "unified" ) => {
@@ -1455,7 +1465,7 @@ export class DiffFile {
1455
1465
_delClonedInstance = ( instance : DiffFile ) => {
1456
1466
const unsubscribe = this . #clonedInstance. get ( instance ) ;
1457
1467
1458
- unsubscribe && unsubscribe ( ) ;
1468
+ unsubscribe ?. ( ) ;
1459
1469
1460
1470
this . #clonedInstance. delete ( instance ) ;
1461
1471
} ;
0 commit comments