typescript 4.8.0-dev.20220525 → 4.8.0-dev.20220528

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 CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.8";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220525";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220528";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -5598,6 +5598,7 @@ var ts;
5598
5598
  Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
5599
5599
  The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
5600
5600
  The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
5601
+ This_type_parameter_probably_needs_an_extends_object_constraint: diag(2208, ts.DiagnosticCategory.Error, "This_type_parameter_probably_needs_an_extends_object_constraint_2208", "This type parameter probably needs an `extends object` constraint."),
5601
5602
  The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
5602
5603
  The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
5603
5604
  Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
@@ -12599,9 +12600,6 @@ var ts;
12599
12600
  }
12600
12601
  ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
12601
12602
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
12602
- if (node.kind === 203) {
12603
- node = node.parent.parent;
12604
- }
12605
12603
  return ts.isVariableDeclaration(node) &&
12606
12604
  !!node.initializer &&
12607
12605
  isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
@@ -15861,13 +15859,13 @@ var ts;
15861
15859
  return !file.isDeclarationFile ? walkTreeForJSXTags(file) : undefined;
15862
15860
  }
15863
15861
  function isFileForcedToBeModuleByFormat(file) {
15864
- return file.impliedNodeFormat === ts.ModuleKind.ESNext && !file.isDeclarationFile ? true : undefined;
15862
+ return (file.impliedNodeFormat === ts.ModuleKind.ESNext || (ts.fileExtensionIsOneOf(file.fileName, [".cjs", ".cts"]))) && !file.isDeclarationFile ? true : undefined;
15865
15863
  }
15866
15864
  function getSetExternalModuleIndicator(options) {
15867
15865
  switch (getEmitModuleDetectionKind(options)) {
15868
15866
  case ts.ModuleDetectionKind.Force:
15869
15867
  return function (file) {
15870
- file.externalModuleIndicator = !file.isDeclarationFile || ts.isFileProbablyExternalModule(file);
15868
+ file.externalModuleIndicator = ts.isFileProbablyExternalModule(file) || !file.isDeclarationFile || undefined;
15871
15869
  };
15872
15870
  case ts.ModuleDetectionKind.Legacy:
15873
15871
  return function (file) {
@@ -15923,7 +15921,8 @@ var ts;
15923
15921
  }
15924
15922
  ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
15925
15923
  function getEmitModuleDetectionKind(options) {
15926
- return options.moduleDetection || ts.ModuleDetectionKind.Auto;
15924
+ return options.moduleDetection ||
15925
+ (getEmitModuleKind(options) === ts.ModuleKind.Node16 || getEmitModuleKind(options) === ts.ModuleKind.NodeNext ? ts.ModuleDetectionKind.Force : ts.ModuleDetectionKind.Auto);
15927
15926
  }
15928
15927
  ts.getEmitModuleDetectionKind = getEmitModuleDetectionKind;
15929
15928
  function hasJsonModuleEmitEnabled(options) {
@@ -34266,7 +34265,7 @@ var ts;
34266
34265
  }
34267
34266
  if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
34268
34267
  return {
34269
- key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
34268
+ key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
34270
34269
  flags: 1
34271
34270
  };
34272
34271
  }
@@ -35199,15 +35198,19 @@ var ts;
35199
35198
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35200
35199
  return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
35201
35200
  }
35202
- function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35203
- var containingDirectory = ts.getDirectoryPath(containingFile);
35204
- var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
35205
- return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions, redirectedReference);
35206
- }
35207
35201
  var jsOnlyExtensions = [Extensions.JavaScript];
35208
35202
  var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
35209
35203
  var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
35210
35204
  var tsconfigExtensions = [Extensions.TSConfig];
35205
+ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35206
+ var containingDirectory = ts.getDirectoryPath(containingFile);
35207
+ var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
35208
+ var extensions = compilerOptions.noDtsResolution ? [Extensions.TsOnly, Extensions.JavaScript] : tsExtensions;
35209
+ if (compilerOptions.resolveJsonModule) {
35210
+ extensions = __spreadArray(__spreadArray([], extensions, true), [Extensions.Json], false);
35211
+ }
35212
+ return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
35213
+ }
35211
35214
  function tryResolveJSModuleWorker(moduleName, initialDir, host) {
35212
35215
  return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
35213
35216
  }
@@ -38487,12 +38490,14 @@ var ts;
38487
38490
  }
38488
38491
  }
38489
38492
  function setCommonJsModuleIndicator(node) {
38490
- if (file.externalModuleIndicator) {
38493
+ if (file.externalModuleIndicator && file.externalModuleIndicator !== true) {
38491
38494
  return false;
38492
38495
  }
38493
38496
  if (!file.commonJsModuleIndicator) {
38494
38497
  file.commonJsModuleIndicator = node;
38495
- bindSourceFileAsExternalModule();
38498
+ if (!file.externalModuleIndicator) {
38499
+ bindSourceFileAsExternalModule();
38500
+ }
38496
38501
  }
38497
38502
  return true;
38498
38503
  }
@@ -38845,7 +38850,11 @@ var ts;
38845
38850
  checkStrictModeEvalOrArguments(node, node.name);
38846
38851
  }
