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.
@@ -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.20211026";
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 isTypeSubtypeOf(t, template); })) {
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
- // Note that these checks are specifically ordered to produce correct results. In particular,
63273
- // we need to deconstruct unions before intersections (because unions are always at the top),
63274
- // and we need to handle "each" relations before "some" relations for the same kind of type.
63275
- if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
63276
- result = getConstituentCount(source) * getConstituentCount(target) >= 4 ?
63277
- recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags) :
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
- var result_9 = inferTypesFromTemplateLiteralType(source, target);
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 result_10 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
64312
- if (result_10) {
64313
- return result_10;
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 result_11;
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 (result_11 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
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 result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
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 & 3145728 /* UnionOrIntersection */ ? type.types.length : 1;
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
- !(isGenericTypeWithoutNullableConstraint(type) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
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 result_12 = 0 /* None */;
78938
+ var result_11 = 0 /* None */;
78937
78939
  var target = resolveAlias(getSymbolOfNode(d));
78938
78940
  ts.forEach(target.declarations, function (d) {
78939
- result_12 |= getDeclarationSpaces(d);
78941
+ result_11 |= getDeclarationSpaces(d);
78940
78942
  });
78941
- return result_12;
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 result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
95115
- return result_13 && factory.createPropertyAssignment("children", result_13);
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 result_14 = [];
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
- result_14.push(resolvedModule);
113923
+ result_13.push(resolvedModule);
113922
113924
  }
113923
- return result_14;
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 result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
118986
- if (result_15)
118987
- return result_15;
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 result_16 = cb(option, target === referenceRedirect);
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 (result_16)
119010
- return result_16;
119011
+ if (result_15)
119012
+ return result_15;
119011
119013
  }
119012
119014
  });
119013
119015
  });
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20211026";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20211027";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -59331,7 +59331,7 @@ var ts;
59331
59331
  var _loop_16 = function () {
59332
59332
  i--;
59333
59333
  var t = types[i];
59334
- if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) {
59334
+ if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
59335
59335
  ts.orderedRemoveItemAt(types, i);
59336
59336
  }
59337
59337
  };
@@ -63064,13 +63064,12 @@ var ts;
63064
63064
  traceUnionsOrIntersectionsTooLarge(source, target);
63065
63065
  var result = 0 /* False */;
63066
63066
  var saveErrorInfo = captureErrorCalculationState();
63067
- // Note that these checks are specifically ordered to produce correct results. In particular,
63068
- // we need to deconstruct unions before intersections (because unions are always at the top),
63069
- // and we need to handle "each" relations before "some" relations for the same kind of type.
63070
- if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
63071
- result = getConstituentCount(source) * getConstituentCount(target) >= 4 ?
63072
- recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags) :
63073
- structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
63067
+ if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
63068
+ // We skip caching when source or target is a union with no more than three constituents.
63069
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
63070
+ }
63071
+ else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
63072
+ result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
63074
63073
  }
63075
63074
  if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
63076
63075
  if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
@@ -63527,19 +63526,19 @@ var ts;
63527
63526
  var maybeStart = maybeCount;
63528
63527
  maybeKeys[maybeCount] = id;
63529
63528
  maybeCount++;
63529
+ var saveExpandingFlags = expandingFlags;
63530
63530
  if (recursionFlags & 1 /* Source */) {
63531
63531
  sourceStack[sourceDepth] = source;
63532
63532
  sourceDepth++;
63533
+ if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
63534
+ expandingFlags |= 1 /* Source */;
63533
63535
  }
63534
63536
  if (recursionFlags & 2 /* Target */) {
63535
63537
  targetStack[targetDepth] = target;
63536
63538
  targetDepth++;
63539
+ if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
63540
+ expandingFlags |= 2 /* Target */;
63537
63541
  }
63538
- var saveExpandingFlags = expandingFlags;
63539
- if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
63540
- expandingFlags |= 1 /* Source */;
63541
- if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
63542
- expandingFlags |= 2 /* Target */;
63543
63542
  var originalHandler;
63544
63543
  var propagatingVarianceFlags = 0;
63545
63544
  if (outofbandVarianceMarkerHandler) {
@@ -63563,13 +63562,13 @@ var ts;
63563
63562
  if (outofbandVarianceMarkerHandler) {
63564
63563
  outofbandVarianceMarkerHandler = originalHandler;
63565
63564
  }
63566
- expandingFlags = saveExpandingFlags;
63567
63565
  if (recursionFlags & 1 /* Source */) {
63568
63566
  sourceDepth--;
63569
63567
  }
63570
63568
  if (recursionFlags & 2 /* Target */) {
63571
63569
  targetDepth--;
63572
63570
  }
63571
+ expandingFlags = saveExpandingFlags;
63573
63572
  if (result) {
63574
63573
  if (result === -1 /* True */ || (sourceDepth === 0 && targetDepth === 0)) {
63575
63574
  if (result === -1 /* True */ || result === 3 /* Maybe */) {
@@ -63907,8 +63906,7 @@ var ts;
63907
63906
  // For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
63908
63907
  instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
63909
63908
  }
63910
- var result_9 = inferTypesFromTemplateLiteralType(source, target);
63911
- if (result_9 && ts.every(result_9, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); })) {
63909
+ if (isTypeMatchedByTemplateLiteralType(source, target)) {
63912
63910
  return -1 /* True */;
63913
63911
  }
63914
63912
  }
@@ -64103,9 +64101,9 @@ var ts;
64103
64101
  if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
64104
64102
  var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
64105
64103
  if (objectOnlyTarget.flags & 1048576 /* Union */) {
64106
- var result_10 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
64107
- if (result_10) {
64108
- return result_10;
64104
+ var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
64105
+ if (result_9) {
64106
+ return result_9;
64109
64107
  }
64110
64108
  }
64111
64109
  }
@@ -64177,13 +64175,13 @@ var ts;
64177
64175
  var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
64178
64176
  getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
64179
64177
  if (modifiersRelated) {
64180
- var result_11;
64178
+ var result_10;
64181
64179
  var targetConstraint = getConstraintTypeFromMappedType(target);
64182
64180
  var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
64183
- if (result_11 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
64181
+ if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
64184
64182
  var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
64185
64183
  if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
64186
- return result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
64184
+ return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
64187
64185
  }
64188
64186
  }
64189
64187
  }
