@typescript-deploys/pr-build 5.0.0-pr-49218-12 → 5.0.0-pr-52180-17

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
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-insiders.20230110`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230111`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -6763,6 +6763,7 @@ var Diagnostics = {
6763
6763
  Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
6764
6764
  Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
6765
6765
  Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
6766
+ Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
6766
6767
  Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
6767
6768
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
6768
6769
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
@@ -16637,6 +16638,10 @@ function isOptionalDeclaration(declaration) {
16637
16638
  return false;
16638
16639
  }
16639
16640
  }
16641
+ function isNonNullAccess(node) {
16642
+ const kind = node.kind;
16643
+ return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
16644
+ }
16640
16645
 
16641
16646
  // src/compiler/factory/baseNodeFactory.ts
16642
16647
  function createBaseNodeFactory() {
@@ -35772,7 +35777,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
35772
35777
  conditions,
35773
35778
  requestContainingDirectory: containingDirectory,
35774
35779
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
35775
- isConfigLookup: false
35780
+ isConfigLookup: false,
35781
+ candidateIsFromPackageJsonField: false
35776
35782
  };
35777
35783
  let resolved = primaryLookup();
35778
35784
  let primary = true;
@@ -36618,7 +36624,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
36618
36624
  conditions,
36619
36625
  requestContainingDirectory: containingDirectory,
36620
36626
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
36621
- isConfigLookup
36627
+ isConfigLookup,
36628
+ candidateIsFromPackageJsonField: false
36622
36629
  };
36623
36630
  if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
36624
36631
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
@@ -36842,7 +36849,7 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
36842
36849
  }
36843
36850
  function tryExtension(ext, resolvedUsingTsExtension) {
36844
36851
  const path = tryFile(candidate + ext, onlyRecordFailures, state);
36845
- return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
36852
+ return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
36846
36853
  }
36847
36854
  }
36848
36855
  function tryFile(fileName, onlyRecordFailures, state) {
@@ -36888,7 +36895,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
36888
36895
  conditions: emptyArray,
36889
36896
  requestContainingDirectory: void 0,
36890
36897
  reportDiagnostic: noop,
36891
- isConfigLookup: false
36898
+ isConfigLookup: false,
36899
+ candidateIsFromPackageJsonField: false
36892
36900
  };
36893
36901
  }
36894
36902
  function getPackageScopeForPath(fileName, state) {
@@ -36976,6 +36984,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
36976
36984
  }
36977
36985
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
36978
36986
  const features = state2.features;
36987
+ const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
36988
+ state2.candidateIsFromPackageJsonField = true;
36979
36989
  if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
36980
36990
  state2.features &= ~32 /* EsmMode */;
36981
36991
  }
@@ -36988,6 +36998,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
36988
36998
  false
36989
36999
  );
36990
37000
  state2.features = features;
37001
+ state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
36991
37002
  return result;
36992
37003
  };
36993
37004
  const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
@@ -37061,7 +37072,10 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
37061
37072
  return void 0;
37062
37073
  }
37063
37074
  const trailingParts = parts.slice(nameParts.length);