38847
38852
  if (!ts.isBindingPattern(node.name)) {
38848
- if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node) && !(ts.getCombinedModifierFlags(node) & 1)) {
38853
+ var possibleVariableDecl = node.kind === 254 ? node : node.parent.parent;
38854
+ if (ts.isInJSFile(node) &&
38855
+ ts.isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) &&
38856
+ !ts.getJSDocTypeTag(node) &&
38857
+ !(ts.getCombinedModifierFlags(node) & 1)) {
38849
38858
  declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
38850
38859
  }
38851
38860
  else if (ts.isBlockOrCatchScoped(node)) {
@@ -39743,6 +39752,7 @@ var ts;
39743
39752
  var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
39744
39753
  emptyTypeLiteralSymbol.members = ts.createSymbolTable();
39745
39754
  var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
39755
+ var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray)]) : unknownType;
39746
39756
  var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
39747
39757
  emptyGenericType.instantiations = new ts.Map();
39748
39758
  var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
@@ -41158,7 +41168,8 @@ var ts;
41158
41168
  && isAliasableOrJsExpression(node.parent.right)
41159
41169
  || node.kind === 297
41160
41170
  || node.kind === 296 && isAliasableOrJsExpression(node.initializer)
41161
- || ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
41171
+ || node.kind === 254 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)
41172
+ || node.kind === 203 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
41162
41173
  }
41163
41174
  function isAliasableOrJsExpression(e) {
41164
41175
  return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
@@ -41239,7 +41250,7 @@ var ts;
41239
41250
  if (!ts.isSourceFileJS(file)) {
41240
41251
  return hasExportAssignmentSymbol(moduleSymbol);
41241
41252
  }
41242
- return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), undefined, dontResolveAlias);
41253
+ return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), undefined, dontResolveAlias);
41243
41254
  }
41244
41255
  function getTargetOfImportClause(node, dontResolveAlias) {
41245
41256
  var _a;
@@ -48551,7 +48562,7 @@ var ts;
48551
48562
  }
48552
48563
  }
48553
48564
  }
48554
- else if (t.flags & 469892092) {
48565
+ else if (t.flags & 469892092 || isEmptyAnonymousObjectType(t)) {
48555
48566
  hasDisjointDomainType = true;
48556
48567
  }
48557
48568
  }
@@ -48559,7 +48570,7 @@ var ts;
48559
48570
  if (hasDisjointDomainType) {
48560
48571
  for (var _a = 0, types_6 = types; _a < types_6.length; _a++) {
48561
48572
  var t = types_6[_a];
48562
- if (t.flags & 469892092) {
48573
+ if (t.flags & 469892092 || isEmptyAnonymousObjectType(t)) {
48563
48574
  constraints = ts.append(constraints, t);
48564
48575
  }
48565
48576
  }
@@ -50829,7 +50840,7 @@ var ts;
50829
50840
  }
50830
50841
  return includes;
50831
50842
  }
50832
- function removeRedundantPrimitiveTypes(types, includes) {
50843
+ function removeRedundantSupertypes(types, includes) {
50833
50844
  var i = types.length;
50834
50845
  while (i > 0) {
50835
50846
  i--;
@@ -50837,7 +50848,9 @@ var ts;
50837
50848
  var remove = t.flags & 4 && includes & (128 | 134217728 | 268435456) ||
50838
50849
  t.flags & 8 && includes & 256 ||
50839
50850
  t.flags & 64 && includes & 2048 ||
50840
- t.flags & 4096 && includes & 8192;
50851
+ t.flags & 4096 && includes & 8192 ||
50852
+ t.flags & 16384 && includes & 32768 ||
50853
+ isEmptyAnonymousObjectType(t) && includes & 470302716;
50841
50854
  if (remove) {
50842
50855
  ts.orderedRemoveItemAt(types, i);
50843
50856
  }
@@ -50932,7 +50945,7 @@ var ts;
50932
50945
  result.aliasTypeArguments = aliasTypeArguments;
50933
50946
  return result;
50934
50947
  }
50935
- function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
50948
+ function getIntersectionType(types, aliasSymbol, aliasTypeArguments, noSupertypeReduction) {
50936
50949
  var typeMembershipMap = new ts.Map();
50937
50950
  var includes = addTypesToIntersection(typeMembershipMap, 0, types);
50938
50951
  var typeSet = ts.arrayFrom(typeMembershipMap.values());
@@ -50960,11 +50973,11 @@ var ts;
50960
50973
  if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
50961
50974
  includes & 8 && includes & 256 ||
50962
50975
  includes & 64 && includes & 2048 ||
50963
- includes & 4096 && includes & 8192) {
50964
- removeRedundantPrimitiveTypes(typeSet, includes);
50965
- }
50966
- if (includes & 16777216 && includes & 524288) {
50967
- ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
50976
+ includes & 4096 && includes & 8192 ||
50977
+ includes & 16384 && includes & 32768 ||
50978
+ includes & 16777216 && includes & 470302716) {
50979
+ if (!noSupertypeReduction)
50980
+ removeRedundantSupertypes(typeSet, includes);
50968
50981
  }
50969
50982
  if (includes & 262144) {
50970
50983
  typeSet[typeSet.indexOf(undefinedType)] = missingType;
@@ -50996,7 +51009,7 @@ var ts;
50996
51009
  return errorType;
50997
51010
  }
50998
51011
  var constituents = getCrossProductIntersections(typeSet);
50999
- var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152); }) ? createOriginUnionOrIntersectionType(2097152, typeSet) : undefined;
51012
+ var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152); }) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152, typeSet) : undefined;
51000
51013
  result = getUnionType(constituents, 1, aliasSymbol, aliasTypeArguments, origin);
