typescript 5.7.0-dev.20241015 → 5.7.0-dev.20241017

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.7";
21
- var version = `${versionMajorMinor}.0-dev.20241015`;
21
+ var version = `${versionMajorMinor}.0-dev.20241017`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -17376,6 +17376,13 @@ function getLastChild(node) {
17376
17376
  });
17377
17377
  return lastChild;
17378
17378
  }
17379
+ function addToSeen(seen, key) {
17380
+ if (seen.has(key)) {
17381
+ return false;
17382
+ }
17383
+ seen.add(key);
17384
+ return true;
17385
+ }
17379
17386
  function isTypeNodeKind(kind) {
17380
17387
  return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 163 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 233 /* ExpressionWithTypeArguments */ || kind === 312 /* JSDocAllType */ || kind === 313 /* JSDocUnknownType */ || kind === 314 /* JSDocNullableType */ || kind === 315 /* JSDocNonNullableType */ || kind === 316 /* JSDocOptionalType */ || kind === 317 /* JSDocFunctionType */ || kind === 318 /* JSDocVariadicType */;
17381
17388
  }
@@ -29531,10 +29538,12 @@ var Parser;
29531
29538
  case 90 /* DefaultKeyword */:
29532
29539
  return nextTokenCanFollowDefaultKeyword();
29533
29540
  case 126 /* StaticKeyword */:
29541
+ nextToken();
29542
+ return canFollowModifier();
29534
29543
  case 139 /* GetKeyword */:
29535
29544
  case 153 /* SetKeyword */:
29536
29545
  nextToken();
29537
- return canFollowModifier();
29546
+ return canFollowGetOrSetKeyword();
29538
29547
  default:
29539
29548
  return nextTokenIsOnSameLineAndCanFollowModifier();
29540
29549
  }