37064
- return loadModuleFromExports(scope, extensions, !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`, state, cache, redirectedReference);
37075
+ const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
37076
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
37077
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
37078
+ return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
37065
37079
  }
37066
37080
  function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
37067
37081
  if (!scope.contents.packageJsonContent.exports) {
@@ -37720,7 +37734,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
37720
37734
  conditions: [],
37721
37735
  requestContainingDirectory: containingDirectory,
37722
37736
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
37723
- isConfigLookup: false
37737
+ isConfigLookup: false,
37738
+ candidateIsFromPackageJsonField: false
37724
37739
  };
37725
37740
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
37726
37741
  return createResolvedModuleWithFailedLookupLocations(
@@ -37799,7 +37814,8 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
37799
37814
  conditions: [],
37800
37815
  requestContainingDirectory: void 0,
37801
37816
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
37802
- isConfigLookup: false
37817
+ isConfigLookup: false,
37818
+ candidateIsFromPackageJsonField: false
37803
37819
  };
37804
37820
  const resolved = loadModuleFromImmediateNodeModulesDirectory(
37805
37821
  4 /* Declaration */,
@@ -50715,7 +50731,17 @@ function createTypeChecker(host) {
50715
50731
  }
50716
50732
  }
50717
50733
  function getOuterTypeParametersOfClassOrInterface(symbol) {
50718
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 261 /* InterfaceDeclaration */);
50734
+ var _a2;
50735
+ const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
50736
+ if (decl.kind === 261 /* InterfaceDeclaration */) {
50737
+ return true;
50738
+ }
50739
+ if (decl.kind !== 257 /* VariableDeclaration */) {
50740
+ return false;
50741
+ }
50742
+ const initializer = decl.initializer;
50743
+ return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
50744
+ });
50719
50745
  Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
50720
50746
  return getOuterTypeParameters(declaration);
50721
50747
  }
@@ -57600,21 +57626,7 @@ function createTypeChecker(host) {
57600
57626
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
57601
57627
  for (let i = 0; i < paramCount; i++) {
57602
57628
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
57603
- let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
57604
- if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
57605
- targetType = mapType(targetType, (t) => {
57606
- if (!isTupleType(t) || isTypeIdenticalTo(sourceType, t)) {
57607
- return t;
57608
- }
57609
- const elementTypes = [];
57610
- const elementFlags = [];
57611
- for (let i2 = 0; i2 < getTypeReferenceArity(sourceType); i2++) {
57612
- elementTypes.push(getTupleElementType(t, i2));
57613
- elementFlags.push(sourceType.target.elementFlags[i2]);
57614
- }
57615
- return createTupleType(elementTypes, elementFlags);
57616
- });
57617
- }
57629
+ const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
57618
57630
  if (sourceType && targetType) {
57619
57631
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
57620
57632
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -62074,7 +62086,7 @@ function createTypeChecker(host) {
62074
62086
  if (signature) {
62075
62087
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : void 0;
62076
62088
  if (inference.contraCandidates) {
62077
- const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other === inference || getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
62089
+ const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
62078
62090
  inferredType = useCovariantType ? inferredCovariantType : getContravariantInference(inference);
62079
62091
  } else if (inferredCovariantType) {
62080
62092
  inferredType = inferredCovariantType;
@@ -63550,12 +63562,13 @@ function createTypeChecker(host) {
63550
63562
  if (propName === void 0) {
63551
63563
  return type;
63552
63564
  }
63553
- const removeNullable = strictNullChecks && isOptionalChain(access) && maybeTypeOfKind(type, 98304 /* Nullable */);
63565
+ const optionalChain = isOptionalChain(access);
63566
+ const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
63554
63567
  let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
63555
63568
  if (!propType) {
63556
63569
  return type;
63557
63570
  }
63558
- propType = removeNullable ? getOptionalType(propType) : propType;
63571
+ propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
63559
63572
  const narrowedPropType = narrowType2(propType);
63560
63573
  return filterType(type, (t) => {
63561
63574
  const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
@@ -99979,6 +99992,9 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
99979
99992
  case 259 /* FunctionDeclaration */:
99980
99993
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
99981
99994
  break;
99995
+ case 192 /* InferType */:
99996
+ diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
99997
+ break;
99982
99998
  case 262 /* TypeAliasDeclaration */:
99983
99999
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
99984
100000
  break;
package/lib/tsserver.js CHANGED
@@ -1735,6 +1735,7 @@ __export(server_exports, {
1735
1735
  isNonContextualKeyword: () => isNonContextualKeyword,
1736
1736
  isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
1737
1737
  isNonGlobalDeclaration: () => isNonGlobalDeclaration,
1738
+ isNonNullAccess: () => isNonNullAccess,
1738
1739
  isNonNullChain: () => isNonNullChain,
1739
1740
  isNonNullExpression: () => isNonNullExpression,
1740
1741
  isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
@@ -2661,7 +2662,7 @@ __export(ts_server_exports3, {
2661
2662
 
2662
2663
  // src/compiler/corePublic.ts
2663
2664
  var versionMajorMinor = "5.0";
2664
- var version = `${versionMajorMinor}.0-insiders.20230110`;
2665
+ var version = `${versionMajorMinor}.0-insiders.20230111`;
2665
2666
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2666
2667
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2667
2668
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10567,6 +10568,7 @@ var Diagnostics = {
10567
10568
  Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
10568
10569
  Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
10569
10570
  Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
10571
+ Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
10570
10572
  Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
10571
10573
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
10572
10574
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
@@ -21102,6 +21104,10 @@ function isOptionalDeclaration(declaration) {
21102
21104
  return false;
21103
21105
  }
21104
21106
  }
21107
+ function isNonNullAccess(node) {
21108
+ const kind = node.kind;
21109
+ return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
21110
+ }
21105
21111
 
21106
21112
  // src/compiler/factory/baseNodeFactory.ts
21107
21113
  function createBaseNodeFactory() {
@@ -40498,7 +40504,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
40498
40504
  conditions,
40499
40505
  requestContainingDirectory: containingDirectory,
40500
40506
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
40501
- isConfigLookup: false
40507
+ isConfigLookup: false,
40508
+ candidateIsFromPackageJsonField: false
40502
40509
  };
40503
40510
  let resolved = primaryLookup();
40504
40511
  let primary = true;
@@ -41369,7 +41376,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
41369
41376
  conditions,
41370
41377
  requestContainingDirectory: containingDirectory,
41371
41378
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
41372
- isConfigLookup
41379
+ isConfigLookup,
41380
+ candidateIsFromPackageJsonField: false
41373
41381
  };
41374
41382
  if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
41375
41383
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
@@ -41593,7 +41601,7 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
41593
41601
  }
41594
41602
  function tryExtension(ext, resolvedUsingTsExtension) {
41595
41603
  const path = tryFile(candidate + ext, onlyRecordFailures, state);
41596
- return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
41604
+ return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
41597
41605
  }
41598
41606
  }
41599
41607
  function tryFile(fileName, onlyRecordFailures, state) {
@@ -41740,7 +41748,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
41740
41748
  conditions: emptyArray,
41741
41749
  requestContainingDirectory: void 0,
41742
41750
  reportDiagnostic: noop,
41743
- isConfigLookup: false
41751
+ isConfigLookup: false,
41752
+ candidateIsFromPackageJsonField: false
41744
41753
  };
41745
41754
  }
41746
41755
  function getPackageScopeForPath(fileName, state) {
@@ -41828,6 +41837,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
41828
41837
  }
41829
41838
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
41830
41839
  const features = state2.features;
41840
+ const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
41841
+ state2.candidateIsFromPackageJsonField = true;
41831
41842
  if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
41832
41843
  state2.features &= ~32 /* EsmMode */;
41833
41844
  }
@@ -41840,6 +41851,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
41840
41851
  false
41841
41852
  );
41842
41853
  state2.features = features;
41854
+ state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
41843
41855
  return result;
41844
41856
  };
41845
41857
  const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
@@ -41913,7 +41925,10 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
41913
41925
  return void 0;
41914
41926
  }
41915
41927
  const trailingParts = parts.slice(nameParts.length);
41916
- return loadModuleFromExports(scope, extensions, !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`, state, cache, redirectedReference);
41928
+ const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
41929
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
41930
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
41931
+ return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
41917
41932
  }
