Skip to content

Commit 343572e

Browse files
committed
Rename isWeak -> isWeakType
1 parent f9a05a1 commit 343572e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8996,7 +8996,7 @@ namespace ts {
89968996
}
89978997

89988998
function reportAssignmentToWeakIntersection(source: Type, target: IntersectionType, reportErrors: boolean) {
8999-
const needsWeakTypeCheck = source !== globalObjectType && getPropertiesOfType(source).length > 0 && every(target.types, isWeak);
8999+
const needsWeakTypeCheck = source !== globalObjectType && getPropertiesOfType(source).length > 0 && every(target.types, isWeakType);
90009000
if (!needsWeakTypeCheck) {
90019001
return false;
90029002
}
@@ -9296,7 +9296,7 @@ namespace ts {
92969296
let result = Ternary.True;
92979297
const properties = getPropertiesOfObjectType(target);
92989298
const requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & ObjectFlags.ObjectLiteral);
9299-
let foundMatchingProperty = !isWeak(target);
9299+
let foundMatchingProperty = !isWeakType(target);
93009300
for (const targetProp of properties) {
93019301
const sourceProp = getPropertyOfType(source, targetProp.name);
93029302
if (sourceProp) {
@@ -9394,7 +9394,7 @@ namespace ts {
93949394
* A type is 'weak' if it is an object type with at least one optional property
93959395
* and no required properties, call/construct signatures or index signatures
93969396
*/
9397-
function isWeak(type: Type) {
9397+
function isWeakType(type: Type) {
93989398
const props = getPropertiesOfType(type);
93999399
return type.flags & TypeFlags.Object &&
94009400
props.length > 0 &&

0 commit comments

Comments
 (0)