Transform 'keyof (A | B)' to 'keyof A & keyof B'
This commit is contained in:
parent
fc30bd10e3
commit
09590bc041
1 changed files with 2 additions and 1 deletions
|
@ -8268,7 +8268,8 @@ namespace ts {
|
|||
}
|
||||
|
||||
function getIndexType(type: Type, stringsOnly = keyofStringsOnly): Type {
|
||||
return type.flags & TypeFlags.Intersection ? getUnionType(map((<IntersectionType>type).types, t => getIndexType(t, stringsOnly))) :
|
||||
return type.flags & TypeFlags.Union ? getIntersectionType(map((<IntersectionType>type).types, t => getIndexType(t, stringsOnly))) :
|
||||
type.flags & TypeFlags.Intersection ? getUnionType(map((<IntersectionType>type).types, t => getIndexType(t, stringsOnly))) :
|
||||
maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(<InstantiableType | UnionOrIntersectionType>type, stringsOnly) :
|
||||
getObjectFlags(type) & ObjectFlags.Mapped ? getConstraintTypeFromMappedType(<MappedType>type) :
|
||||
type === wildcardType ? wildcardType :
|
||||
|
|
Loading…
Reference in a new issue