@typescript-deploys/pr-build 5.2.0-pr-54718-7 → 5.2.0-pr-54922-6

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/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230630`;
38
+ version = `${versionMajorMinor}.0-insiders.20230707`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -1464,8 +1464,8 @@ var ts = (() => {
1464
1464
  }
1465
1465
  return false;
1466
1466
  }
1467
- function createGetCanonicalFileName(useCaseSensitiveFileNames) {
1468
- return useCaseSensitiveFileNames ? identity : toFileNameLowerCase;
1467
+ function createGetCanonicalFileName(useCaseSensitiveFileNames2) {
1468
+ return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase;
1469
1469
  }
1470
1470
  function patternText({ prefix, suffix }) {
1471
1471
  return `${prefix}*${suffix}`;
@@ -5425,10 +5425,10 @@ ${lanes.join("\n")}
5425
5425
  pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
5426
5426
  }
5427
5427
  }
5428
- function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
5428
+ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
5429
5429
  const fileWatcherCallbacks = createMultiMap();
5430
5430
  const dirWatchers = /* @__PURE__ */ new Map();
5431
- const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames);
5431
+ const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
5432
5432
  return nonPollingWatchFile;
5433
5433
  function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
5434
5434
  const filePath = toCanonicalName(fileName);
@@ -5504,8 +5504,8 @@ ${lanes.join("\n")}
5504
5504
  pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue");
5505
5505
  }
5506
5506
  }
5507
- function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
5508
- const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
5507
+ function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) {
5508
+ const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
5509
5509
  const path = toCanonicalFileName(name);
5510
5510
  const existing = cache.get(path);
5511
5511
  if (existing) {
@@ -5555,7 +5555,7 @@ ${lanes.join("\n")}
5555
5555
  }
5556
5556
  function createDirectoryWatcherSupportingRecursive({
5557
5557
  watchDirectory,
5558
- useCaseSensitiveFileNames,
5558
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
5559
5559
  getCurrentDirectory,
5560
5560
  getAccessibleSortedChildDirectories,
5561
5561
  fileSystemEntryExists,
@@ -5567,8 +5567,8 @@ ${lanes.join("\n")}
5567
5567
  const callbackCache = createMultiMap();
5568
5568
  const cacheToUpdateChildWatches = /* @__PURE__ */ new Map();
5569
5569
  let timerToUpdateChildWatches;
5570
- const filePathComparer = getStringComparer(!useCaseSensitiveFileNames);
5571
- const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames);
5570
+ const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2);
5571
+ const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2);
5572
5572
  return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options);
5573
5573
  function createDirectoryWatcher(dirName, options, callback) {
5574
5574
  const dirPath = toCanonicalFilePath(dirName);
@@ -5735,12 +5735,12 @@ ${lanes.join("\n")}
5735
5735
  }
5736
5736
  }
5737
5737
  function isIgnoredPath(path, options) {
5738
- return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames, getCurrentDirectory);
5738
+ return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
5739
5739
  }
5740
5740
  function isInPath(path, searchPath) {
5741
5741
  if (stringContains(path, searchPath))
5742
5742
  return true;
5743
- if (useCaseSensitiveFileNames)
5743
+ if (useCaseSensitiveFileNames2)
5744
5744
  return false;
5745
5745
  return stringContains(toCanonicalFilePath(path), searchPath);
5746
5746
  }
@@ -5758,14 +5758,14 @@ ${lanes.join("\n")}
5758
5758
  }
5759
5759
  };
5760
5760
  }
5761
- function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames, getCurrentDirectory) {
5762
- return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames, getCurrentDirectory()));
5761
+ function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
5762
+ return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames2, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2, getCurrentDirectory()));
5763
5763
  }
5764
- function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory) {
5764
+ function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
5765
5765
  return (eventName, relativeFileName) => {
5766
5766
  if (eventName === "rename") {
5767
5767
  const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName));
5768
- if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames, getCurrentDirectory)) {
5768
+ if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) {
5769
5769
  callback(fileName);
5770
5770
  }
5771
5771
  }
@@ -5778,7 +5778,7 @@ ${lanes.join("\n")}
5778
5778
  clearTimeout: clearTimeout2,
5779
5779
  fsWatchWorker,
5780
5780
  fileSystemEntryExists,
5781
- useCaseSensitiveFileNames,
5781
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
5782
5782
  getCurrentDirectory,
5783
5783
  fsSupportsRecursiveFsWatch,
5784
5784
  getAccessibleSortedChildDirectories,
@@ -5850,7 +5850,7 @@ ${lanes.join("\n")}
5850
5850
  );
5851
5851
  case 5 /* UseFsEventsOnParentDirectory */:
5852
5852
  if (!nonPollingWatchFile) {
5853
- nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames);
5853
+ nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
5854
5854
  }
5855
5855
  return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
5856
5856
  default:
@@ -5899,7 +5899,7 @@ ${lanes.join("\n")}
5899
5899
  return fsWatch(
5900
5900
  directoryName,
5901
5901
  1 /* Directory */,
5902
- createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory),
5902
+ createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
5903
5903
  recursive,
5904
5904
  500 /* Medium */,
5905
5905
  getFallbackOptions(options)
@@ -5907,7 +5907,7 @@ ${lanes.join("\n")}
5907
5907
  }
5908
5908
  if (!hostRecursiveDirectoryWatcher) {
5909
5909
  hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
5910
- useCaseSensitiveFileNames,
5910
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
5911
5911
  getCurrentDirectory,
5912
5912
  fileSystemEntryExists,
5913
5913
  getAccessibleSortedChildDirectories,
@@ -5953,7 +5953,7 @@ ${lanes.join("\n")}
5953
5953
  return fsWatch(
5954
5954
  directoryName,
5955
5955
  1 /* Directory */,
5956
- createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory),
5956
+ createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
5957
5957
  recursive,
5958
5958
  500 /* Medium */,
5959
5959
  getFallbackOptions(watchDirectoryOptions)
@@ -5981,7 +5981,7 @@ ${lanes.join("\n")}
5981
5981
  function pollingWatchFile(fileName, callback, pollingInterval, options) {
5982
5982
  return createSingleWatcherPerName(
5983
5983
  pollingWatches,
5984
- useCaseSensitiveFileNames,
5984
+ useCaseSensitiveFileNames2,
5985
5985
  fileName,
5986
5986
  callback,
5987
5987
  (cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options)
@@ -5990,7 +5990,7 @@ ${lanes.join("\n")}
5990
5990
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
5991
5991
  return createSingleWatcherPerName(
5992
5992
  recursive ? fsWatchesRecursive : fsWatches,
5993
- useCaseSensitiveFileNames,
5993
+ useCaseSensitiveFileNames2,
5994
5994
  fileOrDirectory,
5995
5995
  callback,
5996
5996
  (cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions)
@@ -6149,7 +6149,7 @@ ${lanes.join("\n")}
6149
6149
  const Buffer2 = require("buffer").Buffer;
6150
6150
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
6151
6151
  const platform = _os.platform();
6152
- const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
6152
+ const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
6153
6153
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
6154
6154
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
6155
6155
  const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
@@ -6160,7 +6160,7 @@ ${lanes.join("\n")}
6160
6160
  setTimeout,
6161
6161
  clearTimeout,
6162
6162
  fsWatchWorker,
6163
- useCaseSensitiveFileNames,
6163
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
6164
6164
  getCurrentDirectory,
6165
6165
  fileSystemEntryExists,
6166
6166
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
@@ -6177,7 +6177,7 @@ ${lanes.join("\n")}
6177
6177
  const nodeSystem = {
6178
6178
  args: process.argv.slice(2),
6179
6179
  newLine: _os.EOL,
6180
- useCaseSensitiveFileNames,
6180
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
6181
6181
  write(s) {
6182
6182
  process.stdout.write(s);
6183
6183
  },
@@ -6306,12 +6306,12 @@ ${lanes.join("\n")}
6306
6306
  for (const node of profile.nodes) {
6307
6307
  if (node.callFrame.url) {
6308
6308
  const url = normalizeSlashes(node.callFrame.url);
6309
- if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames)) {
6309
+ if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) {
6310
6310
  node.callFrame.url = getRelativePathToDirectoryOrUrl(
6311
6311
  fileUrlRoot,
6312
6312
  url,
6313
6313
  fileUrlRoot,
6314
- createGetCanonicalFileName(useCaseSensitiveFileNames),
6314
+ createGetCanonicalFileName(useCaseSensitiveFileNames2),
6315
6315
  /*isAbsolutePathAnUrl*/
6316
6316
  true
6317
6317
  );
@@ -6491,7 +6491,7 @@ ${lanes.join("\n")}
6491
6491
  }
6492
6492
  }
6493
6493
  function readDirectory(path, extensions, excludes, includes, depth) {
6494
- return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
6494
+ return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
6495
6495
  }
6496
6496
  function fileSystemEntryExists(path, entryKind) {
6497
6497
  const originalStackTraceLimit = Error.stackTraceLimit;
@@ -8769,6 +8769,7 @@ ${lanes.join("\n")}
8769
8769
  Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1 /* Error */, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."),
8770
8770
  Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1 /* Error */, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."),
8771
8771
  Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1 /* Error */, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."),
8772
+ Signature_declarations_can_only_be_used_in_TypeScript_files: diag(8017, 1 /* Error */, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."),
8772
8773
  Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."),
8773
8774
  JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1 /* Error */, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."),
8774
8775
  JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1 /* Error */, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),
@@ -9738,7 +9739,7 @@ ${lanes.join("\n")}
9738
9739
  if (withMinus)
9739
9740
  start2--;
9740
9741
  error2(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal);
9741
- return { type: 9 /* NumericLiteral */, value: tokenValue };
9742
+ return 9 /* NumericLiteral */;
9742
9743
  }
9743
9744
  } else {
9744
9745
  mainFragment = scanNumberFragment();
@@ -9778,20 +9779,18 @@ ${lanes.join("\n")}
9778
9779
  }
9779
9780
  if (tokenFlags & 8192 /* ContainsLeadingZero */) {
9780
9781
  error2(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2);
9781
- return { type: 9 /* NumericLiteral */, value: "" + +result };
9782
+ tokenValue = "" + +result;
9783
+ return 9 /* NumericLiteral */;
9782
9784
  }
9783
9785
  if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) {
9784
9786
  checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */));
9785
- return {
9786
- type: 9 /* NumericLiteral */,
9787
- value: "" + +result
9788
- // if value is not an integer, it can be safely coerced to a number
9789
- };
9787
+ tokenValue = "" + +result;
9788
+ return 9 /* NumericLiteral */;
9790
9789
  } else {
9791
9790
  tokenValue = result;
9792
9791
  const type = checkBigIntSuffix();
9793
9792
  checkForIdentifierStartAfterNumericLiteral(start2);
9794
- return { type, value: tokenValue };
9793
+ return type;
9795
9794
  }
9796
9795
  }
9797
9796
  function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) {
@@ -10400,7 +10399,7 @@ ${lanes.join("\n")}
10400
10399
  return token = 41 /* MinusToken */;
10401
10400
  case 46 /* dot */:
10402
10401
  if (isDigit(text.charCodeAt(pos + 1))) {
10403
- tokenValue = scanNumber().value;
10402
+ scanNumber();
10404
10403
  return token = 9 /* NumericLiteral */;
10405
10404
  }
10406
10405
  if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
@@ -10518,8 +10517,7 @@ ${lanes.join("\n")}
10518
10517
  case 55 /* _7 */:
10519
10518
  case 56 /* _8 */:
10520
10519
  case 57 /* _9 */:
10521
- ({ type: token, value: tokenValue } = scanNumber());
10522
- return token;
10520
+ return token = scanNumber();
10523
10521
  case 58 /* colon */:
10524
10522
  pos++;
10525
10523
  return token = 59 /* ColonToken */;
@@ -18404,7 +18402,7 @@ ${lanes.join("\n")}
18404
18402
  function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
18405
18403
  return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
18406
18404
  }
18407
- function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
18405
+ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
18408
18406
  path = normalizePath(path);
18409
18407
  currentDirectory = normalizePath(currentDirectory);
18410
18408
  const absolutePath = combinePaths(currentDirectory, path);
@@ -18413,22 +18411,22 @@ ${lanes.join("\n")}
18413
18411
  includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
18414
18412
  includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
18415
18413
  excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
18416
- basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames)
18414
+ basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2)
18417
18415
  };
18418
18416
  }
18419
- function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
18420
- return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
18417
+ function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
18418
+ return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
18421
18419
  }
18422
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
18420
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
18423
18421
  path = normalizePath(path);
18424
18422
  currentDirectory = normalizePath(currentDirectory);
18425
- const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
18426
- const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames));
18427
- const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
18428
- const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
18423
+ const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
18424
+ const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
18425
+ const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
18426
+ const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2);
18429
18427
  const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]];
18430
18428
  const visited = /* @__PURE__ */ new Map();
18431
- const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames);
18429
+ const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2);
18432
18430
  for (const basePath of patterns.basePaths) {
18433
18431
  visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
18434
18432
  }
@@ -18470,7 +18468,7 @@ ${lanes.join("\n")}
18470
18468
  }
18471
18469
  }
18472
18470
  }
18473
- function getBasePaths(path, includes, useCaseSensitiveFileNames) {
18471
+ function getBasePaths(path, includes, useCaseSensitiveFileNames2) {
18474
18472
  const basePaths = [path];
18475
18473
  if (includes) {
18476
18474
  const includeBasePaths = [];
@@ -18478,9 +18476,9 @@ ${lanes.join("\n")}
18478
18476
  const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
18479
18477
  includeBasePaths.push(getIncludeBasePath(absolute));
18480
18478
  }
18481
- includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames));
18479
+ includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
18482
18480
  for (const includeBasePath of includeBasePaths) {
18483
- if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) {
18481
+ if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) {
18484
18482
  basePaths.push(includeBasePath);
18485
18483
  }
18486
18484
  }
@@ -29065,7 +29063,8 @@ ${lanes.join("\n")}
29065
29063
  nextToken();
29066
29064
  const statements = parseList(0 /* SourceElements */, parseStatement);
29067
29065
  Debug.assert(token() === 1 /* EndOfFileToken */);
29068
- const endOfFileToken = addJSDocComment(parseTokenNode());
29066
+ const endHasJSDoc = hasPrecedingJSDocComment();
29067
+ const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc);
29069
29068
  const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2);
29070
29069
  processCommentPragmas(sourceFile, sourceText);
29071
29070
  processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
@@ -29085,11 +29084,11 @@ ${lanes.join("\n")}
29085
29084
  parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
29086
29085
  }
29087
29086
  }
29088
- function withJSDoc(node, hasJSDoc) {
29089
- return hasJSDoc ? addJSDocComment(node) : node;
29090
- }
29091
29087
  let hasDeprecatedTag = false;
29092
- function addJSDocComment(node) {
29088
+ function withJSDoc(node, hasJSDoc) {
29089
+ if (!hasJSDoc) {
29090
+ return node;
29091
+ }
29093
29092
  Debug.assert(!node.jsDoc);
29094
29093
  const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
29095
29094
  if (jsDoc.length)
@@ -31604,12 +31603,14 @@ ${lanes.join("\n")}
31604
31603
  return arrowExpression;
31605
31604
  }
31606
31605
  const pos = getNodePos();
31606
+ const hasJSDoc = hasPrecedingJSDocComment();
31607
31607
  const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
31608
31608
  if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) {
31609
31609
  return parseSimpleArrowFunctionExpression(
31610
31610
  pos,
31611
31611
  expr,
31612
31612
  allowReturnTypeInArrowFunction,
31613
+ hasJSDoc,
31613
31614
  /*asyncModifier*/
31614
31615
  void 0
31615
31616
  );
@@ -31655,7 +31656,7 @@ ${lanes.join("\n")}
31655
31656
  ), pos);
31656
31657
  }
31657
31658
  }
31658
- function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
31659
+ function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) {
31659
31660
  Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
31660
31661
  const parameter = factory2.createParameterDeclaration(
31661
31662
  /*modifiers*/
@@ -31688,7 +31689,7 @@ ${lanes.join("\n")}
31688
31689
  equalsGreaterThanToken,
31689
31690
  body
31690
31691
  );
31691
- return addJSDocComment(finishNode(node, pos));
31692
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
31692
31693
  }
31693
31694
  function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
31694
31695
  const triState = isParenthesizedArrowFunctionExpression();
@@ -31816,9 +31817,10 @@ ${lanes.join("\n")}
31816
31817
  if (token() === 134 /* AsyncKeyword */) {
31817
31818
  if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
31818
31819
  const pos = getNodePos();
31820
+ const hasJSDoc = hasPrecedingJSDocComment();
31819
31821
  const asyncModifier = parseModifiersForArrowFunction();
31820
31822
  const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
31821
- return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
31823
+ return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier);
31822
31824
  }
31823
31825
  }
31824
31826
  return void 0;
@@ -37267,19 +37269,19 @@ ${lanes.join("\n")}
37267
37269
  const wildcardFiles = arrayFrom(wildcardFileMap.values());
37268
37270
  return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values()));
37269
37271
  }
37270
- function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames, currentDirectory) {
37272
+ function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) {
37271
37273
  const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec;
37272
37274
  if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs))
37273
37275
  return false;
37274
37276
  basePath = normalizePath(basePath);
37275
- const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames);
37277
+ const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2);
37276
37278
  if (validatedFilesSpec) {
37277
37279
  for (const fileName of validatedFilesSpec) {
37278
37280
  if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck)
37279
37281
  return false;
37280
37282
  }
37281
37283
  }
37282
- return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath);
37284
+ return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath);
37283
37285
  }
37284
37286
  function invalidDotDotAfterRecursiveWildcard(s) {
37285
37287
  const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/");
@@ -37289,17 +37291,17 @@ ${lanes.join("\n")}
37289
37291
  const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
37290
37292
  return lastDotIndex > wildcardIndex;
37291
37293
  }
37292
- function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) {
37294
+ function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) {
37293
37295
  return matchesExcludeWorker(
37294
37296
  pathToCheck,
37295
37297
  filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)),
37296
- useCaseSensitiveFileNames,
37298
+ useCaseSensitiveFileNames2,
37297
37299
  currentDirectory
37298
37300
  );
37299
37301
  }
37300
- function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) {
37302
+ function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
37301
37303
  const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
37302
- const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames);
37304
+ const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
37303
37305
  if (!excludeRegex)
37304
37306
  return false;
37305
37307
  if (excludeRegex.test(pathToCheck))
@@ -37329,9 +37331,9 @@ ${lanes.join("\n")}
37329
37331
  return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
37330
37332
  }
37331
37333
  }
37332
- function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames) {
37334
+ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
37333
37335
  const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
37334
- const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i");
37336
+ const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
37335
37337
  const wildcardDirectories = {};
37336
37338
  if (include !== void 0) {
37337
37339
  const recursiveKeys = [];
@@ -37340,7 +37342,7 @@ ${lanes.join("\n")}
37340
37342
  if (excludeRegex && excludeRegex.test(spec)) {
37341
37343
  continue;
37342
37344
  }
37343
- const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames);
37345
+ const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
37344
37346
  if (match) {
37345
37347
  const { key, flags } = match;
37346
37348
  const existingFlags = wildcardDirectories[key];
@@ -37355,7 +37357,7 @@ ${lanes.join("\n")}
37355
37357
  for (const key in wildcardDirectories) {
37356
37358
  if (hasProperty(wildcardDirectories, key)) {
37357
37359
  for (const recursiveKey of recursiveKeys) {
37358
- if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
37360
+ if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
37359
37361
  delete wildcardDirectories[key];
37360
37362
  }
37361
37363
  }
@@ -37364,20 +37366,20 @@ ${lanes.join("\n")}
37364
37366
  }
37365
37367
  return wildcardDirectories;
37366
37368
  }
37367
- function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) {
37369
+ function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
37368
37370
  const match = wildcardDirectoryPattern.exec(spec);
37369
37371
  if (match) {
37370
37372
  const questionWildcardIndex = spec.indexOf("?");
37371
37373
  const starWildcardIndex = spec.indexOf("*");
37372
37374
  const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
37373
37375
  return {
37374
- key: useCaseSensitiveFileNames ? match[0] : toFileNameLowerCase(match[0]),
37376
+ key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
37375
37377
  flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
37376
37378
  };
37377
37379
  }
37378
37380
  if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
37379
37381
  return {
37380
- key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : toFileNameLowerCase(spec)),
37382
+ key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
37381
37383
  flags: 1 /* Recursive */
37382
37384
  };
37383
37385
  }
@@ -37982,6 +37984,7 @@ ${lanes.join("\n")}
37982
37984
  {
37983
37985
  name: "checkJs",
37984
37986
  type: "boolean",
37987
+ affectsModuleResolution: true,
37985
37988
  showInSimplifiedHelpView: true,
37986
37989
  category: Diagnostics.JavaScript_Support,
37987
37990
  description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
@@ -39062,6 +39065,18 @@ ${lanes.join("\n")}
39062
39065
  result.push("JSON");
39063
39066
  return result.join(", ");
39064
39067
  }
39068
+ function extensionsToExtensionsArray(extensions) {
39069
+ const result = [];
39070
+ if (extensions & 1 /* TypeScript */)
39071
+ result.push(...supportedTSImplementationExtensions);
39072
+ if (extensions & 2 /* JavaScript */)
39073
+ result.push(...supportedJSExtensionsFlat);
39074
+ if (extensions & 4 /* Declaration */)
39075
+ result.push(...supportedDeclarationExtensions);
39076
+ if (extensions & 8 /* Json */)
39077
+ result.push(".json" /* Json */);
39078
+ return result;
39079
+ }
39065
39080
  function resolvedTypeScriptOnly(resolved) {
39066
39081
  if (!resolved) {
39067
39082
  return void 0;
@@ -39234,8 +39249,8 @@ ${lanes.join("\n")}
39234
39249
  return typeRoots;
39235
39250
  }
39236
39251
  function arePathsEqual(path1, path2, host) {
39237
- const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
39238
- return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
39252
+ const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
39253
+ return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
39239
39254
  }
39240
39255
  function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
39241
39256
  const resolvedFileName = realPath(fileName, host, traceEnabled);
@@ -40498,7 +40513,7 @@ ${lanes.join("\n")}
40498
40513
  arrayIsEqualTo
40499
40514
  );
40500
40515
  for (const conditions of conditionSets) {
40501
- const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions };
40516
+ const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host };
40502
40517
  const exportResolutions = loadEntrypointsFromExportMap(
40503
40518
  packageJsonInfo,
40504
40519
  packageJsonInfo.contents.packageJsonContent.exports,
@@ -40530,23 +40545,42 @@ ${lanes.join("\n")}
40530
40545
  return entrypoints;
40531
40546
  function loadEntrypointsFromTargetExports(target) {
40532
40547
  var _a, _b;
40533
- if (typeof target === "string" && startsWith(target, "./") && target.indexOf("*") === -1) {
40534
- const partsAfterFirst = getPathComponents(target).slice(2);
40535
- if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
40536
- return false;
40537
- }
40538
- const resolvedTarget = combinePaths(scope.packageDirectory, target);
40539
- const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
40540
- const result = loadFileNameFromPackageJsonField(
40541
- extensions,
40542
- finalPath,
40543
- /*onlyRecordFailures*/
40544
- false,
40545
- state
40546
- );
40547
- if (result) {
40548
- entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
40549
- return true;
40548
+ if (typeof target === "string" && startsWith(target, "./")) {
40549
+ if (target.indexOf("*") >= 0 && state.host.readDirectory) {
40550
+ if (target.indexOf("*") !== target.lastIndexOf("*")) {
40551
+ return false;
40552
+ }
40553
+ state.host.readDirectory(
40554
+ scope.packageDirectory,
40555
+ extensionsToExtensionsArray(extensions),
40556
+ /*excludes*/
40557
+ void 0,
40558
+ [changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))]
40559
+ ).forEach((entry) => {
40560
+ entrypoints = appendIfUnique(entrypoints, {
40561
+ path: entry,
40562
+ ext: getAnyExtensionFromPath(entry),
40563
+ resolvedUsingTsExtension: void 0
40564
+ });
40565
+ });
40566
+ } else {
40567
+ const partsAfterFirst = getPathComponents(target).slice(2);
40568
+ if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
40569
+ return false;
40570
+ }
40571
+ const resolvedTarget = combinePaths(scope.packageDirectory, target);
40572
+ const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
40573
+ const result = loadFileNameFromPackageJsonField(
40574
+ extensions,
40575
+ finalPath,
40576
+ /*onlyRecordFailures*/
40577
+ false,
40578
+ state
40579
+ );
40580
+ if (result) {
40581
+ entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
40582
+ return true;
40583
+ }
40550
40584
  }
40551
40585
  } else if (Array.isArray(target)) {
40552
40586
  for (const t of target) {
@@ -40755,6 +40789,9 @@ ${lanes.join("\n")}
40755
40789
  }
40756
40790
  const trailingParts = parts.slice(nameParts.length);
40757
40791
  const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
40792
+ if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
40793
+ return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
40794
+ }
40758
40795
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
40759
40796
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
40760
40797
  return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
@@ -41102,13 +41139,10 @@ ${lanes.join("\n")}
41102
41139
  function combineDirectoryPath(root, dir) {
41103
41140
  return ensureTrailingDirectorySeparator(combinePaths(root, dir));
41104
41141
  }
41105
- function useCaseSensitiveFileNames() {
41106
- return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
41107
- }
41108
41142
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
41109
41143
  var _a, _b, _c, _d;
41110
- if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
41111
- const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
41144
+ if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
41145
+ const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
41112
41146
  const commonSourceDirGuesses = [];
41113
41147
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
41114
41148
  const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
@@ -41137,7 +41171,7 @@ ${lanes.join("\n")}
41137
41171
  for (const commonSourceDirGuess of commonSourceDirGuesses) {
41138
41172
  const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
41139
41173
  for (const candidateDir of candidateDirectories) {
41140
- if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
41174
+ if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
41141
41175
  const pathFragment = finalPath.slice(candidateDir.length + 1);
41142
41176
  const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
41143
41177
  const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */];
@@ -41147,7 +41181,7 @@ ${lanes.join("\n")}
41147
41181
  for (const possibleExt of inputExts) {
41148
41182
  if (!extensionIsOk(extensions, possibleExt))
41149
41183
  continue;
41150
- const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
41184
+ const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state));
41151
41185
  if (state.host.fileExists(possibleInputWithInputExtension)) {
41152
41186
  return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
41153
41187
  extensions,
@@ -41563,6 +41597,9 @@ ${lanes.join("\n")}
41563
41597
  trace(state.host, diagnostic, ...args);
41564
41598
  }
41565
41599
  }
41600
+ function useCaseSensitiveFileNames(state) {
41601
+ return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
41602
+ }
41566
41603
  var typeScriptVersion, nodeModulesAtTypes, NodeResolutionFeatures, nodeModulesPathPart, mangledScopedPackageSeparator;
41567
41604
  var init_moduleNameResolver = __esm({
41568
41605
  "src/compiler/moduleNameResolver.ts"() {
@@ -45068,7 +45105,9 @@ ${lanes.join("\n")}
45068
45105
  for (const { ending, value } of candidates) {
45069
45106
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
45070
45107
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
45071
- return pathIsRelative(matchedStar) ? void 0 : key.replace("*", matchedStar);
45108
+ if (!pathIsRelative(matchedStar)) {
45109
+ return key.replace("*", matchedStar);
45110
+ }
45072
45111
  }
45073
45112
  }
45074
45113
  } else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {
@@ -45140,7 +45179,7 @@ ${lanes.join("\n")}
45140
45179
  for (const key of getOwnKeys(exports)) {
45141
45180
  if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
45142
45181
  const subTarget = exports[key];
45143
- const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions);
45182
+ const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
45144
45183
  if (result) {
45145
45184
  return result;
45146
45185
  }
@@ -46198,7 +46237,7 @@ ${lanes.join("\n")}
46198
46237
  };
46199
46238
  var amalgamatedDuplicates;
46200
46239
  var reverseMappedCache = /* @__PURE__ */ new Map();
46201
- var inInferTypeForHomomorphicMappedType = false;
46240
+ var homomorphicMappedTypeInferenceStack = [];
46202
46241
  var ambientModulesCache;
46203
46242
  var patternAmbientModules;
46204
46243
  var patternAmbientModuleAugmentations;
@@ -50789,6 +50828,7 @@ ${lanes.join("\n")}
50789
50828
  );
50790
50829
  }
50791
50830
  function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
50831
+ var _a;
50792
50832
  const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
50793
50833
  if (suppressAny)
50794
50834
  context.flags &= ~256 /* SuppressAnyReturnType */;
@@ -50924,6 +50964,20 @@ ${lanes.join("\n")}
50924
50964
  if (typeArguments) {
50925
50965
  node.typeArguments = factory.createNodeArray(typeArguments);
50926
50966
  }
50967
+ if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 330 /* JSDocSignature */ && signature.declaration.parent.kind === 346 /* JSDocOverloadTag */) {
50968
+ const comment = getTextOfNode(
50969
+ signature.declaration.parent.parent,
50970
+ /*includeTrivia*/
50971
+ true
50972
+ ).slice(2, -2).split(/\r\n|\n|\r/).map((line) => line.replace(/^\s+/, " ")).join("\n");
50973
+ addSyntheticLeadingComment(
50974
+ node,
50975
+ 3 /* MultiLineCommentTrivia */,
50976
+ comment,
50977
+ /*hasTrailingNewLine*/
50978
+ true
50979
+ );
50980
+ }
50927
50981
  cleanup == null ? void 0 : cleanup();
50928
50982
  return node;
50929
50983
  }
@@ -57701,7 +57755,7 @@ ${lanes.join("\n")}
57701
57755
  return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
57702
57756
  }
57703
57757
  const node = type.node;
57704
- const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, (element) => removeMissingType(getTypeFromTypeNode(element), element.kind === 190 /* OptionalType */));
57758
+ const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
57705
57759
  if (popTypeResolution()) {
57706
57760
  type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
57707
57761
  } else {
@@ -65587,17 +65641,18 @@ ${lanes.join("\n")}
65587
65641
  );
65588
65642
  }
65589
65643
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
65590
- if (inInferTypeForHomomorphicMappedType) {
65591
- return void 0;
65644
+ const cacheKey = source.id + "," + target.id + "," + constraint.id;
65645
+ if (reverseMappedCache.has(cacheKey)) {
65646
+ return reverseMappedCache.get(cacheKey);
65592
65647
  }
65593
- const key = source.id + "," + target.id + "," + constraint.id;
65594
- if (reverseMappedCache.has(key)) {
65595
- return reverseMappedCache.get(key);
65648
+ const recursionKey = source.id + "," + (target.target || target).id;
65649
+ if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
65650
+ return void 0;
65596
65651
  }
65597
- inInferTypeForHomomorphicMappedType = true;
65652
+ homomorphicMappedTypeInferenceStack.push(recursionKey);
65598
65653
  const type = createReverseMappedType(source, target, constraint);
65599
- inInferTypeForHomomorphicMappedType = false;
65600
- reverseMappedCache.set(key, type);
65654
+ homomorphicMappedTypeInferenceStack.pop();
65655
+ reverseMappedCache.set(cacheKey, type);
65601
65656
  return type;
65602
65657
  }
65603
65658
  function isPartiallyInferableType(type) {
@@ -116944,14 +116999,14 @@ ${lanes.join("\n")}
116944
116999
  });
116945
117000
 
116946
117001
  // src/compiler/watchUtilities.ts
116947
- function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) {
117002
+ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) {
116948
117003
  if (!host.getDirectories || !host.readDirectory) {
116949
117004
  return void 0;
116950
117005
  }
116951
117006
  const cachedReadDirectoryResult = /* @__PURE__ */ new Map();
116952
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
117007
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
116953
117008
  return {
116954
- useCaseSensitiveFileNames,
117009
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
116955
117010
  fileExists,
116956
117011
  readFile: (path, encoding) => host.readFile(path, encoding),
116957
117012
  directoryExists: host.directoryExists && directoryExists,
@@ -117073,7 +117128,7 @@ ${lanes.join("\n")}
117073
117128
  const rootResult = tryReadDirectory2(rootDir, rootDirPath);
117074
117129
  let rootSymLinkResult;
117075
117130
  if (rootResult !== void 0) {
117076
- return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
117131
+ return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath);
117077
117132
  }
117078
117133
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
117079
117134
  function getFileSystemEntries(dir) {
@@ -117268,7 +117323,7 @@ ${lanes.join("\n")}
117268
117323
  program,
117269
117324
  extraFileExtensions,
117270
117325
  currentDirectory,
117271
- useCaseSensitiveFileNames,
117326
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
117272
117327
  writeLog,
117273
117328
  toPath: toPath3
117274
117329
  }) {
@@ -117284,7 +117339,7 @@ ${lanes.join("\n")}
117284
117339
  writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
117285
117340
  return true;
117286
117341
  }
117287
- if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
117342
+ if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) {
117288
117343
  writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`);