51001
51014
  }
51002
51015
  }
@@ -51039,11 +51052,21 @@ var ts;
51039
51052
  }
51040
51053
  return intersections;
51041
51054
  }
51055
+ function getConstituentCount(type) {
51056
+ return !(type.flags & 3145728) || type.aliasSymbol ? 1 :
51057
+ type.flags & 1048576 && type.origin ? getConstituentCount(type.origin) :
51058
+ getConstituentCountOfTypes(type.types);
51059
+ }
51060
+ function getConstituentCountOfTypes(types) {
51061
+ return ts.reduceLeft(types, function (n, t) { return n + getConstituentCount(t); }, 0);
51062
+ }
51042
51063
  function getTypeFromIntersectionTypeNode(node) {
51043
51064
  var links = getNodeLinks(node);
51044
51065
  if (!links.resolvedType) {
51045
51066
  var aliasSymbol = getAliasSymbolForTypeNode(node);
51046
- links.resolvedType = getIntersectionType(ts.map(node.types, getTypeFromTypeNode), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
51067
+ var types = ts.map(node.types, getTypeFromTypeNode);
51068
+ var noSupertypeReduction = types.length === 2 && !!(types[0].flags & (4 | 8 | 64)) && types[1] === emptyTypeLiteralType;
51069
+ links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
51047
51070
  }
51048
51071
  return links.resolvedType;
51049
51072
  }
@@ -53522,6 +53545,17 @@ var ts;
53522
53545
  return !!(ts.getObjectFlags(type) & 16 && (type.members && isEmptyResolvedType(type) ||
53523
53546
  type.symbol && type.symbol.flags & 2048 && getMembersOfSymbol(type.symbol).size === 0));
53524
53547
  }
53548
+ function isUnknownLikeUnionType(type) {
53549
+ if (strictNullChecks && type.flags & 1048576) {
53550
+ if (!(type.objectFlags & 33554432)) {
53551
+ var types = type.types;
53552
+ type.objectFlags |= 33554432 | (types.length >= 3 && types[0].flags & 32768 &&
53553
+ types[1].flags & 65536 && ts.some(types, isEmptyAnonymousObjectType) ? 67108864 : 0);
53554
+ }
53555
+ return !!(type.objectFlags & 67108864);
53556
+ }
53557
+ return false;
53558
+ }
53525
53559
  function isStringIndexSignatureOnlyType(type) {
53526
53560
  return type.flags & 524288 && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, stringType) ||
53527
53561
  type.flags & 3145728 && ts.every(type.types, isStringIndexSignatureOnlyType) ||
@@ -53599,13 +53633,15 @@ var ts;
53599
53633
  return true;
53600
53634
  if (s & 65536 && (!strictNullChecks && !(t & 3145728) || t & 65536))
53601
53635
  return true;
53602
- if (s & 524288 && t & 67108864)
53636
+ if (s & 524288 && t & 67108864 && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source)))
53603
53637
  return true;
53604
53638
  if (relation === assignableRelation || relation === comparableRelation) {
53605
53639
  if (s & 1)
53606
53640
  return true;
53607
53641
  if (s & (8 | 256) && !(s & 1024) && (t & 32 || relation === assignableRelation && t & 256 && t & 1024))
53608
53642
  return true;
53643
+ if (isUnknownLikeUnionType(target))
53644
+ return true;
53609
53645
  }
53610
53646
  return false;
53611
53647
  }
@@ -53647,16 +53683,27 @@ var ts;
53647
53683
  function getNormalizedType(type, writing) {
53648
53684
  while (true) {
53649
53685
  var t = isFreshLiteralType(type) ? type.regularType :
53650
- ts.getObjectFlags(type) & 4 && type.node ? createTypeReference(type.target, getTypeArguments(type)) :
53651
- type.flags & 3145728 ? getReducedType(type) :
53686
+ ts.getObjectFlags(type) & 4 ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type :
53687
+ type.flags & 3145728 ? getNormalizedUnionOrIntersectionType(type, writing) :
53652
53688
  type.flags & 33554432 ? writing ? type.baseType : type.substitute :
53653
53689
  type.flags & 25165824 ? getSimplifiedType(type, writing) :
53654
53690
  type;
53655
- t = getSingleBaseForNonAugmentingSubtype(t) || t;
53656
53691
  if (t === type)
53657
- break;
53692
+ return t;
53658
53693
  type = t;
53659
53694
  }
53695
+ }
53696
+ function getNormalizedUnionOrIntersectionType(type, writing) {
53697
+ var reduced = getReducedType(type);
53698
+ if (reduced !== type) {
53699
+ return reduced;
53700
+ }
53701
+ if (type.flags & 2097152) {
53702
+ var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
53703
+ if (normalizedTypes !== type.types) {
53704
+ return getIntersectionType(normalizedTypes);
53705
+ }
53706
+ }
53660
53707
  return type;
53661
53708
  }
53662
53709
  function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
@@ -54031,6 +54078,7 @@ var ts;
54031
54078
  return 0;
54032
54079
  }
54033
54080
  function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
54081
+ var _a, _b;
54034
54082
  var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
54035
54083
  var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
54036
54084
  source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
@@ -54069,6 +54117,9 @@ var ts;
54069
54117
  return;
54070
54118
  }
54071
54119
  reportRelationError(headMessage, source, target);