41918
41933
  function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
41919
41934
  if (!scope.contents.packageJsonContent.exports) {
@@ -42572,7 +42587,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
42572
42587
  conditions: [],
42573
42588
  requestContainingDirectory: containingDirectory,
42574
42589
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
42575
- isConfigLookup: false
42590
+ isConfigLookup: false,
42591
+ candidateIsFromPackageJsonField: false
42576
42592
  };
42577
42593
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
42578
42594
  return createResolvedModuleWithFailedLookupLocations(
@@ -42651,7 +42667,8 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
42651
42667
  conditions: [],
42652
42668
  requestContainingDirectory: void 0,
42653
42669
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
42654
- isConfigLookup: false
42670
+ isConfigLookup: false,
42671
+ candidateIsFromPackageJsonField: false
42655
42672
  };
42656
42673
  const resolved = loadModuleFromImmediateNodeModulesDirectory(
42657
42674
  4 /* Declaration */,
@@ -55621,7 +55638,17 @@ function createTypeChecker(host) {
55621
55638
  }
55622
55639
  }
55623
55640
  function getOuterTypeParametersOfClassOrInterface(symbol) {
55624
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 261 /* InterfaceDeclaration */);
55641
+ var _a2;
55642
+ const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
55643
+ if (decl.kind === 261 /* InterfaceDeclaration */) {
55644
+ return true;
55645
+ }
55646
+ if (decl.kind !== 257 /* VariableDeclaration */) {
55647
+ return false;
55648
+ }
55649
+ const initializer = decl.initializer;
55650
+ return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
55651
+ });
55625
55652
  Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
55626
55653
  return getOuterTypeParameters(declaration);
55627
55654
  }