117289
117344
  return true;
117290
117345
  }
@@ -117341,7 +117396,7 @@ ${lanes.join("\n")}
117341
117396
  function createExcludeHandlingAddWatch(key) {
117342
117397
  return (file, cb, flags, options, detailInfo1, detailInfo2) => {
117343
117398
  var _a;
117344
- return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call(
117399
+ return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call(
117345
117400
  /*thisArgs*/
117346
117401
  void 0,
117347
117402
  file,
@@ -117353,7 +117408,7 @@ ${lanes.join("\n")}
117353
117408
  ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2);
117354
117409
  };
117355
117410
  }
117356
- function useCaseSensitiveFileNames() {
117411
+ function useCaseSensitiveFileNames2() {
117357
117412
  return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames();
117358
117413
  }
117359
117414
  function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
@@ -119371,6 +119426,14 @@ ${lanes.join("\n")}
119371
119426
  case 265 /* TypeAliasDeclaration */:
119372
119427
  diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
119373
119428
  return "skip";
119429
+ case 176 /* Constructor */:
119430
+ case 174 /* MethodDeclaration */:
119431
+ case 262 /* FunctionDeclaration */:
119432
+ if (!node.body) {
119433
+ diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files));
119434
+ return "skip";
119435
+ }
119436
+ return;
119374
119437
  case 266 /* EnumDeclaration */:
