* For a type parameter, return the base constraint of the type parameter. For the string, number, * boolean, and symbol primitive types, return the corresponding object types. Otherwise return the * type itself.
(type)
| 59129 | * type itself. |
| 59130 | */ |
| 59131 | function getApparentType(type) { |
| 59132 | var t = !(type.flags & 465829888 /* TypeFlags.Instantiable */) ? type : getBaseConstraintOfType(type) || unknownType; |
| 59133 | return ts.getObjectFlags(t) & 32 /* ObjectFlags.Mapped */ ? getApparentTypeOfMappedType(t) : |
| 59134 | t.flags & 2097152 /* TypeFlags.Intersection */ ? getApparentTypeOfIntersectionType(t) : |
| 59135 | t.flags & 402653316 /* TypeFlags.StringLike */ ? globalStringType : |
| 59136 | t.flags & 296 /* TypeFlags.NumberLike */ ? globalNumberType : |
| 59137 | t.flags & 2112 /* TypeFlags.BigIntLike */ ? getGlobalBigIntType() : |
| 59138 | t.flags & 528 /* TypeFlags.BooleanLike */ ? globalBooleanType : |
| 59139 | t.flags & 12288 /* TypeFlags.ESSymbolLike */ ? getGlobalESSymbolType() : |
| 59140 | t.flags & 67108864 /* TypeFlags.NonPrimitive */ ? emptyObjectType : |
| 59141 | t.flags & 4194304 /* TypeFlags.Index */ ? keyofConstraintType : |
| 59142 | t.flags & 2 /* TypeFlags.Unknown */ && !strictNullChecks ? emptyObjectType : |
| 59143 | t; |
| 59144 | } |
| 59145 | function getReducedApparentType(type) { |
| 59146 | // Since getApparentType may return a non-reduced union or intersection type, we need to perform |
| 59147 | // type reduction both before and after obtaining the apparent type. For example, given a type parameter |
no test coverage detected
searching dependent graphs…