54120
+ if (strictNullChecks && source.flags & 8650752 && ((_b = (_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864))) {
54121
+ associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint));
54122
+ }
54072
54123
  }
54073
54124
  function traceUnionsOrIntersectionsTooLarge(source, target) {
54074
54125
  if (!ts.tracing) {
@@ -54710,12 +54761,6 @@ var ts;
54710
54761
  if (sourceFlags & 8650752) {
54711
54762
  if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
54712
54763
  var constraint = getConstraintOfType(source) || unknownType;
54713
- if (!getConstraintOfType(source) || (sourceFlags & 262144 && constraint.flags & 1)) {
54714
- if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
54715
- resetErrorInfo(saveErrorInfo);
54716
- return result;
54717
- }
54718
- }
54719
54764
  if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
54720
54765
  resetErrorInfo(saveErrorInfo);
54721
54766
  return result;
@@ -55971,9 +56016,11 @@ var ts;
55971
56016
  return getSupertypeOrUnion(types);
55972
56017
  }
55973
56018
  var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 98304); });
55974
- return primaryTypes.length ?
55975
- getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 98304) :
55976
- getUnionType(types, 2);
56019
+ if (primaryTypes.length) {
56020
+ var supertypeOrUnion = getSupertypeOrUnion(primaryTypes);
56021
+ return primaryTypes === types ? supertypeOrUnion : getUnionType(__spreadArray([supertypeOrUnion], ts.filter(types, function (t) { return !!(t.flags & 98304); }), true));
56022
+ }
56023
+ return getUnionType(types, 2);
55977
56024
  }
55978
56025
  function getCommonSubtype(types) {
55979
56026
  return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; });
@@ -56160,12 +56207,13 @@ var ts;
56160
56207
  return result;
56161
56208
  }
56162
56209
  function getFalsyFlags(type) {
56163
- return type.flags & 1048576 ? getFalsyFlagsOfTypes(type.types) :
56164
- type.flags & 128 ? type.value === "" ? 128 : 0 :
56165
- type.flags & 256 ? type.value === 0 ? 256 : 0 :
56166
- type.flags & 2048 ? isZeroBigInt(type) ? 2048 : 0 :
56167
- type.flags & 512 ? (type === falseType || type === regularFalseType) ? 512 : 0 :
56168
- type.flags & 117724;
56210
+ var t = type.flags & 2097152 ? getBaseConstraintOrType(type) : type;
56211
+ return t.flags & 1048576 ? getFalsyFlagsOfTypes(t.types) :
56212
+ t.flags & 128 ? t.value === "" ? 128 : 0 :
56213
+ t.flags & 256 ? t.value === 0 ? 256 : 0 :
56214
+ t.flags & 2048 ? isZeroBigInt(t) ? 2048 : 0 :
56215
+ t.flags & 512 ? (t === falseType || t === regularFalseType) ? 512 : 0 :
56216
+ t.flags & 117724;
56169
56217
  }
56170
56218
  function removeDefinitelyFalsyTypes(type) {
56171
56219
  return getFalsyFlags(type) & 117632 ?
@@ -56200,16 +56248,19 @@ var ts;
56200
56248
  return type.flags & 32768 ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
56201
56249
  }
56202
56250
  function getGlobalNonNullableTypeInstantiation(type) {
56203
- var reducedType = getTypeWithFacts(type, 2097152);
56204
56251
  if (!deferredGlobalNonNullableTypeAlias) {
56205
56252
  deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288, undefined) || unknownSymbol;
56206
56253
  }
56207
56254
  return deferredGlobalNonNullableTypeAlias !== unknownSymbol ?
56208
- getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [reducedType]) :
56209
- reducedType;
56255
+ getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]) :
56256
+ getIntersectionType([type, emptyObjectType]);
56210
56257
  }
56211
56258
  function getNonNullableType(type) {
56212
- return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;
56259
+ if (strictNullChecks) {
56260
+ var reducedType = getTypeWithFacts(type, 2097152);
56261
+ return maybeTypeOfKind(reducedType, 465829888) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
56262
+ }
56263
+ return type;
56213
56264
  }
56214
56265
  function addOptionalTypeMarker(type) {
56215
56266
  return strictNullChecks ? getUnionType([type, optionalType]) : type;
@@ -56803,17 +56854,32 @@ var ts;
56803
56854
  return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) ||
56804
56855
  sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen);
56805
56856
  }
56806
- function isValidBigIntString(s) {
56857
+ function isValidNumberString(s, roundTripOnly) {
56858
+ if (s === "")
56859
+ return false;
56860
+ var n = +s;
56861
+ return isFinite(n) && (!roundTripOnly || "" + n === s);
56862
+ }
56863
+ function parseBigIntLiteralType(text) {
56864
+ var negative = text.startsWith("-");
56865
+ var base10Value = ts.parsePseudoBigInt((negative ? text.slice(1) : text) + "n");
56866
+ return getBigIntLiteralType({ negative: negative, base10Value: base10Value });
56867
+ }
56868
+ function isValidBigIntString(s, roundTripOnly) {
56869
+ if (s === "")
56870
+ return false;
56807
56871
  var scanner = ts.createScanner(99, false);
56808
56872
  var success = true;
56809
56873
  scanner.setOnError(function () { return success = false; });
56810
56874
  scanner.setText(s + "n");
56811
56875
  var result = scanner.scan();
56812
- if (result === 40) {
56876
+ var negative = result === 40;
56877
+ if (negative) {
56813
56878
  result = scanner.scan();
56814
56879
  }
56815
56880
  var flags = scanner.getTokenFlags();
56816
- return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512);
56881
+ return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512)
56882
+ && (!roundTripOnly || s === ts.pseudoBigIntToString({ negative: negative, base10Value: ts.parsePseudoBigInt(scanner.getTokenValue()) }));
56817
56883
  }