119375
119438
  const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */));
119376
119439
  diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
@@ -121285,6 +121348,9 @@ ${lanes.join("\n")}
121285
121348
  return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);
121286
121349
  },
121287
121350
  readFile: (f) => directoryStructureHost.readFile(f),
121351
+ directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),
121352
+ getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),
121353
+ realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath),
121288
121354
  useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
121289
121355
  getCurrentDirectory: () => host.getCurrentDirectory(),
121290
121356
  onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined,
@@ -124480,12 +124546,12 @@ ${lanes.join("\n")}
124480
124546
  return true;
124481
124547
  const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */);
124482
124548
  const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
124483
- const useCaseSensitiveFileNames = program.useCaseSensitiveFileNames();
124549
+ const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames();
124484
124550
  return find((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
124485
124551
  if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */))
124486
124552
  return false;
124487
124553
  const pattern = getPatternFromSpec(includeSpec, basePath, "files");
124488
- return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames).test(fileName);
124554
+ return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
124489
124555
  });
124490
124556
  }
124491
124557
  function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
@@ -124689,7 +124755,7 @@ ${lanes.join("\n")}
124689
124755
  return result;
124690
124756
  }
124691
124757
  function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
124692
- const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
124758
+ const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
124693
124759
  const compilerHost = {
124694
124760
  getSourceFile: createGetSourceFile(
124695
124761
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
@@ -124705,8 +124771,8 @@ ${lanes.join("\n")}
124705
124771
  (path) => host.directoryExists(path)
124706
124772
  ),
124707
124773
  getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
124708
- useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
124709
- getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames),
124774
+ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
124775
+ getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2),
124710
124776
  getNewLine: () => getNewLineCharacter(getCompilerOptions()),
