(source, target, isRelatedTo, skipPartial)
| 89242 | } |
| 89243 | // Keep this up-to-date with the same logic within `getApparentTypeOfContextualType`, since they should behave similarly |
| 89244 | function findMatchingDiscriminantType(source, target, isRelatedTo, skipPartial) { |
| 89245 | if (target.flags & 1048576 /* TypeFlags.Union */ && source.flags & (2097152 /* TypeFlags.Intersection */ | 524288 /* TypeFlags.Object */)) { |
| 89246 | var match = getMatchingUnionConstituentForType(target, source); |
| 89247 | if (match) { |
| 89248 | return match; |
| 89249 | } |
| 89250 | var sourceProperties = getPropertiesOfType(source); |
| 89251 | if (sourceProperties) { |
| 89252 | var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target); |
| 89253 | if (sourcePropertiesFiltered) { |
| 89254 | return discriminateTypeByDiscriminableItems(target, ts.map(sourcePropertiesFiltered, function (p) { return [function () { return getTypeOfSymbol(p); }, p.escapedName]; }), isRelatedTo, /*defaultValue*/ undefined, skipPartial); |
| 89255 | } |
| 89256 | } |
| 89257 | } |
| 89258 | return undefined; |
| 89259 | } |
| 89260 | } |
| 89261 | ts.createTypeChecker = createTypeChecker; |
| 89262 | function isNotAccessor(declaration) { |
no test coverage detected
searching dependent graphs…