56818
56884
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
56819
56885
  if (source === target || target.flags & (1 | 4)) {
@@ -56821,8 +56887,8 @@ var ts;
56821
56887
  }
56822
56888
  if (source.flags & 128) {
56823
56889
  var value = source.value;
56824
- return !!(target.flags & 8 && value !== "" && isFinite(+value) ||
56825
- target.flags & 64 && value !== "" && isValidBigIntString(value) ||
56890
+ return !!(target.flags & 8 && isValidNumberString(value, false) ||
56891
+ target.flags & 64 && isValidBigIntString(value, false) ||
56826
56892
  target.flags & (512 | 98304) && value === target.intrinsicName);
56827
56893
  }
56828
56894
  if (source.flags & 134217728) {
@@ -57287,8 +57353,51 @@ var ts;
57287
57353
  var matches = inferTypesFromTemplateLiteralType(source, target);
57288
57354
  var types = target.types;
57289
57355
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
57356
+ var _loop_23 = function (i) {
57357
+ var source_1 = matches ? matches[i] : neverType;
57358
+ var target_3 = types[i];
57359
+ if (source_1.flags & 128 && target_3.flags & 8650752) {
57360
+ var inferenceContext = getInferenceInfoForType(target_3);
57361
+ var constraint = inferenceContext ? getBaseConstraintOfType(inferenceContext.typeParameter) : undefined;
57362
+ if (constraint && !isTypeAny(constraint)) {
57363
+ var constraintTypes = constraint.flags & 1048576 ? constraint.types : [constraint];
57364
+ var allTypeFlags_1 = ts.reduceLeft(constraintTypes, function (flags, t) { return flags | t.flags; }, 0);
57365
+ if (!(allTypeFlags_1 & 4)) {
57366
+ var str_1 = source_1.value;
57367
+ if (allTypeFlags_1 & 296 && !isValidNumberString(str_1, true)) {
57368
+ allTypeFlags_1 &= ~296;
57369
+ }
57370
+ if (allTypeFlags_1 & 2112 && !isValidBigIntString(str_1, true)) {
57371
+ allTypeFlags_1 &= ~2112;
57372
+ }
57373
+ var matchingType = ts.reduceLeft(constraintTypes, function (left, right) {
57374
+ return !(right.flags & allTypeFlags_1) ? left :
57375
+ left.flags & 4 ? left : right.flags & 4 ? source_1 :
57376
+ left.flags & 134217728 ? left : right.flags & 134217728 && isTypeMatchedByTemplateLiteralType(source_1, right) ? source_1 :
57377
+ left.flags & 268435456 ? left : right.flags & 268435456 && str_1 === applyStringMapping(right.symbol, str_1) ? source_1 :
57378
+ left.flags & 128 ? left : right.flags & 128 && right.value === str_1 ? right :
57379
+ left.flags & 8 ? left : right.flags & 8 ? getNumberLiteralType(+str_1) :
57380
+ left.flags & 32 ? left : right.flags & 32 ? getNumberLiteralType(+str_1) :
57381
+ left.flags & 256 ? left : right.flags & 256 && right.value === +str_1 ? right :
57382
+ left.flags & 64 ? left : right.flags & 64 ? parseBigIntLiteralType(str_1) :
57383
+ left.flags & 2048 ? left : right.flags & 2048 && ts.pseudoBigIntToString(right.value) === str_1 ? right :
57384
+ left.flags & 16 ? left : right.flags & 16 ? str_1 === "true" ? trueType : str_1 === "false" ? falseType : booleanType :
57385
+ left.flags & 512 ? left : right.flags & 512 && right.intrinsicName === str_1 ? right :
57386
+ left.flags & 32768 ? left : right.flags & 32768 && right.intrinsicName === str_1 ? right :
57387
+ left.flags & 65536 ? left : right.flags & 65536 && right.intrinsicName === str_1 ? right :
57388
+ left;
57389
+ }, neverType);
57390
+ if (!(matchingType.flags & 131072)) {
57391
+ inferFromTypes(matchingType, target_3);
57392
+ return "continue";
57393
+ }
57394
+ }
57395
+ }
57396
+ }
57397
+ inferFromTypes(source_1, target_3);
57398
+ };
57290
57399
  for (var i = 0; i < types.length; i++) {
57291
- inferFromTypes(matches ? matches[i] : neverType, types[i]);
57400
+ _loop_23(i);
57292
57401
  }
57293
57402
  }
57294
57403
  }
