MCPcopy Index your code
hub / github.com/nodejs/node / getConstraintFromIndexedAccess

Function getConstraintFromIndexedAccess

test/fixtures/snapshot/typescript.js:58830–58848  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

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,

Callers 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…