124711
124777
  fileExists: (f) => host.fileExists(f),
124712
124778
  readFile: (f) => host.readFile(f),
@@ -124987,7 +125053,7 @@ ${lanes.join("\n")}
124987
125053
  const sourceFilesCache = /* @__PURE__ */ new Map();
124988
125054
  let missingFilePathsRequestedForRelease;
124989
125055
  let hasChangedCompilerOptions = false;
124990
- const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
125056
+ const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
124991
125057
  const currentDirectory = host.getCurrentDirectory();
124992
125058
  const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host;
124993
125059
  let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host;
@@ -124995,7 +125061,7 @@ ${lanes.join("\n")}
124995
125061
  let configFileParsingDiagnostics;
124996
125062
  let canConfigFileJsonReportNoInputFiles = false;
124997
125063
  let hasChangedConfigFileParsingErrors = false;
124998
- const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames);
125064
+ const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2);
124999
125065
  const directoryStructureHost = cachedDirectoryStructureHost || host;
125000
125066
  const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost);
125001
125067
  let newLine = updateNewLine();
@@ -125013,8 +125079,8 @@ ${lanes.join("\n")}
125013
125079
  Debug.assert(compilerOptions);
125014
125080
  Debug.assert(rootFileNames);
125015
125081
  const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions);
125016
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
125017
- writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`);
125082
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
125083
+ writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`);
125018
125084
  let configFileWatcher;
125019
125085
  if (configFileName) {
125020
125086
  configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
@@ -125520,7 +125586,7 @@ ${lanes.join("\n")}
125520
125586
  options: compilerOptions,
125521
125587
  program: getCurrentBuilderProgram() || rootFileNames,
125522
125588
  currentDirectory,
125523
- useCaseSensitiveFileNames,
125589
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
125524
125590
  writeLog,
125525
125591
  toPath: toPath3
125526
125592
  }))
@@ -125610,7 +125676,7 @@ ${lanes.join("\n")}
125610
125676
  options: config.parsedCommandLine.options,
125611
125677
  program: config.parsedCommandLine.fileNames,
125612
125678
  currentDirectory,
125613
- useCaseSensitiveFileNames,
125679
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
125614
125680
  writeLog,
125615
125681
  toPath: toPath3
125616
125682
  }))
@@ -131521,10 +131587,10 @@ ${lanes.join("\n")}
131521
131587
  }
131522
131588
  function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) {
131523
131589
  var _a, _b;
131524
- const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
131590
+ const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
131525
131591
  const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => {
131526
131592
  const pattern = getPatternFromSpec(spec, "", "exclude");
131527
- return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames) : void 0;
131593
+ return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0;
131528
131594
  });
131529
131595
  forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module2, file) => cb(
131530
131596
  module2,
@@ -133020,12 +133086,12 @@ ${lanes.join("\n")}
133020
133086
  function isDocumentRegistryEntry(entry) {
133021
133087
  return !!entry.sourceFile;
133022
133088
  }
133023
- function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) {
133024
- return createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory);
133089
+ function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
133090
+ return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
133025
133091
  }
133026
- function createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory = "", externalCache) {
133092
+ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
133027
133093
  const buckets = /* @__PURE__ */ new Map();
133028
- const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames);
133094
+ const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
133029
133095
  function reportStats() {
133030
133096
  const bucketInfoArray = arrayFrom(buckets.keys()).filter((name) => name && name.charAt(0) === "_").map((name) => {
133031
133097
  const entries = buckets.get(name);
@@ -133234,12 +133300,12 @@ ${lanes.join("\n")}
133234
133300
 
133235
133301
  // src/services/getEditsForFileRename.ts
133236
133302
  function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) {
133237
- const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
133238
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
133303
+ const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
133304
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
133239
133305
  const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper);
133240
133306
  const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper);
133241
133307
  return ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => {
133242
- updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames);
133308
+ updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames2);
133243
133309
  updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName);
133244
133310
  });