@@ -57758,7 +57867,7 @@ var ts;
57758
57867
  function mapTypesByKeyProperty(types, name) {
57759
57868
  var map = new ts.Map();
57760
57869
  var count = 0;
57761
- var _loop_23 = function (type) {
57870
+ var _loop_24 = function (type) {
57762
57871
  if (type.flags & (524288 | 2097152 | 58982400)) {
57763
57872
  var discriminant = getTypeOfPropertyOfType(type, name);
57764
57873
  if (discriminant) {
@@ -57784,7 +57893,7 @@ var ts;
57784
57893
  };
57785
57894
  for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
57786
57895
  var type = types_16[_i];
57787
- var state_9 = _loop_23(type);
57896
+ var state_9 = _loop_24(type);
57788
57897
  if (typeof state_9 === "object")
57789
57898
  return state_9.value;
57790
57899
  }
@@ -57972,6 +58081,24 @@ var ts;
57972
58081
  function getTypeWithFacts(type, include) {
57973
58082
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
57974
58083
  }
58084
+ function getIntersectionWithFacts(type, facts) {
58085
+ var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 ? unknownUnionType : type, facts));
58086
+ if (strictNullChecks) {
58087
+ switch (facts) {
58088
+ case 524288:
58089
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 65536 ? getIntersectionType([t, getTypeFacts(t) & 131072 && !maybeTypeOfKind(reduced, 65536) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t; });
58090
+ case 1048576:
58091
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 131072 ? getIntersectionType([t, getTypeFacts(t) & 65536 && !maybeTypeOfKind(reduced, 32768) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t; });
58092
+ case 2097152:
58093
+ case 4194304:
58094
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 262144 ? getGlobalNonNullableTypeInstantiation(t) : t; });
58095
+ }
58096
+ }
58097
+ return reduced;
58098
+ }
58099
+ function recombineUnknownType(type) {
58100
+ return type === unknownUnionType ? unknownType : type;
58101
+ }
57975
58102
  function getTypeWithDefault(type, defaultExpression) {
57976
58103
  return defaultExpression ?
57977
58104
  getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) :
@@ -58912,7 +59039,7 @@ var ts;
58912
59039
  if (isEvolvingArrayTypeList(types)) {
58913
59040
  return getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType)));
58914
59041
  }
58915
- var result = getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);
59042
+ var result = recombineUnknownType(getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction));
58916
59043
  if (result !== declaredType && result.flags & declaredType.flags & 1048576 && ts.arraysEqual(result.types, declaredType.types)) {
58917
59044
  return declaredType;
58918
59045
  }
@@ -59008,8 +59135,7 @@ var ts;
59008
59135
  }
59009
59136
  function narrowTypeByTruthiness(type, expr, assumeTrue) {
59010
59137
  if (isMatchingReference(reference, expr)) {
59011
- return type.flags & 2 && assumeTrue ? nonNullUnknownType :
59012
- getTypeWithFacts(type, assumeTrue ? 4194304 : 8388608);
59138
+ return getIntersectionWithFacts(type, assumeTrue ? 4194304 : 8388608);
59013
59139
  }
59014
59140
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
59015
59141
  type = getTypeWithFacts(type, 2097152);
@@ -59149,9 +59275,6 @@ var ts;
59149
59275
  assumeTrue = !assumeTrue;
59150
59276
  }
59151
59277
  var valueType = getTypeOfExpression(value);
59152
- if (assumeTrue && (type.flags & 2) && (operator === 34 || operator === 35) && (valueType.flags & 65536)) {
59153
- return getUnionType([nullType, undefinedType]);
59154
- }
59155
59278
  if ((type.flags & 2) && assumeTrue && (operator === 36 || operator === 37)) {
59156
59279
  if (valueType.flags & (131068 | 67108864)) {
59157
59280
  return valueType;
@@ -59171,7 +59294,7 @@ var ts;
59171
59294
  valueType.flags & 65536 ?
59172
59295
  assumeTrue ? 131072 : 1048576 :
59173
59296
  assumeTrue ? 65536 : 524288;
59174
- return type.flags & 2 && facts & (1048576 | 2097152) ? nonNullUnknownType : getTypeWithFacts(type, facts);
59297
+ return getIntersectionWithFacts(type, facts);
59175
59298
  }
59176
59299
  if (assumeTrue) {
59177
59300
  var filterFn = operator === 34 ?
@@ -59198,14 +59321,11 @@ var ts;
59198
59321
  if (type.flags & 1 && literal.text === "function") {
59199
59322
  return type;
59200
59323
  }
59201
- if (assumeTrue && type.flags & 2 && literal.text === "object") {
59202
- return type === nonNullUnknownType ? nonPrimitiveType : getUnionType([nonPrimitiveType, nullType]);
59203
- }
59204
59324
  var facts = assumeTrue ?
59205
59325
  typeofEQFacts.get(literal.text) || 128 :
59206
59326
  typeofNEFacts.get(literal.text) || 32768;
59207
59327
  var impliedType = getImpliedTypeFromTypeofGuard(type, literal.text);
59208
- return getTypeWithFacts(assumeTrue && impliedType ? mapType(type, narrowUnionMemberByTypeof(impliedType)) : type, facts);
59328
+ return getTypeWithFacts(assumeTrue && impliedType ? narrowTypeByImpliedType(type, impliedType) : type, facts);
59209
59329
  }
59210
59330
  function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
59211
59331
  var everyClauseChecks = clauseStart !== clauseEnd && ts.every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
@@ -59250,30 +59370,35 @@ var ts;
59250
59370
  }
59251
59371
  function getImpliedTypeFromTypeofGuard(type, text) {
59252
59372
  switch (text) {
59373
+ case "object":
59374
+ return type.flags & 1 ? type : getUnionType([nullType, nonPrimitiveType]);
59253
59375
  case "function":
59254
59376
  return type.flags & 1 ? type : globalFunctionType;
59255
- case "object":
59256
- return type.flags & 2 ? getUnionType([nonPrimitiveType, nullType]) : type;
59257
59377
  default:
59258
59378
  return typeofTypesByName.get(text);
59259
59379
  }
59260
59380
  }