@@ -29552,6 +29561,9 @@ var Parser;
29552
29561
  function canFollowModifier() {
29553
29562
  return token() === 23 /* OpenBracketToken */ || token() === 19 /* OpenBraceToken */ || token() === 42 /* AsteriskToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
29554
29563
  }
29564
+ function canFollowGetOrSetKeyword() {
29565
+ return token() === 23 /* OpenBracketToken */ || isLiteralPropertyName();
29566
+ }
29555
29567
  function nextTokenCanFollowDefaultKeyword() {
29556
29568
  nextToken();
29557
29569
  return token() === 86 /* ClassKeyword */ || token() === 100 /* FunctionKeyword */ || token() === 120 /* InterfaceKeyword */ || token() === 60 /* AtToken */ || token() === 128 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 134 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
@@ -38162,7 +38174,7 @@ function convertToTSConfig(configParseResult, configFileName, host) {
38162
38174
  const providedKeys = new Set(optionMap.keys());
38163
38175
  const impliedCompilerOptions = {};
38164
38176
  for (const option in computedOptions) {
38165
- if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
38177
+ if (!providedKeys.has(option) && optionDependsOn(option, providedKeys)) {
38166
38178
  const implied = computedOptions[option].computeValue(configParseResult.options);
38167
38179
  const defaultValue = computedOptions[option].computeValue({});
38168
38180
  if (implied !== defaultValue) {
@@ -38173,6 +38185,17 @@ function convertToTSConfig(configParseResult, configFileName, host) {
38173
38185
  assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
38174
38186
  return config;
38175
38187
  }
38188
+ function optionDependsOn(option, dependsOn) {
38189
+ const seen = /* @__PURE__ */ new Set();
38190
+ return optionDependsOnRecursive(option);
38191
+ function optionDependsOnRecursive(option2) {
38192
+ var _a;
38193
+ if (addToSeen(seen, option2)) {
38194
+ return some((_a = computedOptions[option2]) == null ? void 0 : _a.dependencies, (dep) => dependsOn.has(dep) || optionDependsOnRecursive(dep));
38195
+ }
38196
+ return false;
38197
+ }
38198
+ }
38176
38199
  function optionMapToObject(optionMap) {
38177
38200
  return Object.fromEntries(optionMap);
38178
38201
  }
@@ -40473,25 +40496,28 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
40473
40496
  return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
40474
40497
  }
40475
40498
  if (!isExternalModuleNameRelative(moduleName)) {
40476
- let resolved2;
40477
40499
  if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
40478
- resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
40479
- }
40480
- if (!resolved2 && features & 4 /* SelfName */) {
40481
- resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
40500
+ const resolved3 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
40501
+ if (resolved3) {
40502
+ return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
40503
+ }
40482
40504
  }
40483
- if (!resolved2) {
40484
- if (moduleName.includes(":")) {
40485
- if (traceEnabled) {
40486
- trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
40487
- }
40488
- return void 0;
40505
+ if (features & 4 /* SelfName */) {
40506
+ const resolved3 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
40507
+ if (resolved3) {
40508
+ return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
40489
40509
  }
40510
+ }
40511
+ if (moduleName.includes(":")) {
40490
40512
  if (traceEnabled) {
40491
- trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
40513
+ trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
40492
40514
  }
40493
- resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
40515
+ return void 0;
40494
40516
  }
40517
+ if (traceEnabled) {
40518
+ trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
40519
+ }
40520
+ let resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
40495
40521
  if (extensions2 & 4 /* Declaration */) {
40496
40522
  resolved2 ?? (resolved2 = resolveFromTypeRoot(moduleName, state2));
40497
40523
  }
@@ -45075,7 +45101,7 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
45075
45101
  importMode,
45076
45102
  prefersTsExtension(allowedEndings)
45077
45103
  );
45078
- const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) : void 0;
45104
+ const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) : void 0;
45079
45105
  if (pathsOnly) {
45080
45106
  return fromPaths;
45081
45107
  }
@@ -45289,10 +45315,11 @@ function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) {
45289
45315
  return ambientModuleDeclare.name.text;
45290
45316
  }
45291
45317
  }
45292
- function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
45318
+ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) {
45293
45319
  for (const key in paths) {
45294
45320
  for (const patternText2 of paths[key]) {
45295
- const pattern = normalizePath(patternText2);
45321
+ const normalized = normalizePath(patternText2);
45322
+ const pattern = getRelativePathIfInSameVolume(normalized, baseDirectory, getCanonicalFileName) ?? normalized;
45296
45323
  const indexOfStar = pattern.indexOf("*");
45297
45324
  const candidates = allowedEndings.map((ending) => ({
45298
45325
  ending,
@@ -45621,6 +45648,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
45621
45648
  subModuleName,
45622
45649
  versionPaths.paths,
45623
45650
  allowedEndings,
45651
+ packageRootPath,
45652
+ getCanonicalFileName,
45624
45653
  host,
45625
45654
  options
45626
45655
  );
@@ -55464,7 +55493,7 @@ function createTypeChecker(host) {
55464
55493
  const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
55465
55494
  const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
55466
55495
  const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
55467
- let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration(
55496
+ let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && getWidenedTypeForVariableLikeDeclaration(
55468
55497
  accessor,
55469
55498
  /*reportErrors*/
55470
55499
  true
package/lib/typescript.js CHANGED
@@ -2277,7 +2277,7 @@ module.exports = __toCommonJS(typescript_exports);
2277
2277
 
2278
2278
  // src/compiler/corePublic.ts
2279
2279
  var versionMajorMinor = "5.7";
2280
- var version = `${versionMajorMinor}.0-dev.20241015`;
2280
+ var version = `${versionMajorMinor}.0-dev.20241017`;
2281
2281
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2282
2282
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2283
2283
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -21262,11 +21262,11 @@ function getLastChild(node) {
21262
21262
  });
21263
21263
  return lastChild;
21264
21264
  }
21265
- function addToSeen(seen, key, value = true) {
21265
+ function addToSeen(seen, key) {
21266
21266
  if (seen.has(key)) {
21267
21267
  return false;
21268
21268
  }
21269
- seen.set(key, value);
21269
+ seen.add(key);
21270
21270
  return true;
21271
21271
  }
21272
21272
  function isObjectTypeDeclaration(node) {
@@ -33783,10 +33783,12 @@ var Parser;
33783
33783
  case 90 /* DefaultKeyword */:
33784
33784
  return nextTokenCanFollowDefaultKeyword();
33785
33785
  case 126 /* StaticKeyword */:
33786
+ nextToken();
33787
+ return canFollowModifier();
33786
33788
  case 139 /* GetKeyword */:
33787
33789
  case 153 /* SetKeyword */:
33788
33790
  nextToken();
33789
- return canFollowModifier();
33791
+ return canFollowGetOrSetKeyword();
33790
33792
  default:
33791
33793
  return nextTokenIsOnSameLineAndCanFollowModifier();
33792
33794
  }
@@ -33804,6 +33806,9 @@ var Parser;
33804
33806
  function canFollowModifier() {
33805
33807
  return token() === 23 /* OpenBracketToken */ || token() === 19 /* OpenBraceToken */ || token() === 42 /* AsteriskToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
33806
33808
  }
33809
+ function canFollowGetOrSetKeyword() {
33810
+ return token() === 23 /* OpenBracketToken */ || isLiteralPropertyName();
33811
+ }
33807
33812
  function nextTokenCanFollowDefaultKeyword() {
33808
33813
  nextToken();
33809
33814
  return token() === 86 /* ClassKeyword */ || token() === 100 /* FunctionKeyword */ || token() === 120 /* InterfaceKeyword */ || token() === 60 /* AtToken */ || token() === 128 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 134 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
@@ -42424,7 +42429,7 @@ function convertToTSConfig(configParseResult, configFileName, host) {
42424
42429
  const providedKeys = new Set(optionMap.keys());
42425
42430
  const impliedCompilerOptions = {};
42426
42431
  for (const option in computedOptions) {
42427
- if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
42432
+ if (!providedKeys.has(option) && optionDependsOn(option, providedKeys)) {
42428
42433
  const implied = computedOptions[option].computeValue(configParseResult.options);
42429
42434
  const defaultValue = computedOptions[option].computeValue({});
42430
42435
  if (implied !== defaultValue) {
@@ -42435,6 +42440,17 @@ function convertToTSConfig(configParseResult, configFileName, host) {
42435
42440
  assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
42436
42441
  return config;
42437
42442
  }
42443
+ function optionDependsOn(option, dependsOn) {
42444
+ const seen = /* @__PURE__ */ new Set();
42445
+ return optionDependsOnRecursive(option);
42446
+ function optionDependsOnRecursive(option2) {
42447
+ var _a;
42448
+ if (addToSeen(seen, option2)) {
42449
+ return some((_a = computedOptions[option2]) == null ? void 0 : _a.dependencies, (dep) => dependsOn.has(dep) || optionDependsOnRecursive(dep));
42450
+ }
42451
+ return false;
42452
+ }
42453
+ }
42438
42454
  function optionMapToObject(optionMap) {
42439
42455
  return Object.fromEntries(optionMap);
42440
42456
  }
@@ -44843,25 +44859,28 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
44843
44859
  return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
44844
44860
  }
44845
44861
  if (!isExternalModuleNameRelative(moduleName)) {
44846
- let resolved2;
44847
44862
  if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
44848
- resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
44849
- }
44850
- if (!resolved2 && features & 4 /* SelfName */) {
44851
- resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
44863
+ const resolved3 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
44864
+ if (resolved3) {
44865
+ return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
44866
+ }
44852
44867
  }
44853
- if (!resolved2) {
44854
- if (moduleName.includes(":")) {
44855
- if (traceEnabled) {
44856
- trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
44857
- }
44858
- return void 0;
44868
+ if (features & 4 /* SelfName */) {
44869
+ const resolved3 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
44870
+ if (resolved3) {
44871
+ return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
44859
44872
  }
44873
+ }
44874
+ if (moduleName.includes(":")) {
44860
44875
  if (traceEnabled) {
44861
- trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
44876
+ trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
44862
44877
  }
44863
- resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
44878
+ return void 0;
44879
+ }
44880
+ if (traceEnabled) {
44881
+ trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
44864
44882
  }
44883
+ let resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
44865
44884
  if (extensions2 & 4 /* Declaration */) {
44866
44885
  resolved2 ?? (resolved2 = resolveFromTypeRoot(moduleName, state2));
44867
44886
  }
@@ -49663,7 +49682,7 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
49663
49682
  importMode,
49664
49683
  prefersTsExtension(allowedEndings)
49665
49684
  );
49666
- const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) : void 0;
49685
+ const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) : void 0;
49667
49686
  if (pathsOnly) {
49668
49687
  return fromPaths;
49669
49688
  }
@@ -49892,10 +49911,11 @@ function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) {
49892
49911
  return ambientModuleDeclare.name.text;
49893
49912
  }
49894
49913
  }
49895
- function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
49914
+ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) {
49896
49915
  for (const key in paths) {
49897
49916
  for (const patternText2 of paths[key]) {
49898
- const pattern = normalizePath(patternText2);
49917
+ const normalized = normalizePath(patternText2);
49918
+ const pattern = getRelativePathIfInSameVolume(normalized, baseDirectory, getCanonicalFileName) ?? normalized;
49899
49919
  const indexOfStar = pattern.indexOf("*");
49900
49920
  const candidates = allowedEndings.map((ending) => ({
49901
49921
  ending,
@@ -50224,6 +50244,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
50224
50244
  subModuleName,
50225
50245
  versionPaths.paths,
50226
50246
  allowedEndings,
50247
+ packageRootPath,
50248
+ getCanonicalFileName,
50227
50249
  host,
50228
50250
  options
50229
50251
  );
@@ -60067,7 +60089,7 @@ function createTypeChecker(host) {
60067
60089
  const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
60068
60090
  const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
60069
60091
  const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
60070
- let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration(
60092
+ let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && getWidenedTypeForVariableLikeDeclaration(
60071
60093
  accessor,
60072
60094
  /*reportErrors*/
60073
60095
  true
@@ -140960,7 +140982,7 @@ function getExportInfoMap(importingFile, host, program, preferences, cancellatio
140960
140982
  true,
140961
140983
  (moduleSymbol, moduleFile, program2, isFromPackageJson) => {
140962
140984
  if (++moduleCount % 100 === 0) cancellationToken == null ? void 0 : cancellationToken.throwIfCancellationRequested();
140963
- const seenExports = /* @__PURE__ */ new Map();
140985
+ const seenExports = /* @__PURE__ */ new Set();
140964
140986
  const checker = program2.getTypeChecker();
140965
140987
  const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker);
140966
140988
  if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) {
@@ -141000,7 +141022,11 @@ function getExportInfoMap(importingFile, host, program, preferences, cancellatio
141000
141022
  }
141001
141023
  function getDefaultLikeExportInfo(moduleSymbol, checker) {
141002
141024
  const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);
141003
- if (exportEquals !== moduleSymbol) return { symbol: exportEquals, exportKind: 2 /* ExportEquals */ };
141025
+ if (exportEquals !== moduleSymbol) {
141026
+ const defaultExport2 = checker.tryGetMemberInModuleExports("default" /* Default */, exportEquals);
141027
+ if (defaultExport2) return { symbol: defaultExport2, exportKind: 1 /* Default */ };
141028
+ return { symbol: exportEquals, exportKind: 2 /* ExportEquals */ };
141029
+ }
141004
141030
  const defaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol);
141005
141031
  if (defaultExport) return { symbol: defaultExport, exportKind: 1 /* Default */ };
141006
141032
  }
@@ -141018,7 +141044,7 @@ function getNamesForExportedSymbol(defaultExport, checker, scriptTarget) {
141018
141044
  function forEachNameOfDefaultExport(defaultExport, checker, scriptTarget, cb) {
141019
141045
  let chain;
141020
141046
  let current = defaultExport;
141021
- const seen = /* @__PURE__ */ new Map();
141047
+ const seen = /* @__PURE__ */ new Set();
141022
141048
  while (current) {
141023
141049
  const fromDeclaration = getDefaultLikeExportNameFromDeclaration(current);
141024
141050
  if (fromDeclaration) {
@@ -145484,7 +145510,7 @@ function flattenTypeLiteralNodeReference(checker, selection) {
145484
145510
  }
145485
145511
  if (isIntersectionTypeNode(selection)) {
145486
145512
  const result = [];
145487
- const seen = /* @__PURE__ */ new Map();
145513
+ const seen = /* @__PURE__ */ new Set();
145488
145514
  for (const type of selection.types) {
145489
145515
  const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type);
145490
145516
  if (!flattenedTypeMembers || !flattenedTypeMembers.every((type2) => type2.name && addToSeen(seen, getNameFromPropertyName(type2.name)))) {
@@ -156156,7 +156182,7 @@ registerCodeFix({
156156
156182
  },
156157
156183
  fixIds: [fixId13],
156158
156184
  getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyExport(context) {
156159
- const fixedExportDeclarations = /* @__PURE__ */ new Map();
156185
+ const fixedExportDeclarations = /* @__PURE__ */ new Set();
156160
156186
  return codeFixAll(context, errorCodes14, (changes, diag2) => {
156161
156187
  const exportSpecifier = getExportSpecifierForDiagnosticSpan(diag2, context.sourceFile);
156162
156188
  if (exportSpecifier && addToSeen(fixedExportDeclarations, getNodeId(exportSpecifier.parent.parent))) {
@@ -156635,7 +156661,7 @@ registerCodeFix({
156635
156661
  },
156636
156662
  fixIds: [fixId17],
156637
156663
  getAllCodeActions(context) {
156638
- const seenClassDeclarations = /* @__PURE__ */ new Map();
156664
+ const seenClassDeclarations = /* @__PURE__ */ new Set();
156639
156665
  return codeFixAll(context, errorCodes18, (changes, diag2) => {
156640
156666
  const classDeclaration = getClass(diag2.file, diag2.start);
156641
156667
  if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) {
@@ -158262,7 +158288,7 @@ registerCodeFix({
158262
158288
  fixIds: [fixId18],
158263
158289
  getAllCodeActions: (context) => {
158264
158290
  const { program, preferences, host } = context;
158265
- const seen = /* @__PURE__ */ new Map();
158291
+ const seen = /* @__PURE__ */ new Set();
158266
158292
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
158267
158293
  eachDiagnostic(context, errorCodes20, (diag2) => {
158268
158294
  const info = getInfo6(program, diag2.file, createTextSpan(diag2.start, diag2.length));
@@ -159196,7 +159222,7 @@ registerCodeFix({
159196
159222
  getAllCodeActions: (context) => {
159197
159223
  const { program, fixId: fixId56 } = context;
159198
159224
  const checker = program.getTypeChecker();
159199
- const seen = /* @__PURE__ */ new Map();
159225
+ const seen = /* @__PURE__ */ new Set();
159200
159226
  const typeDeclToMembers = /* @__PURE__ */ new Map();
159201
159227
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
159202
159228
  eachDiagnostic(context, errorCodes28, (diag2) => {
@@ -160121,7 +160147,7 @@ registerCodeFix({
160121
160147
  },
160122
160148
  fixIds: [fixId26],
160123
160149
  getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context) {
160124
- const seenClassDeclarations = /* @__PURE__ */ new Map();
160150
+ const seenClassDeclarations = /* @__PURE__ */ new Set();
160125
160151
  return codeFixAll(context, errorCodes32, (changes, diag2) => {
160126
160152
  const classDeclaration = getClass2(diag2.file, diag2.start);
160127
160153
  if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) {
@@ -160164,7 +160190,7 @@ registerCodeFix({
160164
160190
  fixIds: [fixId27],
160165
160191
  getAllCodeActions(context) {
160166
160192
  const { sourceFile } = context;
160167
- const seenClasses = /* @__PURE__ */ new Map();
160193
+ const seenClasses = /* @__PURE__ */ new Set();
160168
160194
  return codeFixAll(context, errorCodes33, (changes, diag2) => {
160169
160195
  const nodes = getNodes(diag2.file, diag2.start);
160170
160196
  if (!nodes) return;
@@ -162108,7 +162134,7 @@ registerCodeFix({
162108
162134
  },
162109
162135
  fixIds: [fixId38],
162110
162136
  getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) {
162111
- const seen = /* @__PURE__ */ new Map();
162137
+ const seen = /* @__PURE__ */ new Set();
162112
162138
  return codeFixAll(context, errorCodes49, (changes, diag2) => {
162113
162139
  const nodes = getNodes3(diag2.file, diag2.start);
162114
162140
  if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return;
@@ -164974,7 +165000,7 @@ registerCodeFix({
164974
165000
  },
164975
165001
  getAllCodeActions: (context) => {
164976
165002
  const { program } = context;
164977
- const seen = /* @__PURE__ */ new Map();
165003
+ const seen = /* @__PURE__ */ new Set();
164978
165004
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
164979
165005
  eachDiagnostic(context, errorCodes65, (diag2) => {
164980
165006
  const info = getInfo21(diag2.file, diag2.start, program);
@@ -167413,7 +167439,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
167413
167439
  let importSpecifierResolver;
167414
167440
  const symbolToOriginInfoMap = [];
167415
167441
  const symbolToSortTextMap = [];
167416
- const seenPropertySymbols = /* @__PURE__ */ new Map();
167442
+ const seenPropertySymbols = /* @__PURE__ */ new Set();
167417
167443
  const isTypeOnlyLocation = isTypeOnlyCompletion();
167418
167444
  const getModuleSpecifierResolutionHost = memoizeOne((isFromPackageJson) => {
167419
167445
  return createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host);
@@ -169177,10 +169203,10 @@ function isArrowFunctionBody(node) {
169177
169203
  return node.parent && isArrowFunction(node.parent) && (node.parent.body === node || // const a = () => /**/;
169178
169204
  node.kind === 39 /* EqualsGreaterThanToken */);
169179
169205
  }
169180
- function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules = /* @__PURE__ */ new Map()) {
169206
+ function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules = /* @__PURE__ */ new Set()) {
169181
169207
  return nonAliasCanBeReferencedAtTypeLocation(symbol) || nonAliasCanBeReferencedAtTypeLocation(skipAlias(symbol.exportSymbol || symbol, checker));
169182
169208
  function nonAliasCanBeReferencedAtTypeLocation(symbol2) {
169183
- return !!(symbol2.flags & 788968 /* Type */) || checker.isUnknownSymbol(symbol2) || !!(symbol2.flags & 1536 /* Module */) && addToSeen(seenModules, getSymbolId(symbol2)) && checker.getExportsOfModule(symbol2).some((e) => symbolCanBeReferencedAtTypeLocation(e, checker, seenModules));
169209
+ return !!(symbol2.flags & 788968 /* Type */) || checker.isUnknownSymbol(symbol2) || !!(symbol2.flags & 1536 /* Module */) && addToSeen(seenModules, symbol2) && checker.getExportsOfModule(symbol2).some((e) => symbolCanBeReferencedAtTypeLocation(e, checker, seenModules));
169184
169210
  }
169185
169211
  }
169186
169212
  function isDeprecated(symbol, checker) {
@@ -169525,7 +169551,7 @@ function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
169525
169551
  }
169526
169552
  function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
169527
169553
  let isNewIdentifier = false;
169528
- const uniques = /* @__PURE__ */ new Map();
169554
+ const uniques = /* @__PURE__ */ new Set();
169529
169555
  const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
169530
169556
  const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
169531
169557
  const types = flatMap(candidates, (candidate) => {
@@ -169565,7 +169591,7 @@ function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpressi
169565
169591
  hasIndexSignature: hasIndexSignature(contextualType)
169566
169592
  };
169567
169593
  }
169568
- function getStringLiteralTypes(type, uniques = /* @__PURE__ */ new Map()) {
169594
+ function getStringLiteralTypes(type, uniques = /* @__PURE__ */ new Set()) {
169569
169595
  if (!type) return emptyArray;
169570
169596
  type = skipConstraint(type);
169571
169597
  return type.isUnion() ? flatMap(type.types, (t) => getStringLiteralTypes(t, uniques)) : type.isStringLiteral() && !(type.flags & 1024 /* EnumLiteral */) && addToSeen(uniques, type.value) ? [type] : emptyArray;
@@ -170853,7 +170879,7 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
170853
170879
  referenceEntries = entries && [...entries];
170854
170880
  } else if (entries) {
170855
170881
  const queue = createQueue(entries);
170856
- const seenNodes = /* @__PURE__ */ new Map();
170882
+ const seenNodes = /* @__PURE__ */ new Set();
170857
170883
  while (!queue.isEmpty()) {
170858
170884
  const entry = queue.dequeue();
170859
170885
  if (!addToSeen(seenNodes, getNodeId(entry.node))) {
@@ -172505,10 +172531,10 @@ var Core;
172505
172531
  }
172506
172532
  }
172507
172533
  function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) {
172508
- const seen = /* @__PURE__ */ new Map();
172534
+ const seen = /* @__PURE__ */ new Set();
172509
172535
  return recur(symbol);
172510
172536
  function recur(symbol2) {
172511
- if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, getSymbolId(symbol2))) return;
172537
+ if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return;
172512
172538
  return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => {
172513
172539
  const type = checker.getTypeAtLocation(typeReference);
172514
172540
  const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
@@ -177655,7 +177681,10 @@ var ChangeTracker = class _ChangeTracker {
177655
177681
  getInsertNodeAtStartInsertOptions(sourceFile, node, indentation) {
177656
177682
  const members = getMembersOrProperties(node);
177657
177683
  const isEmpty = members.length === 0;
177658
- const isFirstInsertion = addToSeen(this.classesWithNodesInsertedAtStart, getNodeId(node), { node, sourceFile });
177684
+ const isFirstInsertion = !this.classesWithNodesInsertedAtStart.has(getNodeId(node));
177685
+ if (isFirstInsertion) {
177686
+ this.classesWithNodesInsertedAtStart.set(getNodeId(node), { node, sourceFile });
177687
+ }
177659
177688
  const insertTrailingComma = isObjectLiteralExpression(node) && (!isJsonSourceFile(sourceFile) || !isEmpty);
177660
177689
  const insertLeadingComma = isObjectLiteralExpression(node) && isJsonSourceFile(sourceFile) && isEmpty && !isFirstInsertion;
177661
177690
  return {
@@ -188041,7 +188070,7 @@ var _ProjectService = class _ProjectService {
188041
188070
  */
188042
188071
  this.filenameToScriptInfoVersion = /* @__PURE__ */ new Map();
188043
188072
  // Set of all '.js' files ever opened.
188044
- this.allJsFilesForOpenFileTelemetry = /* @__PURE__ */ new Map();
188073
+ this.allJsFilesForOpenFileTelemetry = /* @__PURE__ */ new Set();
188045
188074
  /**
188046
188075
  * maps external project file name to list of config files that were the part of this project
188047
188076
  */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.7.0-dev.20241015",
5
+ "version": "5.7.0-dev.20241017",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -116,5 +116,5 @@
116
116
  "node": "20.1.0",
117
117
  "npm": "8.19.4"
118
118
  },
119
- "gitHead": "40caf3431986884b3da7a607de22ced5d364d9fc"
119
+ "gitHead": "b8e4ed8aeb0b228f544c5736908c31f136a9f7e3"
120
120
  }