133245
133311
  }
@@ -133261,7 +133327,7 @@ ${lanes.join("\n")}
133261
133327
  const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName);
133262
133328
  return combinePathsSafe(getDirectoryPath(a1), rel);
133263
133329
  }
133264
- function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames) {
133330
+ function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) {
133265
133331
  const { configFile } = program.getCompilerOptions();
133266
133332
  if (!configFile)
133267
133333
  return;
@@ -133285,10 +133351,10 @@ ${lanes.join("\n")}
133285
133351
  /*excludes*/
133286
133352
  [],
133287
133353
  includes,
133288
- useCaseSensitiveFileNames,
133354
+ useCaseSensitiveFileNames2,
133289
133355
  currentDirectory
133290
133356
  );
133291
- if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(newFileOrDirPath)) {
133357
+ if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) {
133292
133358
  changeTracker.insertNodeAfter(configFile, last(property.initializer.elements), factory.createStringLiteral(relativePath(newFileOrDirPath)));
133293
133359
  }
133294
133360
  return;
@@ -133336,7 +133402,7 @@ ${lanes.join("\n")}
133336
133402
  configDir,
133337
133403
  path,
133338
133404
  /*ignoreCase*/
133339
- !useCaseSensitiveFileNames
133405
+ !useCaseSensitiveFileNames2
133340
133406
  );
133341
133407
  }
133342
133408
  }
@@ -136650,7 +136716,7 @@ ${lanes.join("\n")}
136650
136716
  const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax);
136651
136717
  if (typeof targetFile !== "string") {
136652
136718
  if (targetFile.statements.length > 0) {
136653
- changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], body);
136719
+ moveStatementsToTargetFile(changes, program, body, targetFile, toMove);
136654
136720
  } else {
136655
136721
  changes.insertNodesAtEndOfFile(
136656
136722
  targetFile,
@@ -137443,6 +137509,67 @@ ${lanes.join("\n")}
137443
137509
  return false;
137444
137510
  }
137445
137511
  }
137512
+ function moveStatementsToTargetFile(changes, program, statements, targetFile, toMove) {
137513
+ var _a;
137514
+ const removedExports = /* @__PURE__ */ new Set();
137515
+ const targetExports = (_a = targetFile.symbol) == null ? void 0 : _a.exports;
137516
+ if (targetExports) {
137517
+ const checker = program.getTypeChecker();
137518
+ const targetToSourceExports = /* @__PURE__ */ new Map();
137519
+ for (const node of toMove.all) {
137520
+ if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 1 /* Export */)) {
137521
+ forEachTopLevelDeclaration(node, (declaration) => {
137522
+ var _a2;
137523
+ const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0;
137524
+ const exportDeclaration = firstDefined(targetDeclarations, (d) => isExportDeclaration(d) ? d : isExportSpecifier(d) ? tryCast(d.parent.parent, isExportDeclaration) : void 0);
137525
+ if (exportDeclaration && exportDeclaration.moduleSpecifier) {
137526
+ targetToSourceExports.set(
137527
+ exportDeclaration,
137528
+ (targetToSourceExports.get(exportDeclaration) || /* @__PURE__ */ new Set()).add(declaration)
137529
+ );
137530
+ }
137531
+ });
137532
+ }
137533
+ }
137534
+ for (const [exportDeclaration, topLevelDeclarations] of arrayFrom(targetToSourceExports)) {
137535
+ if (exportDeclaration.exportClause && isNamedExports(exportDeclaration.exportClause) && length(exportDeclaration.exportClause.elements)) {
137536
+ const elements = exportDeclaration.exportClause.elements;
137537
+ const updatedElements = filter(elements, (elem) => find(skipAlias(elem.symbol, checker).declarations, (d) => isTopLevelDeclaration(d) && topLevelDeclarations.has(d)) === void 0);
137538
+ if (length(updatedElements) === 0) {
137539
+ changes.deleteNode(targetFile, exportDeclaration);
137540
+ removedExports.add(exportDeclaration);
137541
+ continue;
137542
+ }
137543
+ if (length(updatedElements) < length(elements)) {
137544
+ changes.replaceNode(
137545
+ targetFile,
137546
+ exportDeclaration,
137547
+ factory.updateExportDeclaration(
137548
+ exportDeclaration,
137549
+ exportDeclaration.modifiers,
137550
+ exportDeclaration.isTypeOnly,
137551
+ factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)),
137552
+ exportDeclaration.moduleSpecifier,
137553
+ exportDeclaration.assertClause
137554
+ )
137555
+ );
137556
+ }
137557
+ }
137558
+ }
137559
+ }
137560
+ const lastReExport = findLast(targetFile.statements, (n) => isExportDeclaration(n) && !!n.moduleSpecifier && !removedExports.has(n));
137561
+ if (lastReExport) {
137562
+ changes.insertNodesBefore(
137563
+ targetFile,
137564
+ lastReExport,
137565
+ statements,
137566
+ /*blankLineBetween*/
137567
+ true
137568
+ );
137569
+ } else {
137570
+ changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], statements);
137571
+ }
137572
+ }
137446
137573
  function getOverloadRangeToMove(sourceFile, statement) {
137447
137574
  if (isFunctionLikeDeclaration(statement)) {
137448
137575
  const declarations = statement.symbol.declarations;
@@ -141478,10 +141605,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141478
141605
  host.log(message);
141479
141606
  }
141480
141607
  }