@@ -62506,21 +62533,7 @@ function createTypeChecker(host) {
62506
62533
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
62507
62534
  for (let i = 0; i < paramCount; i++) {
62508
62535
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
62509
- let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
62510
- if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
62511
- targetType = mapType(targetType, (t) => {
62512
- if (!isTupleType(t) || isTypeIdenticalTo(sourceType, t)) {
62513
- return t;
62514
- }
62515
- const elementTypes = [];
62516
- const elementFlags = [];
62517
- for (let i2 = 0; i2 < getTypeReferenceArity(sourceType); i2++) {
62518
- elementTypes.push(getTupleElementType(t, i2));
62519
- elementFlags.push(sourceType.target.elementFlags[i2]);
62520
- }
62521
- return createTupleType(elementTypes, elementFlags);
62522
- });
62523
- }
62536
+ const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
62524
62537
  if (sourceType && targetType) {
62525
62538
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
62526
62539
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -66980,7 +66993,7 @@ function createTypeChecker(host) {
66980
66993
  if (signature) {
66981
66994
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : void 0;
66982
66995
  if (inference.contraCandidates) {
66983
- const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other === inference || getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
66996
+ const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
66984
66997
  inferredType = useCovariantType ? inferredCovariantType : getContravariantInference(inference);
66985
66998
  } else if (inferredCovariantType) {
66986
66999
  inferredType = inferredCovariantType;
@@ -68456,12 +68469,13 @@ function createTypeChecker(host) {
68456
68469
  if (propName === void 0) {
68457
68470
  return type;
68458
68471
  }
68459
- const removeNullable = strictNullChecks && isOptionalChain(access) && maybeTypeOfKind(type, 98304 /* Nullable */);
68472
+ const optionalChain = isOptionalChain(access);
68473
+ const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
68460
68474
  let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
68461
68475
  if (!propType) {
68462
68476
  return type;
68463
68477
  }
68464
- propType = removeNullable ? getOptionalType(propType) : propType;
68478
+ propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
68465
68479
  const narrowedPropType = narrowType2(propType);
68466
68480
  return filterType(type, (t) => {
68467
68481
  const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
@@ -105062,6 +105076,9 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
105062
105076
  case 259 /* FunctionDeclaration */:
105063
105077
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
105064
105078
  break;
105079
+ case 192 /* InferType */:
105080
+ diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
105081
+ break;
105065
105082
  case 262 /* TypeAliasDeclaration */:
105066
105083
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
105067
105084
  break;
@@ -124889,6 +124906,7 @@ __export(ts_exports3, {
124889
124906
  isNonContextualKeyword: () => isNonContextualKeyword,
124890
124907
  isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
124891
124908
  isNonGlobalDeclaration: () => isNonGlobalDeclaration,
124909
+ isNonNullAccess: () => isNonNullAccess,
124892
124910
  isNonNullChain: () => isNonNullChain,
124893
124911
  isNonNullExpression: () => isNonNullExpression,
124894
124912
  isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
@@ -180467,6 +180485,7 @@ start(initializeNodeSystem(), require("os").platform());
180467
180485
  isNonContextualKeyword,
180468
180486
  isNonGlobalAmbientModule,
180469
180487
  isNonGlobalDeclaration,
180488
+ isNonNullAccess,
180470
180489
  isNonNullChain,
180471
180490
  isNonNullExpression,
180472
180491
  isNonStaticMethodOrAccessorWithPrivateName,
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-insiders.20230110`;
45
+ version = `${versionMajorMinor}.0-insiders.20230111`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8023,6 +8023,7 @@ ${lanes.join("\n")}
8023
8023
  Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
8024
8024
  Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
8025
8025
  Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
8026
+ Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
8026
8027
  Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
8027
8028
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
8028
8029
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
@@ -18397,6 +18398,10 @@ ${lanes.join("\n")}
18397
18398
  return false;
18398
18399
  }
18399
18400
  }
18401
+ function isNonNullAccess(node) {
18402
+ const kind = node.kind;
18403
+ return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
18404
+ }
18400
18405
  var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
18401
18406
  var init_utilities = __esm({
18402
18407
  "src/compiler/utilities.ts"() {
@@ -38031,7 +38036,8 @@ ${lanes.join("\n")}
38031
38036
  conditions,
38032
38037
  requestContainingDirectory: containingDirectory,
38033
38038
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
38034
- isConfigLookup: false
38039
+ isConfigLookup: false,
38040
+ candidateIsFromPackageJsonField: false
38035
38041
  };
38036
38042
  let resolved = primaryLookup();
38037
38043
  let primary = true;
@@ -38889,7 +38895,8 @@ ${lanes.join("\n")}
38889
38895
  conditions,
38890
38896
  requestContainingDirectory: containingDirectory,
38891
38897
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
38892
- isConfigLookup
38898
+ isConfigLookup,
38899
+ candidateIsFromPackageJsonField: false
38893
38900
  };
38894
38901
  if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
38895
38902
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
@@ -39112,7 +39119,7 @@ ${lanes.join("\n")}
39112
39119
  }
39113
39120
  function tryExtension(ext, resolvedUsingTsExtension) {
39114
39121
  const path = tryFile(candidate + ext, onlyRecordFailures, state);
39115
- return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
39122
+ return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
39116
39123
  }
39117
39124
  }
39118
39125
  function tryFile(fileName, onlyRecordFailures, state) {
@@ -39259,7 +39266,8 @@ ${lanes.join("\n")}
39259
39266
  conditions: emptyArray,
39260
39267
  requestContainingDirectory: void 0,
39261
39268
  reportDiagnostic: noop,
39262
- isConfigLookup: false
39269
+ isConfigLookup: false,
39270
+ candidateIsFromPackageJsonField: false
39263
39271
  };
39264
39272
  }
39265
39273
  function getPackageScopeForPath(fileName, state) {
@@ -39347,6 +39355,8 @@ ${lanes.join("\n")}
39347
39355
  }
39348
39356
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
39349
39357
  const features = state2.features;
39358
+ const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
39359
+ state2.candidateIsFromPackageJsonField = true;
39350
39360
  if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
39351
39361
  state2.features &= ~32 /* EsmMode */;
39352
39362
  }
@@ -39359,6 +39369,7 @@ ${lanes.join("\n")}
39359
39369
  false
39360
39370
  );
39361
39371
  state2.features = features;
39372
+ state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
39362
39373
  return result;
39363
39374
  };
39364
39375
  const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
@@ -39432,7 +39443,10 @@ ${lanes.join("\n")}
39432
39443
  return void 0;
39433
39444
  }
39434
39445
  const trailingParts = parts.slice(nameParts.length);
39435
- return loadModuleFromExports(scope, extensions, !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`, state, cache, redirectedReference);
39446
+ const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
39447
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
39448
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
39449
+ return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
39436
39450
  }
39437
39451
  function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
39438
39452
  if (!scope.contents.packageJsonContent.exports) {
@@ -40090,7 +40104,8 @@ ${lanes.join("\n")}
40090
40104
  conditions: [],
40091
40105
  requestContainingDirectory: containingDirectory,
40092
40106
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
40093
- isConfigLookup: false
40107
+ isConfigLookup: false,
40108
+ candidateIsFromPackageJsonField: false
40094
40109
  };
40095
40110
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
40096
40111
  return createResolvedModuleWithFailedLookupLocations(
@@ -40169,7 +40184,8 @@ ${lanes.join("\n")}
40169
40184
  conditions: [],
40170
40185
  requestContainingDirectory: void 0,
40171
40186
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
40172
- isConfigLookup: false
40187
+ isConfigLookup: false,
40188
+ candidateIsFromPackageJsonField: false
40173
40189
  };
40174
40190
  const resolved = loadModuleFromImmediateNodeModulesDirectory(
40175
40191
  4 /* Declaration */,
@@ -53064,7 +53080,17 @@ ${lanes.join("\n")}
53064
53080
  }
53065
53081
  }
53066
53082
  function getOuterTypeParametersOfClassOrInterface(symbol) {
53067
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 261 /* InterfaceDeclaration */);
53083
+ var _a2;
53084
+ const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
53085
+ if (decl.kind === 261 /* InterfaceDeclaration */) {
53086
+ return true;
53087
+ }
53088
+ if (decl.kind !== 257 /* VariableDeclaration */) {
53089
+ return false;
53090
+ }
53091
+ const initializer = decl.initializer;
53092
+ return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
53093
+ });
53068
53094
  Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
53069
53095
  return getOuterTypeParameters(declaration);
53070
53096
  }
@@ -59949,21 +59975,7 @@ ${lanes.join("\n")}
59949
59975
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
59950
59976
  for (let i = 0; i < paramCount; i++) {
59951
59977
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
59952
- let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
59953
- if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
59954
- targetType = mapType(targetType, (t) => {
59955
- if (!isTupleType(t) || isTypeIdenticalTo(sourceType, t)) {
59956
- return t;
59957
- }
59958
- const elementTypes = [];
59959
- const elementFlags = [];
59960
- for (let i2 = 0; i2 < getTypeReferenceArity(sourceType); i2++) {
59961
- elementTypes.push(getTupleElementType(t, i2));
59962
- elementFlags.push(sourceType.target.elementFlags[i2]);
59963
- }
59964
- return createTupleType(elementTypes, elementFlags);
59965
- });
59966
- }
59978
+ const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
59967
59979
  if (sourceType && targetType) {
59968
59980
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
59969
59981
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -64423,7 +64435,7 @@ ${lanes.join("\n")}
64423
64435
  if (signature) {
64424
64436
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : void 0;
64425
64437
  if (inference.contraCandidates) {
64426
- const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other === inference || getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
64438
+ const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
64427
64439
  inferredType = useCovariantType ? inferredCovariantType : getContravariantInference(inference);
64428
64440
  } else if (inferredCovariantType) {
64429
64441
  inferredType = inferredCovariantType;
@@ -65899,12 +65911,13 @@ ${lanes.join("\n")}
65899
65911
  if (propName === void 0) {
65900
65912
  return type;
65901
65913
  }
65902
- const removeNullable = strictNullChecks && isOptionalChain(access) && maybeTypeOfKind(type, 98304 /* Nullable */);
65914
+ const optionalChain = isOptionalChain(access);
65915
+ const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
65903
65916
  let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
65904
65917
  if (!propType) {
65905
65918
  return type;
65906
65919
  }
65907
- propType = removeNullable ? getOptionalType(propType) : propType;
65920
+ propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
65908
65921
  const narrowedPropType = narrowType2(propType);
65909
65922
  return filterType(type, (t) => {
65910
65923
  const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
@@ -102791,6 +102804,9 @@ ${lanes.join("\n")}
102791
102804
  case 259 /* FunctionDeclaration */:
102792
102805
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
102793
102806
  break;
102807
+ case 192 /* InferType */:
102808
+ diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
102809
+ break;
102794
102810
  case 262 /* TypeAliasDeclaration */:
102795
102811
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
102796
102812
  break;
@@ -176598,6 +176614,7 @@ ${e.message}`;
176598
176614
  isNonContextualKeyword: () => isNonContextualKeyword,
176599
176615
  isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
176600
176616
  isNonGlobalDeclaration: () => isNonGlobalDeclaration,
176617
+ isNonNullAccess: () => isNonNullAccess,
176601
176618
  isNonNullChain: () => isNonNullChain,
176602
176619
  isNonNullExpression: () => isNonNullExpression,
176603
176620
  isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
@@ -179238,6 +179255,7 @@ ${e.message}`;
179238
179255
  isNonContextualKeyword: () => isNonContextualKeyword,
179239
179256
  isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
179240
179257
  isNonGlobalDeclaration: () => isNonGlobalDeclaration,
179258
+ isNonNullAccess: () => isNonNullAccess,
179241
179259
  isNonNullChain: () => isNonNullChain,
179242
179260
  isNonNullExpression: () => isNonNullExpression,
179243
179261
  isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
package/lib/typescript.js CHANGED
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-insiders.20230110`;
45
+ version = `${versionMajorMinor}.0-insiders.20230111`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8023,6 +8023,7 @@ ${lanes.join("\n")}
8023
8023
  Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
8024
8024
  Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
8025
8025
  Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
8026
+ Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
8026
8027
  Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
8027
8028
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
8028
8029
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
@@ -18397,6 +18398,10 @@ ${lanes.join("\n")}
18397
18398
  return false;
18398
18399
  }
18399
18400
  }
18401
+ function isNonNullAccess(node) {
18402
+ const kind = node.kind;
18403
+ return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
18404
+ }
18400
18405
  var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
18401
18406
  var init_utilities = __esm({
18402
18407
  "src/compiler/utilities.ts"() {
@@ -38031,7 +38036,8 @@ ${lanes.join("\n")}
38031
38036
  conditions,
38032
38037
  requestContainingDirectory: containingDirectory,
38033
38038
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
38034
- isConfigLookup: false
38039
+ isConfigLookup: false,
38040
+ candidateIsFromPackageJsonField: false
38035
38041
  };
38036
38042
  let resolved = primaryLookup();
38037
38043
  let primary = true;
@@ -38889,7 +38895,8 @@ ${lanes.join("\n")}
38889
38895
  conditions,
38890
38896
  requestContainingDirectory: containingDirectory,
38891
38897
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
38892
- isConfigLookup
38898
+ isConfigLookup,
38899
+ candidateIsFromPackageJsonField: false
38893
38900
  };
38894
38901
  if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
38895
38902
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
@@ -39112,7 +39119,7 @@ ${lanes.join("\n")}
39112
39119
  }
39113
39120
  function tryExtension(ext, resolvedUsingTsExtension) {
39114
39121
  const path = tryFile(candidate + ext, onlyRecordFailures, state);
39115
- return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
39122
+ return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
39116
39123
  }
39117
39124
  }
39118
39125
  function tryFile(fileName, onlyRecordFailures, state) {
@@ -39259,7 +39266,8 @@ ${lanes.join("\n")}
39259
39266
  conditions: emptyArray,
39260
39267
  requestContainingDirectory: void 0,
39261
39268
  reportDiagnostic: noop,
39262
- isConfigLookup: false
39269
+ isConfigLookup: false,
39270
+ candidateIsFromPackageJsonField: false
39263
39271
  };
39264
39272
  }
39265
39273
  function getPackageScopeForPath(fileName, state) {
@@ -39347,6 +39355,8 @@ ${lanes.join("\n")}
39347
39355
  }
39348
39356
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
39349
39357
  const features = state2.features;
39358
+ const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
39359
+ state2.candidateIsFromPackageJsonField = true;
39350
39360
  if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
39351
39361
  state2.features &= ~32 /* EsmMode */;
39352
39362
  }
@@ -39359,6 +39369,7 @@ ${lanes.join("\n")}
39359
39369
  false
39360
39370
  );
39361
39371
  state2.features = features;
39372
+ state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
39362
39373
  return result;
39363
39374
  };
39364
39375
  const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
@@ -39432,7 +39443,10 @@ ${lanes.join("\n")}
39432
39443
  return void 0;
39433
39444
  }
39434
39445
  const trailingParts = parts.slice(nameParts.length);
39435
- return loadModuleFromExports(scope, extensions, !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`, state, cache, redirectedReference);
39446
+ const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
39447
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
39448
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
39449
+ return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
39436
39450
  }
39437
39451
  function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
39438
39452
  if (!scope.contents.packageJsonContent.exports) {
@@ -40090,7 +40104,8 @@ ${lanes.join("\n")}
40090
40104
  conditions: [],
40091
40105
  requestContainingDirectory: containingDirectory,
40092
40106
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
40093
- isConfigLookup: false
40107
+ isConfigLookup: false,
40108
+ candidateIsFromPackageJsonField: false
40094
40109
  };
40095
40110
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
40096
40111
  return createResolvedModuleWithFailedLookupLocations(
@@ -40169,7 +40184,8 @@ ${lanes.join("\n")}
40169
40184
  conditions: [],
40170
40185
  requestContainingDirectory: void 0,
40171
40186
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
40172
- isConfigLookup: false
40187
+ isConfigLookup: false,
40188
+ candidateIsFromPackageJsonField: false
40173
40189
  };
40174
40190
  const resolved = loadModuleFromImmediateNodeModulesDirectory(
40175
40191
  4 /* Declaration */,
@@ -53064,7 +53080,17 @@ ${lanes.join("\n")}
53064
53080
  }
53065
53081
  }
53066
53082
  function getOuterTypeParametersOfClassOrInterface(symbol) {
53067
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 261 /* InterfaceDeclaration */);
53083
+ var _a2;
53084
+ const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
53085
+ if (decl.kind === 261 /* InterfaceDeclaration */) {
53086
+ return true;
53087
+ }
53088
+ if (decl.kind !== 257 /* VariableDeclaration */) {
53089
+ return false;
53090
+ }
53091
+ const initializer = decl.initializer;
53092
+ return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
53093
+ });
53068
53094
  Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
53069
53095
  return getOuterTypeParameters(declaration);
53070
53096
  }
@@ -59949,21 +59975,7 @@ ${lanes.join("\n")}
59949
59975
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
59950
59976
  for (let i = 0; i < paramCount; i++) {
59951
59977
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
59952
- let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
59953
- if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
59954
- targetType = mapType(targetType, (t) => {
59955
- if (!isTupleType(t) || isTypeIdenticalTo(sourceType, t)) {
59956
- return t;
59957
- }
59958
- const elementTypes = [];
59959
- const elementFlags = [];
59960
- for (let i2 = 0; i2 < getTypeReferenceArity(sourceType); i2++) {
59961
- elementTypes.push(getTupleElementType(t, i2));
59962
- elementFlags.push(sourceType.target.elementFlags[i2]);
59963
- }
59964
- return createTupleType(elementTypes, elementFlags);
59965
- });
59966
- }
59978
+ const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
59967
59979
  if (sourceType && targetType) {
59968
59980
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
59969
59981
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -64423,7 +64435,7 @@ ${lanes.join("\n")}
64423
64435
  if (signature) {
64424
64436
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : void 0;
64425
64437
  if (inference.contraCandidates) {
64426
- const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other === inference || getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
64438
+ const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
64427
64439
  inferredType = useCovariantType ? inferredCovariantType : getContravariantInference(inference);
64428
64440
  } else if (inferredCovariantType) {
64429
64441
  inferredType = inferredCovariantType;
@@ -65899,12 +65911,13 @@ ${lanes.join("\n")}
65899
65911
  if (propName === void 0) {
65900
65912
  return type;
65901
65913
  }
65902
- const removeNullable = strictNullChecks && isOptionalChain(access) && maybeTypeOfKind(type, 98304 /* Nullable */);
65914
+ const optionalChain = isOptionalChain(access);
65915
+ const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
65903
65916
  let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
65904
65917
  if (!propType) {
65905
65918
  return type;
65906
65919
  }
65907
- propType = removeNullable ? getOptionalType(propType) : propType;
65920
+ propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
65908
65921
  const narrowedPropType = narrowType2(propType);
65909
65922
  return filterType(type, (t) => {
65910
65923
  const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
@@ -102791,6 +102804,9 @@ ${lanes.join("\n")}
102791
102804
  case 259 /* FunctionDeclaration */:
102792
102805
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
102793
102806
  break;
102807
+ case 192 /* InferType */:
102808
+ diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
102809
+ break;
102794
102810
  case 262 /* TypeAliasDeclaration */:
102795
102811
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
102796
102812
  break;
@@ -165765,6 +165781,7 @@ ${options.prefix}` : "\n" : options.prefix
165765
165781
  isNonContextualKeyword: () => isNonContextualKeyword,
165766
165782
  isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
165767
165783
  isNonGlobalDeclaration: () => isNonGlobalDeclaration,
165784
+ isNonNullAccess: () => isNonNullAccess,
165768
165785
  isNonNullChain: () => isNonNullChain,
165769
165786
  isNonNullExpression: () => isNonNullExpression,
165770
165787
  isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.0";
57
- var version = `${versionMajorMinor}.0-insiders.20230110`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230111`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -6207,6 +6207,7 @@ var Diagnostics = {
6207
6207
  Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
6208
6208
  Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
6209
6209
  Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
6210
+ Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
6210
6211
  Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
6211
6212
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
6212
6213
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
@@ -28484,7 +28485,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
28484
28485
  conditions,
28485
28486
  requestContainingDirectory: containingDirectory,
28486
28487
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
28487
- isConfigLookup
28488
+ isConfigLookup,
28489
+ candidateIsFromPackageJsonField: false
28488
28490
  };
28489
28491
  if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
28490
28492
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
@@ -28708,7 +28710,7 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
28708
28710
  }
28709
28711
  function tryExtension(ext, resolvedUsingTsExtension) {
28710
28712
  const path2 = tryFile(candidate + ext, onlyRecordFailures, state);
28711
- return path2 === void 0 ? void 0 : { path: path2, ext, resolvedUsingTsExtension };
28713
+ return path2 === void 0 ? void 0 : { path: path2, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
28712
28714
  }
28713
28715
  }
28714
28716
  function tryFile(fileName, onlyRecordFailures, state) {
@@ -28827,6 +28829,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
28827
28829
  }
28828
28830
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
28829
28831
  const features = state2.features;
28832
+ const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
28833
+ state2.candidateIsFromPackageJsonField = true;
28830
28834
  if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
28831
28835
  state2.features &= ~32 /* EsmMode */;
28832
28836
  }
@@ -28839,6 +28843,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
28839
28843
  false
28840
28844
  );
28841
28845
  state2.features = features;
28846
+ state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
28842
28847
  return result;
28843
28848
  };
28844
28849
  const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
@@ -28912,7 +28917,10 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
28912
28917
  return void 0;
28913
28918
  }
28914
28919
  const trailingParts = parts.slice(nameParts.length);
28915
- return loadModuleFromExports(scope, extensions, !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`, state, cache, redirectedReference);
28920
+ const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
28921
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
28922
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
28923
+ return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
28916
28924
  }
28917
28925
  function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
28918
28926
  if (!scope.contents.packageJsonContent.exports) {
@@ -29558,7 +29566,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
29558
29566
  conditions: [],
29559
29567
  requestContainingDirectory: containingDirectory,
29560
29568
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
29561
- isConfigLookup: false
29569
+ isConfigLookup: false,
29570
+ candidateIsFromPackageJsonField: false
29562
29571
  };
29563
29572
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
29564
29573
  return createResolvedModuleWithFailedLookupLocations(
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.0.0-pr-49218-12",
5
+ "version": "5.0.0-pr-52180-17",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [