Merge pull request #31002 from Microsoft/fixIsStringIndexSignatureOnlyType

Fix isStringIndexSignatureOnlyType function
This commit is contained in:
Anders Hejlsberg authored and GitHub committed 2019-04-17 17:19:34 -07:00
commit 33c3ce9cd0
6 files changed
+82 -1

No files matched your search

+1 -1
View File
@@ -12049,7 +12049,7 @@ namespace ts {
}
function isStringIndexSignatureOnlyType(type: Type): boolean {
return type.flags & TypeFlags.Object && getPropertiesOfType(type).length === 0 && getIndexInfoOfType(type, IndexKind.String) && !getIndexInfoOfType(type, IndexKind.Number) ||
return type.flags & TypeFlags.Object && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfoOfType(type, IndexKind.String) && !getIndexInfoOfType(type, IndexKind.Number) ||
type.flags & TypeFlags.UnionOrIntersection && every((<UnionOrIntersectionType>type).types, isStringIndexSignatureOnlyType) ||
false;
}