141481
- const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
141482
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
141608
+ const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
141609
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
141483
141610
  const sourceMapper = getSourceMapper({
141484
- useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
141611
+ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
141485
141612
  getCurrentDirectory: () => currentDirectory,
141486
141613
  getProgram,
141487
141614
  fileExists: maybeBind(host, host.fileExists),
@@ -141529,7 +141656,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141529
141656
  getSourceFileByPath: getOrCreateSourceFileByPath,
141530
141657
  getCancellationToken: () => cancellationToken,
141531
141658
  getCanonicalFileName,
141532
- useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
141659
+ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
141533
141660
  getNewLine: () => getNewLineCharacter(newSettings),
141534
141661
  getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2),
141535
141662
  writeFile: noop,
@@ -141573,9 +141700,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141573
141700
  compilerHost.getSourceFile = getSourceFileWithCache;
141574
141701
  (_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost);
141575
141702
  const parseConfigHost = {
141576
- useCaseSensitiveFileNames,
141703
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
141577
141704
  fileExists: (fileName) => compilerHost.fileExists(fileName),
141578
141705
  readFile: (fileName) => compilerHost.readFile(fileName),
141706
+ directoryExists: (f) => compilerHost.directoryExists(f),
141707
+ getDirectories: (f) => compilerHost.getDirectories(f),
141708
+ realpath: compilerHost.realpath,
141579
141709
  readDirectory: (...args) => compilerHost.readDirectory(...args),
141580
141710
  trace: compilerHost.trace,
141581
141711
  getCurrentDirectory: compilerHost.getCurrentDirectory,
@@ -156914,6 +157044,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
156914
157044
  data = originToCompletionEntryData(origin);
156915
157045
  hasAction = !importStatementCompletion;
156916
157046
  }
157047
+ const parentNamedImportOrExport = findAncestor(location, isNamedImportsOrExports);
157048
+ if ((parentNamedImportOrExport == null ? void 0 : parentNamedImportOrExport.kind) === 275 /* NamedImports */) {
157049
+ const possibleToken = stringToToken(name);
157050
+ if (parentNamedImportOrExport && possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) {
157051
+ insertText = `${name} as ${name}_`;
157052
+ }
157053
+ }
156917
157054
  return {
156918
157055
  name,
156919
157056
  kind: ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location),
@@ -157694,7 +157831,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157694
157831
  }
157695
157832
  function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) {
157696
157833
  if (data == null ? void 0 : data.moduleSpecifier) {
157697
- if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) {
157834
+ if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken, sourceFile).replacementSpan) {
157698
157835
  return { codeActions: void 0, sourceDisplay: [textPart(data.moduleSpecifier)] };
157699
157836
  }
157700
157837
  }
@@ -157907,7 +158044,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157907
158044
  let isNewIdentifierLocation = false;
157908
158045
  let flags = 0 /* None */;
157909
158046
  if (contextToken) {
157910
- const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken);
158047
+ const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile);
157911
158048
  if (importStatementCompletionInfo.keywordCompletion) {
157912
158049
  if (importStatementCompletionInfo.isKeywordOnlyCompletion) {
157913
158050
  return {
@@ -159538,7 +159675,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159538
159675
  }
159539
159676
  return void 0;
159540
159677
  }
159541
- function getImportStatementCompletionInfo(contextToken) {
159678
+ function getImportStatementCompletionInfo(contextToken, sourceFile) {
159542
159679
  var _a, _b, _c;
159543
159680
  let keywordCompletion;
159544
159681
  let isKeywordOnlyCompletion = false;
@@ -159554,6 +159691,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159554
159691
  function getCandidate() {
159555
159692
  const parent2 = contextToken.parent;
159556
159693
  if (isImportEqualsDeclaration(parent2)) {
159694
+ const lastToken = parent2.getLastToken(sourceFile);
159695
+ if (isIdentifier(contextToken) && lastToken !== contextToken) {
159696
+ keywordCompletion = 161 /* FromKeyword */;
159697
+ isKeywordOnlyCompletion = true;
159698
+ return void 0;
159699
+ }
159557
159700
  keywordCompletion = contextToken.kind === 156 /* TypeKeyword */ ? void 0 : 156 /* TypeKeyword */;
159558
159701
  return isModuleSpecifierMissingOrEmpty(parent2.moduleReference) ? parent2 : void 0;
159559
159702
  }
@@ -160121,7 +160264,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160121
160264
  extensionOptions,
160122
160265
  host,
160123
160266
  /*moduleSpecifierIsRelative*/
160124
- false,
160267
+ true,
160125
160268
  scriptPath
160126
160269
  ).values());
160127
160270
  }
@@ -160453,16 +160596,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160453
160596
  const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
160454
160597
  const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory;
160455
160598
  const normalizedSuffix = normalizePath(parsed.suffix);
160599
+ const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix);
160600
+ const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix];
160456
160601
  const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory));
160457
160602
  const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase;
160458
- const includeGlob = normalizedSuffix ? "**/*" + normalizedSuffix : "./*";
160603
+ const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"];
160459
160604
  const matches = mapDefined(tryReadDirectory(
160460
160605
  host,
160461
160606
  baseDirectory,
160462
160607
  extensionOptions.extensionsToSearch,
160463
160608
  /*exclude*/
160464
160609
  void 0,
160465
- [includeGlob]
160610
+ includeGlobs
160466
160611
  ), (match) => {
160467
160612
  const trimmedWithPattern = trimPrefixAndSuffix(match);
160468
160613
  if (trimmedWithPattern) {
@@ -160476,8 +160621,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160476
160621
  const directories = normalizedSuffix ? emptyArray : mapDefined(tryGetDirectories(host, baseDirectory), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir));
160477
160622
  return [...matches, ...directories];
160478
160623
  function trimPrefixAndSuffix(path) {
160479
- const inner = withoutStartAndEnd(normalizePath(path), completePrefix, normalizedSuffix);
160480
- return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
160624
+ return firstDefined(matchingSuffixes, (suffix) => {
160625
+ const inner = withoutStartAndEnd(normalizePath(path), completePrefix, suffix);
160626
+ return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
160627
+ });
160481
160628
  }
160482
160629
  }
160483
160630
  function withoutStartAndEnd(s, start, end) {
@@ -167792,6 +167939,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
167792
167939
  insertNodeBefore(sourceFile, before, newNode, blankLineBetween = false, options = {}) {
167793
167940
  this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween));
167794
167941
  }
167942
+ insertNodesBefore(sourceFile, before, newNodes, blankLineBetween = false, options = {}) {
167943
+ this.insertNodesAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNodes, this.getOptionsForInsertNodeBefore(before, first(newNodes), blankLineBetween));
167944
+ }
167795
167945
  insertModifierAt(sourceFile, pos, modifier, options = {}) {
167796
167946
  this.insertNodeAt(sourceFile, pos, factory.createToken(modifier), options);
167797
167947
  }