(type)
| 58828 | return simplified !== type ? simplified : getConstraintOfType(type); |
| 58829 | } |
| 58830 | function getConstraintFromIndexedAccess(type) { |
| 58831 | if (isMappedTypeGenericIndexedAccess(type)) { |
| 58832 | // For indexed access types of the form { [P in K]: E }[X], where K is non-generic and X is generic, |
| 58833 | // we substitute an instantiation of E where P is replaced with X. |
| 58834 | return substituteIndexedMappedType(type.objectType, type.indexType); |
| 58835 | } |
| 58836 | var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); |
| 58837 | if (indexConstraint && indexConstraint !== type.indexType) { |
| 58838 | var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.accessFlags); |
| 58839 | if (indexedAccess) { |
| 58840 | return indexedAccess; |
| 58841 | } |
| 58842 | } |
| 58843 | var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); |
| 58844 | if (objectConstraint && objectConstraint !== type.objectType) { |
| 58845 | return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.accessFlags); |
| 58846 | } |
| 58847 | return undefined; |
| 58848 | } |
| 58849 | function getDefaultConstraintOfConditionalType(type) { |
| 58850 | if (!type.resolvedDefaultConstraint) { |
| 58851 | // An `any` branch of a conditional type would normally be viral - specifically, without special handling here, |
no test coverage detected
searching dependent graphs…