@@ -66266,6 +66264,10 @@ var ts;
66266
66264
  inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
66267
66265
  undefined;
66268
66266
  }
66267
+ function isTypeMatchedByTemplateLiteralType(source, target) {
66268
+ var inferences = inferTypesFromTemplateLiteralType(source, target);
66269
+ return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
66270
+ }
66269
66271
  function getStringLikeTypeForType(type) {
66270
66272
  return type.flags & (1 /* Any */ | 402653316 /* StringLike */) ? type : getTemplateLiteralType(["", ""], [type]);
66271
66273
  }
@@ -67801,7 +67803,7 @@ var ts;
67801
67803
  mapType(type, mapper);
67802
67804
  }
67803
67805
  function getConstituentCount(type) {
67804
- return type.flags & 3145728 /* UnionOrIntersection */ ? type.types.length : 1;
67806
+ return type.flags & 1048576 /* Union */ ? type.types.length : 1;
67805
67807
  }
67806
67808
  function extractTypesOfKind(type, kind) {
67807
67809
  return filterType(type, function (t) { return (t.flags & kind) !== 0; });
@@ -69299,7 +69301,7 @@ var ts;
69299
69301
  return parent.kind === 205 /* PropertyAccessExpression */ ||
69300
69302
  parent.kind === 207 /* CallExpression */ && parent.expression === node ||
69301
69303
  parent.kind === 206 /* ElementAccessExpression */ && parent.expression === node &&
69302
- !(isGenericTypeWithoutNullableConstraint(type) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
69304
+ !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
69303
69305
  }
69304
69306
  function isGenericTypeWithUnionConstraint(type) {
69305
69307
  return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
@@ -78728,12 +78730,12 @@ var ts;
78728
78730
  case 264 /* ImportEqualsDeclaration */:
78729
78731
  case 267 /* NamespaceImport */:
78730
78732
  case 266 /* ImportClause */:
78731
- var result_12 = 0 /* None */;
78733
+ var result_11 = 0 /* None */;
78732
78734
  var target = resolveAlias(getSymbolOfNode(d));
78733
78735
  ts.forEach(target.declarations, function (d) {
78734
- result_12 |= getDeclarationSpaces(d);
78736
+ result_11 |= getDeclarationSpaces(d);
78735
78737
  });
78736
- return result_12;
78738
+ return result_11;
78737
78739
  case 253 /* VariableDeclaration */:
78738
78740
  case 202 /* BindingElement */:
78739
78741
  case 255 /* FunctionDeclaration */:
@@ -94906,8 +94908,8 @@ var ts;
94906
94908
  function convertJsxChildrenToChildrenPropAssignment(children) {
94907
94909
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
94908
94910
  if (ts.length(nonWhitespaceChildren) === 1) {
94909
- var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
94910
- return result_13 && factory.createPropertyAssignment("children", result_13);
94911
+ var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
94912
+ return result_12 && factory.createPropertyAssignment("children", result_12);
94911
94913
  }
94912
94914
  var result = ts.mapDefined(children, transformJsxChildToExpression);
94913
94915
  return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
@@ -113707,15 +113709,15 @@ var ts;
113707
113709
  // which per above occurred during the current program creation.
113708
113710
  // Since we assume the filesystem does not change during program creation,
113709
113711
  // it is safe to reuse resolutions from the earlier call.
113710
- var result_14 = [];
113712
+ var result_13 = [];
113711
113713
  var i = 0;
113712
113714
  for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
113713
113715
  var moduleName = moduleNames_1[_i];
113714
113716
  var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
113715
113717
  i++;
113716
- result_14.push(resolvedModule);
113718
+ result_13.push(resolvedModule);
113717
113719
  }
113718
- return result_14;
113720
+ return result_13;
113719
113721
  }
113720
113722
  // At this point, we know at least one of the following hold:
113721
113723
  // - file has local declarations for ambient modules
@@ -118777,9 +118779,9 @@ var ts;
118777
118779
  if (!preferSymlinks) {
118778
118780
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
118779
118781
  // so we only need to remove them from the realpath filenames.
118780
- var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
118781
- if (result_15)
118782
- return result_15;
118782
+ var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
118783
+ if (result_14)
118784
+ return result_14;
118783
118785
  }
118784
118786
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
118785
118787
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -118799,10 +118801,10 @@ var ts;
118799
118801
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
118800
118802
  var symlinkDirectory = symlinkDirectories_1[_i];
118801
118803
  var option = ts.resolvePath(symlinkDirectory, relative);
118802
- var result_16 = cb(option, target === referenceRedirect);
118804
+ var result_15 = cb(option, target === referenceRedirect);
118803
118805
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
118804
- if (result_16)
118805
- return result_16;
118806
+ if (result_15)
118807
+ return result_15;
118806
118808
  }
118807
118809
  });
118808
118810
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.5.0-dev.20211026",
5
+ "version": "4.5.0-dev.20211027",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [