File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -947,22 +947,19 @@ namespace ts.codefix {
947
947
948
948
function allPropertiesAreAssignableToUsage ( type : Type , usage : Usage ) {
949
949
if ( ! usage . properties ) return false ;
950
- let result = true ;
951
- usage . properties . forEach ( ( propUsage , name ) => {
950
+ return ! forEachEntry ( usage . properties , ( propUsage , name ) => {
952
951
const source = checker . getTypeOfPropertyOfType ( type , name as string ) ;
953
952
if ( ! source ) {
954
- result = false ;
955
- return ;
953
+ return true ;
956
954
}
957
955
if ( propUsage . calls ) {
958
956
const sigs = checker . getSignaturesOfType ( source , SignatureKind . Call ) ;
959
- result = result && ! ! sigs . length && checker . isTypeAssignableTo ( source , getFunctionFromCalls ( propUsage . calls ) ) ;
957
+ return ! sigs . length || ! checker . isTypeAssignableTo ( source , getFunctionFromCalls ( propUsage . calls ) ) ;
960
958
}
961
959
else {
962
- result = result && checker . isTypeAssignableTo ( source , combineFromUsage ( propUsage ) ) ;
960
+ return ! checker . isTypeAssignableTo ( source , combineFromUsage ( propUsage ) ) ;
963
961
}
964
962
} ) ;
965
- return result ;
966
963
}
967
964
968
965
/**
You can’t perform that action at this time.
0 commit comments