59261
- function narrowUnionMemberByTypeof(candidate) {
59262
- return function (type) {
59263
- if (isTypeSubtypeOf(type, candidate)) {
59264
- return type;
59265
- }
59266
- if (isTypeSubtypeOf(candidate, type)) {
59267
- return candidate;
59381
+ function narrowTypeByImpliedType(type, candidate) {
59382
+ if (type.flags & 3) {
59383
+ return candidate;
59384
+ }
59385
+ return mapType(type, function (t) {
59386
+ if (isTypeRelatedTo(t, candidate, strictSubtypeRelation)) {
59387
+ return t;
59268
59388
  }
59269
- if (type.flags & 465829888) {
59270
- var constraint = getBaseConstraintOfType(type) || anyType;
59271
- if (isTypeSubtypeOf(candidate, constraint)) {
59272
- return getIntersectionType([type, candidate]);
59389
+ return mapType(candidate, function (c) {
59390
+ if (!areTypesComparable(t, c)) {
59391
+ return neverType;
59273
59392
  }
59274
- }
59275
- return type;
59276
- };
59393
+ if (c.flags & 131068 && t.flags & 524288 && !isEmptyAnonymousObjectType(t)) {
59394
+ return isTypeSubtypeOf(c, t) ? c : neverType;
59395
+ }
59396
+ if (c === globalFunctionType && isTypeSubtypeOf(c, t)) {
59397
+ return c;
59398
+ }
59399
+ return getIntersectionType([t, c]);
59400
+ });
59401
+ });
59277
59402
  }
59278
59403
  function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
59279
59404
  var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, true);
@@ -59299,7 +59424,7 @@ var ts;
59299
59424
  return filterType(type, function (t) { return (getTypeFacts(t) & switchFacts) === switchFacts; });
59300
59425
  }
59301
59426
  var impliedType = getTypeWithFacts(getUnionType(clauseWitnesses.map(function (text) { return getImpliedTypeFromTypeofGuard(type, text) || type; })), switchFacts);
59302
- return getTypeWithFacts(mapType(type, narrowUnionMemberByTypeof(impliedType)), switchFacts);
59427
+ return getTypeWithFacts(narrowTypeByImpliedType(type, impliedType), switchFacts);
59303
59428
  }
59304
59429
  function isMatchingConstructorReference(expr) {
59305
59430
  return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" ||
@@ -59560,7 +59685,9 @@ var ts;
59560
59685
  !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
59561
59686
  }
59562
59687
  function isGenericTypeWithUnionConstraint(type) {
59563
- return !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
59688
+ return type.flags & 2097152 ?
59689
+ ts.some(type.types, isGenericTypeWithUnionConstraint) :
59690
+ !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
59564
59691
  }
59565
59692
  function isGenericTypeWithoutNullableConstraint(type) {
59566
59693
  return !!(type.flags & 465829888 && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304));
@@ -59577,7 +59704,7 @@ var ts;
59577
59704
  var substituteConstraints = !(checkMode && checkMode & 2) &&
59578
59705
  someType(type, isGenericTypeWithUnionConstraint) &&
59579
59706
  (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
59580
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
59707
+ return substituteConstraints ? mapType(type, getBaseConstraintOrType) : type;
59581
59708
  }
