From 343572e5cc2eeabf7059d7f1ae8e1c0b05f6ae1c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 1 Jun 2017 09:30:41 -0700 Subject: [PATCH] Rename isWeak -> isWeakType --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c25ec01fbff..04b89618216 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8996,7 +8996,7 @@ namespace ts { } function reportAssignmentToWeakIntersection(source: Type, target: IntersectionType, reportErrors: boolean) { - const needsWeakTypeCheck = source !== globalObjectType && getPropertiesOfType(source).length > 0 && every(target.types, isWeak); + const needsWeakTypeCheck = source !== globalObjectType && getPropertiesOfType(source).length > 0 && every(target.types, isWeakType); if (!needsWeakTypeCheck) { return false; } @@ -9296,7 +9296,7 @@ namespace ts { let result = Ternary.True; const properties = getPropertiesOfObjectType(target); const requireOptionalProperties = relation === subtypeRelation && !(getObjectFlags(source) & ObjectFlags.ObjectLiteral); - let foundMatchingProperty = !isWeak(target); + let foundMatchingProperty = !isWeakType(target); for (const targetProp of properties) { const sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp) { @@ -9394,7 +9394,7 @@ namespace ts { * A type is 'weak' if it is an object type with at least one optional property * and no required properties, call/construct signatures or index signatures */ - function isWeak(type: Type) { + function isWeakType(type: Type) { const props = getPropertiesOfType(type); return type.flags & TypeFlags.Object && props.length > 0 &&