typescript 4.5.0-dev.20211026 → 4.5.0-dev.20211027
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +40 -36
- package/lib/tsserver.js +41 -39
- package/lib/tsserverlibrary.js +41 -39
- package/lib/typescript.js +41 -39
- package/lib/typescriptServices.js +41 -39
- package/lib/typingsInstaller.js +41 -39
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211027";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -59536,7 +59536,7 @@ var ts;
|
|
|
59536
59536
|
var _loop_16 = function () {
|
|
59537
59537
|
i--;
|
|
59538
59538
|
var t = types[i];
|
|
59539
|
-
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return
|
|
59539
|
+
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
59540
59540
|
ts.orderedRemoveItemAt(types, i);
|
|
59541
59541
|
}
|
|
59542
59542
|
};
|
|
@@ -63269,13 +63269,12 @@ var ts;
|
|
|
63269
63269
|
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63270
63270
|
var result = 0 /* False */;
|
|
63271
63271
|
var saveErrorInfo = captureErrorCalculationState();
|
|
63272
|
-
|
|
63273
|
-
|
|
63274
|
-
|
|
63275
|
-
|
|
63276
|
-
|
|
63277
|
-
|
|
63278
|
-
structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63272
|
+
if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
63273
|
+
// We skip caching when source or target is a union with no more than three constituents.
|
|
63274
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63275
|
+
}
|
|
63276
|
+
else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
|
|
63277
|
+
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
|
|
63279
63278
|
}
|
|
63280
63279
|
if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
|
|
63281
63280
|
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
@@ -63732,19 +63731,19 @@ var ts;
|
|
|
63732
63731
|
var maybeStart = maybeCount;
|
|
63733
63732
|
maybeKeys[maybeCount] = id;
|
|
63734
63733
|
maybeCount++;
|
|
63734
|
+
var saveExpandingFlags = expandingFlags;
|
|
63735
63735
|
if (recursionFlags & 1 /* Source */) {
|
|
63736
63736
|
sourceStack[sourceDepth] = source;
|
|
63737
63737
|
sourceDepth++;
|
|
63738
|
+
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63739
|
+
expandingFlags |= 1 /* Source */;
|
|
63738
63740
|
}
|
|
63739
63741
|
if (recursionFlags & 2 /* Target */) {
|
|
63740
63742
|
targetStack[targetDepth] = target;
|
|
63741
63743
|
targetDepth++;
|
|
63744
|
+
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63745
|
+
expandingFlags |= 2 /* Target */;
|
|
63742
63746
|
}
|
|
63743
|
-
var saveExpandingFlags = expandingFlags;
|
|
63744
|
-
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63745
|
-
expandingFlags |= 1 /* Source */;
|
|
63746
|
-
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63747
|
-
expandingFlags |= 2 /* Target */;
|
|
63748
63747
|
var originalHandler;
|
|
63749
63748
|
var propagatingVarianceFlags = 0;
|
|
63750
63749
|
if (outofbandVarianceMarkerHandler) {
|
|
@@ -63768,13 +63767,13 @@ var ts;
|
|
|
63768
63767
|
if (outofbandVarianceMarkerHandler) {
|
|
63769
63768
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
63770
63769
|
}
|
|
63771
|
-
expandingFlags = saveExpandingFlags;
|
|
63772
63770
|
if (recursionFlags & 1 /* Source */) {
|
|
63773
63771
|
sourceDepth--;
|
|
63774
63772
|
}
|
|
63775
63773
|
if (recursionFlags & 2 /* Target */) {
|
|
63776
63774
|
targetDepth--;
|
|
63777
63775
|
}
|
|
63776
|
+
expandingFlags = saveExpandingFlags;
|
|
63778
63777
|
if (result) {
|
|
63779
63778
|
if (result === -1 /* True */ || (sourceDepth === 0 && targetDepth === 0)) {
|
|
63780
63779
|
if (result === -1 /* True */ || result === 3 /* Maybe */) {
|
|
@@ -64112,8 +64111,7 @@ var ts;
|
|
|
64112
64111
|
// For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
|
|
64113
64112
|
instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
|
|
64114
64113
|
}
|
|
64115
|
-
|
|
64116
|
-
if (result_9 && ts.every(result_9, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); })) {
|
|
64114
|
+
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
64117
64115
|
return -1 /* True */;
|
|
64118
64116
|
}
|
|
64119
64117
|
}
|
|
@@ -64308,9 +64306,9 @@ var ts;
|
|
|
64308
64306
|
if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
|
|
64309
64307
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
|
|
64310
64308
|
if (objectOnlyTarget.flags & 1048576 /* Union */) {
|
|
64311
|
-
var
|
|
64312
|
-
if (
|
|
64313
|
-
return
|
|
64309
|
+
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
64310
|
+
if (result_9) {
|
|
64311
|
+
return result_9;
|
|
64314
64312
|
}
|
|
64315
64313
|
}
|
|
64316
64314
|
}
|
|
@@ -64382,13 +64380,13 @@ var ts;
|
|
|
64382
64380
|
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
|
|
64383
64381
|
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
|
|
64384
64382
|
if (modifiersRelated) {
|
|
64385
|
-
var
|
|
64383
|
+
var result_10;
|
|
64386
64384
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
64387
64385
|
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
|
|
64388
|
-
if (
|
|
64386
|
+
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
|
|
64389
64387
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
64390
64388
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
64391
|
-
return
|
|
64389
|
+
return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
|
|
64392
64390
|
}
|
|
64393
64391
|
}
|
|
64394
64392
|
}
|
|
@@ -66471,6 +66469,10 @@ var ts;
|
|
|
66471
66469
|
inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
|
|
66472
66470
|
undefined;
|
|
66473
66471
|
}
|
|
66472
|
+
function isTypeMatchedByTemplateLiteralType(source, target) {
|
|
66473
|
+
var inferences = inferTypesFromTemplateLiteralType(source, target);
|
|
66474
|
+
return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
|
|
66475
|
+
}
|
|
66474
66476
|
function getStringLikeTypeForType(type) {
|
|
66475
66477
|
return type.flags & (1 /* Any */ | 402653316 /* StringLike */) ? type : getTemplateLiteralType(["", ""], [type]);
|
|
66476
66478
|
}
|
|
@@ -68006,7 +68008,7 @@ var ts;
|
|
|
68006
68008
|
mapType(type, mapper);
|
|
68007
68009
|
}
|
|
68008
68010
|
function getConstituentCount(type) {
|
|
68009
|
-
return type.flags &
|
|
68011
|
+
return type.flags & 1048576 /* Union */ ? type.types.length : 1;
|
|
68010
68012
|
}
|
|
68011
68013
|
function extractTypesOfKind(type, kind) {
|
|
68012
68014
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
@@ -69504,7 +69506,7 @@ var ts;
|
|
|
69504
69506
|
return parent.kind === 205 /* PropertyAccessExpression */ ||
|
|
69505
69507
|
parent.kind === 207 /* CallExpression */ && parent.expression === node ||
|
|
69506
69508
|
parent.kind === 206 /* ElementAccessExpression */ && parent.expression === node &&
|
|
69507
|
-
!(
|
|
69509
|
+
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
|
|
69508
69510
|
}
|
|
69509
69511
|
function isGenericTypeWithUnionConstraint(type) {
|
|
69510
69512
|
return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
|
|
@@ -78933,12 +78935,12 @@ var ts;
|
|
|
78933
78935
|
case 264 /* ImportEqualsDeclaration */:
|
|
78934
78936
|
case 267 /* NamespaceImport */:
|
|
78935
78937
|
case 266 /* ImportClause */:
|
|
78936
|
-
var
|
|
78938
|
+
var result_11 = 0 /* None */;
|
|
78937
78939
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
78938
78940
|
ts.forEach(target.declarations, function (d) {
|
|
78939
|
-
|
|
78941
|
+
result_11 |= getDeclarationSpaces(d);
|
|
78940
78942
|
});
|
|
78941
|
-
return
|
|
78943
|
+
return result_11;
|
|
78942
78944
|
case 253 /* VariableDeclaration */:
|
|
78943
78945
|
case 202 /* BindingElement */:
|
|
78944
78946
|
case 255 /* FunctionDeclaration */:
|
|
@@ -95111,8 +95113,8 @@ var ts;
|
|
|
95111
95113
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
95112
95114
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
95113
95115
|
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
95114
|
-
var
|
|
95115
|
-
return
|
|
95116
|
+
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
95117
|
+
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
95116
95118
|
}
|
|
95117
95119
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
95118
95120
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -113912,15 +113914,15 @@ var ts;
|
|
|
113912
113914
|
// which per above occurred during the current program creation.
|
|
113913
113915
|
// Since we assume the filesystem does not change during program creation,
|
|
113914
113916
|
// it is safe to reuse resolutions from the earlier call.
|
|
113915
|
-
var
|
|
113917
|
+
var result_13 = [];
|
|
113916
113918
|
var i = 0;
|
|
113917
113919
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
113918
113920
|
var moduleName = moduleNames_1[_i];
|
|
113919
113921
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
113920
113922
|
i++;
|
|
113921
|
-
|
|
113923
|
+
result_13.push(resolvedModule);
|
|
113922
113924
|
}
|
|
113923
|
-
return
|
|
113925
|
+
return result_13;
|
|
113924
113926
|
}
|
|
113925
113927
|
// At this point, we know at least one of the following hold:
|
|
113926
113928
|
// - file has local declarations for ambient modules
|
|
@@ -118982,9 +118984,9 @@ var ts;
|
|
|
118982
118984
|
if (!preferSymlinks) {
|
|
118983
118985
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
118984
118986
|
// so we only need to remove them from the realpath filenames.
|
|
118985
|
-
var
|
|
118986
|
-
if (
|
|
118987
|
-
return
|
|
118987
|
+
var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
118988
|
+
if (result_14)
|
|
118989
|
+
return result_14;
|
|
118988
118990
|
}
|
|
118989
118991
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
118990
118992
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -119004,10 +119006,10 @@ var ts;
|
|
|
119004
119006
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
119005
119007
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
119006
119008
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
119007
|
-
var
|
|
119009
|
+
var result_15 = cb(option, target === referenceRedirect);
|
|
119008
119010
|
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
119009
|
-
if (
|
|
119010
|
-
return
|
|
119011
|
+
if (result_15)
|
|
119012
|
+
return result_15;
|
|
119011
119013
|
}
|
|
119012
119014
|
});
|
|
119013
119015
|
});
|
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211027";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -59536,7 +59536,7 @@ var ts;
|
|
|
59536
59536
|
var _loop_16 = function () {
|
|
59537
59537
|
i--;
|
|
59538
59538
|
var t = types[i];
|
|
59539
|
-
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return
|
|
59539
|
+
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
59540
59540
|
ts.orderedRemoveItemAt(types, i);
|
|
59541
59541
|
}
|
|
59542
59542
|
};
|
|
@@ -63269,13 +63269,12 @@ var ts;
|
|
|
63269
63269
|
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63270
63270
|
var result = 0 /* False */;
|
|
63271
63271
|
var saveErrorInfo = captureErrorCalculationState();
|
|
63272
|
-
|
|
63273
|
-
|
|
63274
|
-
|
|
63275
|
-
|
|
63276
|
-
|
|
63277
|
-
|
|
63278
|
-
structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63272
|
+
if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
63273
|
+
// We skip caching when source or target is a union with no more than three constituents.
|
|
63274
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63275
|
+
}
|
|
63276
|
+
else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
|
|
63277
|
+
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
|
|
63279
63278
|
}
|
|
63280
63279
|
if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
|
|
63281
63280
|
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
@@ -63732,19 +63731,19 @@ var ts;
|
|
|
63732
63731
|
var maybeStart = maybeCount;
|
|
63733
63732
|
maybeKeys[maybeCount] = id;
|
|
63734
63733
|
maybeCount++;
|
|
63734
|
+
var saveExpandingFlags = expandingFlags;
|
|
63735
63735
|
if (recursionFlags & 1 /* Source */) {
|
|
63736
63736
|
sourceStack[sourceDepth] = source;
|
|
63737
63737
|
sourceDepth++;
|
|
63738
|
+
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63739
|
+
expandingFlags |= 1 /* Source */;
|
|
63738
63740
|
}
|
|
63739
63741
|
if (recursionFlags & 2 /* Target */) {
|
|
63740
63742
|
targetStack[targetDepth] = target;
|
|
63741
63743
|
targetDepth++;
|
|
63744
|
+
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63745
|
+
expandingFlags |= 2 /* Target */;
|
|
63742
63746
|
}
|
|
63743
|
-
var saveExpandingFlags = expandingFlags;
|
|
63744
|
-
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63745
|
-
expandingFlags |= 1 /* Source */;
|
|
63746
|
-
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63747
|
-
expandingFlags |= 2 /* Target */;
|
|
63748
63747
|
var originalHandler;
|
|
63749
63748
|
var propagatingVarianceFlags = 0;
|
|
63750
63749
|
if (outofbandVarianceMarkerHandler) {
|
|
@@ -63768,13 +63767,13 @@ var ts;
|
|
|
63768
63767
|
if (outofbandVarianceMarkerHandler) {
|
|
63769
63768
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
63770
63769
|
}
|
|
63771
|
-
expandingFlags = saveExpandingFlags;
|
|
63772
63770
|
if (recursionFlags & 1 /* Source */) {
|
|
63773
63771
|
sourceDepth--;
|
|
63774
63772
|
}
|
|
63775
63773
|
if (recursionFlags & 2 /* Target */) {
|
|
63776
63774
|
targetDepth--;
|
|
63777
63775
|
}
|
|
63776
|
+
expandingFlags = saveExpandingFlags;
|
|
63778
63777
|
if (result) {
|
|
63779
63778
|
if (result === -1 /* True */ || (sourceDepth === 0 && targetDepth === 0)) {
|
|
63780
63779
|
if (result === -1 /* True */ || result === 3 /* Maybe */) {
|
|
@@ -64112,8 +64111,7 @@ var ts;
|
|
|
64112
64111
|
// For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
|
|
64113
64112
|
instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
|
|
64114
64113
|
}
|
|
64115
|
-
|
|
64116
|
-
if (result_9 && ts.every(result_9, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); })) {
|
|
64114
|
+
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
64117
64115
|
return -1 /* True */;
|
|
64118
64116
|
}
|
|
64119
64117
|
}
|
|
@@ -64308,9 +64306,9 @@ var ts;
|
|
|
64308
64306
|
if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
|
|
64309
64307
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
|
|
64310
64308
|
if (objectOnlyTarget.flags & 1048576 /* Union */) {
|
|
64311
|
-
var
|
|
64312
|
-
if (
|
|
64313
|
-
return
|
|
64309
|
+
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
64310
|
+
if (result_9) {
|
|
64311
|
+
return result_9;
|
|
64314
64312
|
}
|
|
64315
64313
|
}
|
|
64316
64314
|
}
|
|
@@ -64382,13 +64380,13 @@ var ts;
|
|
|
64382
64380
|
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
|
|
64383
64381
|
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
|
|
64384
64382
|
if (modifiersRelated) {
|
|
64385
|
-
var
|
|
64383
|
+
var result_10;
|
|
64386
64384
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
64387
64385
|
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
|
|
64388
|
-
if (
|
|
64386
|
+
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
|
|
64389
64387
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
64390
64388
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
64391
|
-
return
|
|
64389
|
+
return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
|
|
64392
64390
|
}
|
|
64393
64391
|
}
|
|
64394
64392
|
}
|
|
@@ -66471,6 +66469,10 @@ var ts;
|
|
|
66471
66469
|
inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
|
|
66472
66470
|
undefined;
|
|
66473
66471
|
}
|
|
66472
|
+
function isTypeMatchedByTemplateLiteralType(source, target) {
|
|
66473
|
+
var inferences = inferTypesFromTemplateLiteralType(source, target);
|
|
66474
|
+
return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
|
|
66475
|
+
}
|
|
66474
66476
|
function getStringLikeTypeForType(type) {
|
|
66475
66477
|
return type.flags & (1 /* Any */ | 402653316 /* StringLike */) ? type : getTemplateLiteralType(["", ""], [type]);
|
|
66476
66478
|
}
|
|
@@ -68006,7 +68008,7 @@ var ts;
|
|
|
68006
68008
|
mapType(type, mapper);
|
|
68007
68009
|
}
|
|
68008
68010
|
function getConstituentCount(type) {
|
|
68009
|
-
return type.flags &
|
|
68011
|
+
return type.flags & 1048576 /* Union */ ? type.types.length : 1;
|
|
68010
68012
|
}
|
|
68011
68013
|
function extractTypesOfKind(type, kind) {
|
|
68012
68014
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
@@ -69504,7 +69506,7 @@ var ts;
|
|
|
69504
69506
|
return parent.kind === 205 /* PropertyAccessExpression */ ||
|
|
69505
69507
|
parent.kind === 207 /* CallExpression */ && parent.expression === node ||
|
|
69506
69508
|
parent.kind === 206 /* ElementAccessExpression */ && parent.expression === node &&
|
|
69507
|
-
!(
|
|
69509
|
+
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
|
|
69508
69510
|
}
|
|
69509
69511
|
function isGenericTypeWithUnionConstraint(type) {
|
|
69510
69512
|
return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
|
|
@@ -78933,12 +78935,12 @@ var ts;
|
|
|
78933
78935
|
case 264 /* ImportEqualsDeclaration */:
|
|
78934
78936
|
case 267 /* NamespaceImport */:
|
|
78935
78937
|
case 266 /* ImportClause */:
|
|
78936
|
-
var
|
|
78938
|
+
var result_11 = 0 /* None */;
|
|
78937
78939
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
78938
78940
|
ts.forEach(target.declarations, function (d) {
|
|
78939
|
-
|
|
78941
|
+
result_11 |= getDeclarationSpaces(d);
|
|
78940
78942
|
});
|
|
78941
|
-
return
|
|
78943
|
+
return result_11;
|
|
78942
78944
|
case 253 /* VariableDeclaration */:
|
|
78943
78945
|
case 202 /* BindingElement */:
|
|
78944
78946
|
case 255 /* FunctionDeclaration */:
|
|
@@ -95111,8 +95113,8 @@ var ts;
|
|
|
95111
95113
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
95112
95114
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
95113
95115
|
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
95114
|
-
var
|
|
95115
|
-
return
|
|
95116
|
+
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
95117
|
+
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
95116
95118
|
}
|
|
95117
95119
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
95118
95120
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -113912,15 +113914,15 @@ var ts;
|
|
|
113912
113914
|
// which per above occurred during the current program creation.
|
|
113913
113915
|
// Since we assume the filesystem does not change during program creation,
|
|
113914
113916
|
// it is safe to reuse resolutions from the earlier call.
|
|
113915
|
-
var
|
|
113917
|
+
var result_13 = [];
|
|
113916
113918
|
var i = 0;
|
|
113917
113919
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
113918
113920
|
var moduleName = moduleNames_1[_i];
|
|
113919
113921
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
113920
113922
|
i++;
|
|
113921
|
-
|
|
113923
|
+
result_13.push(resolvedModule);
|
|
113922
113924
|
}
|
|
113923
|
-
return
|
|
113925
|
+
return result_13;
|
|
113924
113926
|
}
|
|
113925
113927
|
// At this point, we know at least one of the following hold:
|
|
113926
113928
|
// - file has local declarations for ambient modules
|
|
@@ -118982,9 +118984,9 @@ var ts;
|
|
|
118982
118984
|
if (!preferSymlinks) {
|
|
118983
118985
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
118984
118986
|
// so we only need to remove them from the realpath filenames.
|
|
118985
|
-
var
|
|
118986
|
-
if (
|
|
118987
|
-
return
|
|
118987
|
+
var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
118988
|
+
if (result_14)
|
|
118989
|
+
return result_14;
|
|
118988
118990
|
}
|
|
118989
118991
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
118990
118992
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -119004,10 +119006,10 @@ var ts;
|
|
|
119004
119006
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
119005
119007
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
119006
119008
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
119007
|
-
var
|
|
119009
|
+
var result_15 = cb(option, target === referenceRedirect);
|
|
119008
119010
|
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
119009
|
-
if (
|
|
119010
|
-
return
|
|
119011
|
+
if (result_15)
|
|
119012
|
+
return result_15;
|
|
119011
119013
|
}
|
|
119012
119014
|
});
|
|
119013
119015
|
});
|