59582
59709
  function isExportOrExportExpression(location) {
59583
59710
  return !!ts.findAncestor(location, function (n) {
@@ -63207,7 +63334,7 @@ var ts;
63207
63334
  var spreadIndex = getSpreadArgumentIndex(args);
63208
63335
  if (spreadIndex >= 0) {
63209
63336
  var effectiveArgs_1 = args.slice(0, spreadIndex);
63210
- var _loop_24 = function (i) {
63337
+ var _loop_25 = function (i) {
63211
63338
  var arg = args[i];
63212
63339
  var spreadType = arg.kind === 225 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
63213
63340
  if (spreadType && isTupleType(spreadType)) {
@@ -63223,7 +63350,7 @@ var ts;
63223
63350
  }
63224
63351
  };
63225
63352
  for (var i = spreadIndex; i < args.length; i++) {
63226
- _loop_24(i);
63353
+ _loop_25(i);
63227
63354
  }
63228
63355
  return effectiveArgs_1;
63229
63356
  }
@@ -63471,7 +63598,7 @@ var ts;
63471
63598
  var min_3 = Number.MAX_VALUE;
63472
63599
  var minIndex = 0;
63473
63600
  var i_1 = 0;
63474
- var _loop_25 = function (c) {
63601
+ var _loop_26 = function (c) {
63475
63602
  var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
63476
63603
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
63477
63604
  if (diags_2) {
@@ -63489,7 +63616,7 @@ var ts;
63489
63616
  };
63490
63617
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
63491
63618
  var c = candidatesForArgumentError_1[_a];
63492
- _loop_25(c);
63619
+ _loop_26(c);
63493
63620
  }
63494
63621
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
63495
63622
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -63632,7 +63759,7 @@ var ts;
63632
63759
  }
63633
63760
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
63634
63761
  var parameters = [];
63635
- var _loop_26 = function (i) {
63762
+ var _loop_27 = function (i) {
63636
63763
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
63637
63764
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
63638
63765
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -63640,7 +63767,7 @@ var ts;
63640
63767
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
63641
63768
  };
63642
63769
  for (var i = 0; i < maxNonRestParam; i++) {
63643
- _loop_26(i);
63770
+ _loop_27(i);
63644
63771
  }
63645
63772
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
63646
63773
  var flags = 0;
@@ -67236,7 +67363,7 @@ var ts;
67236
67363
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
67237
67364
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
67238
67365
  var indexSignatureMap_1 = new ts.Map();
67239
- var _loop_27 = function (declaration) {
67366
+ var _loop_28 = function (declaration) {
67240
67367
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
67241
67368
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
67242
67369
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -67251,7 +67378,7 @@ var ts;
67251
67378
  };
67252
67379
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
67253
67380
  var declaration = _a[_i];
67254
- _loop_27(declaration);
67381
+ _loop_28(declaration);
67255
67382
  }
67256
67383
  indexSignatureMap_1.forEach(function (entry) {
67257
67384
  if (entry.declarations.length > 1) {
@@ -69077,7 +69204,7 @@ var ts;
69077
69204
  return;
69078
69205
  }
69079
69206
  var symbol = getSymbolOfNode(node);
69080
- if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
69207
+ if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 203 ? node.parent.parent : node)) {
69081
69208
  checkAliasSymbol(node);
69082
69209
  return;
69083
69210
  }
@@ -70071,7 +70198,7 @@ var ts;
70071
70198
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 258) : undefined;
70072
70199
  var localPropDeclaration = declaration && declaration.kind === 221 ||
70073
70200
  name && name.kind === 162 || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
70074
- var _loop_28 = function (info) {
70201
+ var _loop_29 = function (info) {
70075
70202
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
70076
70203
  var errorNode = localPropDeclaration || localIndexDeclaration ||
70077
70204
  (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
@@ -70081,7 +70208,7 @@ var ts;
70081
70208
  };
70082
70209
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
70083
70210
  var info = indexInfos_9[_i];
70084
- _loop_28(info);
70211
+ _loop_29(info);
70085
70212
  }
70086
70213
  }
70087
70214
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -70089,7 +70216,7 @@ var ts;
70089
70216
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
70090
70217
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 258) : undefined;
70091
70218
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
70092
- var _loop_29 = function (info) {
70219
+ var _loop_30 = function (info) {
70093
70220
  if (info === checkInfo)
70094
70221
  return "continue";
70095
70222
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -70101,7 +70228,7 @@ var ts;
70101
70228
  };
70102
70229
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
70103
70230
  var info = indexInfos_10[_i];
70104
- _loop_29(info);
70231
+ _loop_30(info);
70105
70232
  }
70106
70233
  }
70107
70234
  function checkTypeNameIsReserved(name, message) {
@@ -70395,7 +70522,7 @@ var ts;
70395
70522
  var baseTypes = baseTypeNode && getBaseTypes(type);
70396
70523
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
70397
70524
  var baseStaticType = getBaseConstructorTypeOfClass(type);
70398
- var _loop_30 = function (member) {
70525
+ var _loop_31 = function (member) {
70399
70526
  if (ts.hasAmbientModifier(member)) {
70400
70527
  return "continue";
70401
70528
  }
@@ -70410,7 +70537,7 @@ var ts;
70410
70537
  };
70411
70538
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
70412
70539
  var member = _a[_i];
70413
- _loop_30(member);
70540
+ _loop_31(member);
70414
70541
  }
70415
70542
  }
70416
70543
  function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
@@ -70485,7 +70612,7 @@ var ts;
70485
70612
  }
70486
70613
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
70487
70614
  var issuedMemberError = false;
70488
- var _loop_31 = function (member) {
70615
+ var _loop_32 = function (member) {
70489
70616
  if (ts.isStatic(member)) {
70490
70617
  return "continue";
70491
70618
  }
@@ -70503,7 +70630,7 @@ var ts;
70503
70630
  };
70504
70631
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
70505
70632
  var member = _a[_i];
70506
- _loop_31(member);
70633
+ _loop_32(member);
70507
70634
  }
70508
70635
  if (!issuedMemberError) {
70509
70636
  checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
@@ -100995,7 +101122,7 @@ var ts;
100995
101122
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
100996
101123
  });
100997
101124
  var sortedPaths = [];
100998
- var _loop_32 = function (directory) {
101125
+ var _loop_33 = function (directory) {
100999
101126
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
101000
101127
  var pathsInDirectory;
101001
101128
  allFileNames.forEach(function (_a, fileName) {
@@ -101019,7 +101146,7 @@ var ts;
101019
101146
  };
101020
101147
  var out_directory_1;
101021
101148
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
101022
- var state_10 = _loop_32(directory);
101149
+ var state_10 = _loop_33(directory);
101023
101150
  directory = out_directory_1;
101024
101151
  if (state_10 === "break")
101025
101152
  break;
@@ -102345,6 +102472,7 @@ var ts;
102345
102472
  }
102346
102473
  function reloadFileNamesFromConfigFile() {
102347
102474
  writeLog("Reloading new file names and options");
102475
+ reloadLevel = ts.ConfigFileProgramReloadLevel.None;
102348
102476
  rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
102349
102477
  if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
102350
102478
  hasChangedConfigFileParsingErrors = true;