@typescript-deploys/pr-build 5.1.0-pr-53756-16 → 5.1.0-pr-51328-50

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
@@ -3753,7 +3753,6 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
3753
3753
  SignatureFlags4[SignatureFlags4["IsInnerCallChain"] = 8] = "IsInnerCallChain";
3754
3754
  SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain";
3755
3755
  SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
3756
- SignatureFlags4[SignatureFlags4["IsNonInferrable"] = 64] = "IsNonInferrable";
3757
3756
  SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 39] = "PropagatingFlags";
3758
3757
  SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags";
3759
3758
  return SignatureFlags4;
@@ -5295,6 +5294,10 @@ function isAnyDirectorySeparator(charCode) {
5295
5294
  function isRootedDiskPath(path) {
5296
5295
  return getEncodedRootLength(path) > 0;
5297
5296
  }
5297
+ function isDiskPathRoot(path) {
5298
+ const rootLength = getEncodedRootLength(path);
5299
+ return rootLength > 0 && rootLength === path.length;
5300
+ }
5298
5301
  function pathIsAbsolute(path) {
5299
5302
  return getEncodedRootLength(path) !== 0;
5300
5303
  }
@@ -5443,11 +5446,11 @@ function getPathComponents(path, currentDirectory = "") {
5443
5446
  path = combinePaths(currentDirectory, path);
5444
5447
  return pathComponents(path, getRootLength(path));
5445
5448
  }
5446
- function getPathFromPathComponents(pathComponents2) {
5449
+ function getPathFromPathComponents(pathComponents2, length2) {
5447
5450
  if (pathComponents2.length === 0)
5448
5451
  return "";
5449
5452
  const root = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]);
5450
- return root + pathComponents2.slice(1).join(directorySeparator);
5453
+ return root + pathComponents2.slice(1, length2).join(directorySeparator);
5451
5454
  }
5452
5455
  function normalizeSlashes(path) {
5453
5456
  return path.indexOf("\\") !== -1 ? path.replace(backslashRegExp, directorySeparator) : path;
@@ -7742,7 +7745,8 @@ var Diagnostics = {
7742
7745
  _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
7743
7746
  The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
7744
7747
  Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
7745
- Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
7748
+ Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
7749
+ Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type.")
7746
7750
  };
7747
7751
 
7748
7752
  // src/compiler/scanner.ts
@@ -18560,7 +18564,7 @@ function createNodeFactory(flags, baseFactory2) {
18560
18564
  function createBigIntLiteral(value) {
18561
18565
  const node = createBaseToken(10 /* BigIntLiteral */);
18562
18566
  node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n";
18563
- node.transformFlags |= 4 /* ContainsESNext */;
18567
+ node.transformFlags |= 32 /* ContainsES2020 */;
18564
18568
  return node;
18565
18569
  }
18566
18570
  function createBaseStringLiteral(text, isSingleQuote) {
@@ -20070,7 +20074,7 @@ function createNodeFactory(flags, baseFactory2) {
20070
20074
  node.transformFlags |= 1024 /* ContainsES2015 */;
20071
20075
  break;
20072
20076
  case 102 /* ImportKeyword */:
20073
- node.transformFlags |= 4 /* ContainsESNext */;
20077
+ node.transformFlags |= 32 /* ContainsES2020 */;
20074
20078
  break;
20075
20079
  default:
20076
20080
  return Debug.assertNever(keywordToken);
@@ -20598,7 +20602,7 @@ function createNodeFactory(flags, baseFactory2) {
20598
20602
  function createNamespaceExport(name) {
20599
20603
  const node = createBaseDeclaration(279 /* NamespaceExport */);
20600
20604
  node.name = name;
20601
- node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
20605
+ node.transformFlags |= propagateChildFlags(node.name) | 32 /* ContainsES2020 */;
20602
20606
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20603
20607
  return node;
20604
20608
  }
@@ -63416,13 +63420,11 @@ function createTypeChecker(host) {
63416
63420
  }
63417
63421
  }
63418
63422
  function inferFromSignature(source, target) {
63419
- if (!(source.flags & 64 /* IsNonInferrable */)) {
63420
- const saveBivariant = bivariant;
63421
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
63422
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
63423
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
63424
- bivariant = saveBivariant;
63425
- }
63423
+ const saveBivariant = bivariant;
63424
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
63425
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
63426
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
63427
+ bivariant = saveBivariant;
63426
63428
  applyToReturnTypes(source, target, inferFromTypes);
63427
63429
  }
63428
63430
  function inferFromIndexTypes(source, target) {
@@ -68166,6 +68168,12 @@ function createTypeChecker(host) {
68166
68168
  return getUnionType([jsxElementType, nullType]);
68167
68169
  }
68168
68170
  }
68171
+ function getJsxElementTypeTypeAt(location) {
68172
+ const type = getJsxType(JsxNames.ElementType, location);
68173
+ if (isErrorType(type))
68174
+ return void 0;
68175
+ return type;
68176
+ }
68169
68177
  function getJsxIntrinsicTagNamesAt(location) {
68170
68178
  const intrinsics = getJsxType(JsxNames.IntrinsicElements, location);
68171
68179
  return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray;
@@ -68228,7 +68236,22 @@ function createTypeChecker(host) {
68228
68236
  const jsxOpeningLikeNode = node;
68229
68237
  const sig = getResolvedSignature(jsxOpeningLikeNode);
68230
68238
  checkDeprecatedSignature(sig, node);
68231
- checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(jsxOpeningLikeNode), getReturnTypeOfSignature(sig), jsxOpeningLikeNode);
68239
+ const elementTypeConstraint = getJsxElementTypeTypeAt(jsxOpeningLikeNode);
68240
+ if (elementTypeConstraint !== void 0) {
68241
+ const tagName = jsxOpeningLikeNode.tagName;
68242
+ const tagType = isJsxIntrinsicIdentifier(tagName) ? getStringLiteralType(tagName.escapedText) : checkExpression(tagName);
68243
+ checkTypeRelatedTo(tagType, elementTypeConstraint, assignableRelation, tagName, Diagnostics.Its_type_0_is_not_a_valid_JSX_element_type, () => {
68244
+ const componentName = getTextOfNode(tagName);
68245
+ return chainDiagnosticMessages(
68246
+ /*details*/
68247
+ void 0,
68248
+ Diagnostics._0_cannot_be_used_as_a_JSX_component,
68249
+ componentName
68250
+ );
68251
+ });
68252
+ } else {
68253
+ checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(jsxOpeningLikeNode), getReturnTypeOfSignature(sig), jsxOpeningLikeNode);
68254
+ }
68232
68255
  }
68233
68256
  }
68234
68257
  function isKnownProperty(targetType, name, isComparingJsxAttributes) {
@@ -72322,7 +72345,7 @@ function createTypeChecker(host) {
72322
72345
  /*resolvedTypePredicate*/
72323
72346
  void 0,
72324
72347
  0,
72325
- 64 /* IsNonInferrable */
72348
+ 0 /* None */
72326
72349
  );
72327
72350
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
72328
72351
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
@@ -82987,6 +83010,7 @@ var JsxNames;
82987
83010
  JsxNames2.ElementAttributesPropertyNameContainer = "ElementAttributesProperty";
82988
83011
  JsxNames2.ElementChildrenAttributeNameContainer = "ElementChildrenAttribute";
82989
83012
  JsxNames2.Element = "Element";
83013
+ JsxNames2.ElementType = "ElementType";
82990
83014
  JsxNames2.IntrinsicAttributes = "IntrinsicAttributes";
82991
83015
  JsxNames2.IntrinsicClassAttributes = "IntrinsicClassAttributes";
82992
83016
  JsxNames2.LibraryManagedAttributes = "LibraryManagedAttributes";
@@ -118102,60 +118126,62 @@ function removeIgnoredPath(path) {
118102
118126
  }
118103
118127
  return some(ignoredPaths, (searchPath) => stringContains(path, searchPath)) ? void 0 : path;
118104
118128
  }
118105
- function canWatchDirectoryOrFile(dirPath) {
118106
- const rootLength = getRootLength(dirPath);
118107
- if (dirPath.length === rootLength) {
118108
- return false;
118109
- }
118110
- let nextDirectorySeparator = dirPath.indexOf(directorySeparator, rootLength);
118111
- if (nextDirectorySeparator === -1) {
118112
- return false;
118113
- }
118114
- let pathPartForUserCheck = dirPath.substring(rootLength, nextDirectorySeparator + 1);
118115
- const isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47 /* slash */;
118116
- if (isNonDirectorySeparatorRoot && dirPath.search(/[a-zA-Z]:/) !== 0 && // Non dos style paths
118117
- pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) {
118118
- nextDirectorySeparator = dirPath.indexOf(directorySeparator, nextDirectorySeparator + 1);
118119
- if (nextDirectorySeparator === -1) {
118120
- return false;
118121
- }
118122
- pathPartForUserCheck = dirPath.substring(rootLength + pathPartForUserCheck.length, nextDirectorySeparator + 1);
118123
- }
118124
- if (isNonDirectorySeparatorRoot && pathPartForUserCheck.search(/users\//i) !== 0) {
118125
- return true;
118129
+ function perceivedOsRootLengthForWatching(pathComponents2, length2) {
118130
+ if (length2 <= 1)
118131
+ return 1;
118132
+ let userCheckIndex = 1;
118133
+ let isDosStyle = pathComponents2[0].search(/[a-zA-Z]:/) === 0;
118134
+ if (pathComponents2[0] !== directorySeparator && !isDosStyle && // Non dos style paths
118135
+ pathComponents2[1].search(/[a-zA-Z]\$$/) === 0) {
118136
+ if (length2 === 2)
118137
+ return 2;
118138
+ userCheckIndex = 2;
118139
+ isDosStyle = true;
118126
118140
  }
118127
- for (let searchIndex = nextDirectorySeparator + 1, searchLevels = 2; searchLevels > 0; searchLevels--) {
118128
- searchIndex = dirPath.indexOf(directorySeparator, searchIndex) + 1;
118129
- if (searchIndex === 0) {
118130
- return false;
118131
- }
118141
+ if (isDosStyle && !pathComponents2[userCheckIndex].match(/^users$/i)) {
118142
+ return userCheckIndex;
118132
118143
  }
118133
- return true;
118144
+ return userCheckIndex + 2;
118145
+ }
118146
+ function canWatchDirectoryOrFile(pathComponents2, length2) {
118147
+ if (length2 === void 0)
118148
+ length2 = pathComponents2.length;
118149
+ if (length2 <= 2)
118150
+ return false;
118151
+ const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2);
118152
+ return length2 > perceivedOsRootLength + 1;
118134
118153
  }
118135
- function canWatchAtTypes(atTypes, rootPath) {
118136
- const dirPath = getDirectoryPath(getDirectoryPath(atTypes));
118137
- return dirPath === rootPath || canWatchDirectoryOrFile(dirPath);
118154
+ function canWatchAtTypes(atTypes) {
118155
+ return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes));
118138
118156
  }
118139
- function isInDirectoryPath(dir, file) {
118140
- if (dir === void 0 || file.length <= dir.length) {
118157
+ function isInDirectoryPath(dirComponents, fileOrDirComponents) {
118158
+ if (fileOrDirComponents.length < fileOrDirComponents.length)
118141
118159
  return false;
118160
+ for (let i = 0; i < dirComponents.length; i++) {
118161
+ if (fileOrDirComponents[i] !== dirComponents[i])
118162
+ return false;
118142
118163
  }
118143
- return startsWith(file, dir) && file[dir.length] === directorySeparator;
118164
+ return true;
118165
+ }
118166
+ function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) {
118167
+ return canWatchDirectoryOrFile(getPathComponents(fileOrDirPath));
118144
118168
  }
118145
118169
  function canWatchAffectingLocation(filePath) {
118146
- return canWatchDirectoryOrFile(filePath);
118147
- }
118148
- function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootSplitLength, getCurrentDirectory) {
118149
- if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
118150
- failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
118151
- const failedLookupPathSplit = failedLookupLocationPath.split(directorySeparator);
118152
- const failedLookupSplit = failedLookupLocation.split(directorySeparator);
118153
- Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`);
118154
- if (failedLookupPathSplit.length > rootSplitLength + 1) {
118155
- return {
118156
- dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(directorySeparator),
118157
- dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(directorySeparator)
118158
- };
118170
+ return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath);
118171
+ }
118172
+ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory) {
118173
+ const failedLookupPathComponents = getPathComponents(failedLookupLocationPath);
118174
+ failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
118175
+ const failedLookupComponents = getPathComponents(failedLookupLocation);
118176
+ const perceivedOsRootLength = perceivedOsRootLengthForWatching(failedLookupPathComponents, failedLookupPathComponents.length);
118177
+ if (failedLookupPathComponents.length <= perceivedOsRootLength + 1)
118178
+ return void 0;
118179
+ const nodeModulesIndex = failedLookupPathComponents.indexOf("node_modules");
118180
+ if (nodeModulesIndex !== -1 && nodeModulesIndex + 1 <= perceivedOsRootLength + 1)
118181
+ return void 0;
118182
+ if (isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
118183
+ if (failedLookupPathComponents.length > rootPathComponents.length + 1) {
118184
+ return getDirectoryOfFailedLookupWatch(failedLookupComponents, failedLookupPathComponents, Math.max(rootPathComponents.length + 1, perceivedOsRootLength + 1));
118159
118185
  } else {
118160
118186
  return {
118161
118187
  dir: rootDir,
@@ -118165,45 +118191,55 @@ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLoo
118165
118191
  }
118166
118192
  }
118167
118193
  return getDirectoryToWatchFromFailedLookupLocationDirectory(
118168
- getDirectoryPath(getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())),
118169
- getDirectoryPath(failedLookupLocationPath),
118170
- rootPath
118194
+ failedLookupComponents,
118195
+ failedLookupPathComponents,
118196
+ failedLookupPathComponents.length - 1,
118197
+ perceivedOsRootLength,
118198
+ nodeModulesIndex,
118199
+ rootPathComponents
118171
118200
  );
118172
118201
  }
118173
- function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath, rootPath) {
118174
- while (pathContainsNodeModules(dirPath)) {
118175
- dir = getDirectoryPath(dir);
118176
- dirPath = getDirectoryPath(dirPath);
118177
- }
118178
- if (isNodeModulesDirectory(dirPath)) {
118179
- return canWatchDirectoryOrFile(getDirectoryPath(dirPath)) ? { dir, dirPath } : void 0;
118202
+ function getDirectoryToWatchFromFailedLookupLocationDirectory(dirComponents, dirPathComponents, dirPathComponentsLength, perceivedOsRootLength, nodeModulesIndex, rootPathComponents) {
118203
+ if (nodeModulesIndex !== -1) {
118204
+ return getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, nodeModulesIndex + 1);
118180
118205
  }
118181
118206
  let nonRecursive = true;
118182
- let subDirectoryPath, subDirectory;
118183
- if (rootPath !== void 0) {
118184
- while (!isInDirectoryPath(dirPath, rootPath)) {
118185
- const parentPath = getDirectoryPath(dirPath);
118186
- if (parentPath === dirPath) {
118187
- break;
118188
- }
118207
+ let length2 = dirPathComponentsLength;
118208
+ for (let i = 0; i < dirPathComponentsLength; i++) {
118209
+ if (dirPathComponents[i] !== rootPathComponents[i]) {
118189
118210
  nonRecursive = false;
118190
- subDirectoryPath = dirPath;
118191
- subDirectory = dir;
118192
- dirPath = parentPath;
118193
- dir = getDirectoryPath(dir);
118211
+ length2 = Math.max(i + 1, perceivedOsRootLength + 1);
118212
+ break;
118194
118213
  }
118195
118214
  }
118196
- return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : void 0;
118215
+ return getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, length2, nonRecursive);
118216
+ }
118217
+ function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, length2, nonRecursive) {
118218
+ return {
118219
+ dir: getPathFromPathComponents(dirComponents, length2),
118220
+ dirPath: getPathFromPathComponents(dirPathComponents, length2),
118221
+ nonRecursive
118222
+ };
118197
118223
  }
118198
- function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, filterCustomPath) {
118199
- if (isInDirectoryPath(rootPath, typeRootPath)) {
118224
+ function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, filterCustomPath) {
118225
+ const typeRootPathComponents = getPathComponents(typeRootPath);
118226
+ if (isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
118200
118227
  return rootPath;
118201
118228
  }
118202
- const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath, rootPath);
118229
+ typeRoot = isRootedDiskPath(typeRoot) ? normalizePath(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory());
118230
+ const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(
118231
+ getPathComponents(typeRoot),
118232
+ typeRootPathComponents,
118233
+ typeRootPathComponents.length,
118234
+ perceivedOsRootLengthForWatching(typeRootPathComponents, typeRootPathComponents.length),
118235
+ typeRootPathComponents.indexOf("node_modules"),
118236
+ rootPathComponents
118237
+ );
118203
118238
  return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : void 0;
118204
118239
  }
118205
118240
  function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory) {
118206
- return rootDirForResolution && removeTrailingDirectorySeparator(getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()));
118241
+ const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
118242
+ return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
118207
118243
  }
118208
118244
  function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
118209
118245
  let filesWithChangedSetOfUnresolvedImports;
@@ -118235,13 +118271,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118235
118271
  resolutionHost.getCompilationSettings(),
118236
118272
  moduleResolutionCache.getPackageJsonInfoCache()
118237
118273
  );
118238
- const failedLookupDefaultExtensions = [".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
118239
- const customFailedLookupPaths = /* @__PURE__ */ new Map();
118240
118274
  const directoryWatchesOfFailedLookups = /* @__PURE__ */ new Map();
118241
118275
  const fileWatchesOfAffectingLocations = /* @__PURE__ */ new Map();
118242
118276
  const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory);
118243
- const rootPath = rootDir && resolutionHost.toPath(rootDir);
118244
- const rootSplitLength = rootPath !== void 0 ? rootPath.split(directorySeparator).length : 0;
118277
+ const rootPath = resolutionHost.toPath(rootDir);
118278
+ const rootPathComponents = getPathComponents(rootPath);
118245
118279
  const typeRootsWatches = /* @__PURE__ */ new Map();
118246
118280
  return {
118247
118281
  getModuleResolutionCache: () => moduleResolutionCache,
@@ -118275,7 +118309,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118275
118309
  function clear2() {
118276
118310
  clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf);
118277
118311
  clearMap(fileWatchesOfAffectingLocations, closeFileWatcherOf);
118278
- customFailedLookupPaths.clear();
118279
118312
  nonRelativeExternalModuleResolutions.clear();
118280
118313
  closeTypeRootsWatch();
118281
118314
  resolvedModuleNames.clear();
@@ -118555,9 +118588,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118555
118588
  function isNodeModulesAtTypesDirectory(dirPath) {
118556
118589
  return endsWith(dirPath, "/node_modules/@types");
118557
118590
  }
118558
- function isPathWithDefaultFailedLookupExtension(path) {
118559
- return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
118560
- }
118561
118591
  function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
118562
118592
  var _a2, _b;
118563
118593
  if (resolution.refCount) {
@@ -118598,15 +118628,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118598
118628
  failedLookupLocationPath,
118599
118629
  rootDir,
118600
118630
  rootPath,
118601
- rootSplitLength,
118631
+ rootPathComponents,
118602
118632
  getCurrentDirectory
118603
118633
  );
118604
118634
  if (toWatch) {
118605
118635
  const { dir, dirPath, nonRecursive } = toWatch;
118606
- if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
118607
- const refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
118608
- customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);
118609
- }
118610
118636
  if (dirPath === rootPath) {
118611
118637
  Debug.assert(nonRecursive);
118612
118638
  setAtRoot = true;
@@ -118741,20 +118767,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118741
118767
  failedLookupLocationPath,
118742
118768
  rootDir,
118743
118769
  rootPath,
118744
- rootSplitLength,
118770
+ rootPathComponents,
118745
118771
  getCurrentDirectory
118746
118772
  );
118747
118773
  if (toWatch) {
118748
118774
  const { dirPath } = toWatch;
118749
- const refCount = customFailedLookupPaths.get(failedLookupLocationPath);
118750
- if (refCount) {
118751
- if (refCount === 1) {
118752
- customFailedLookupPaths.delete(failedLookupLocationPath);
118753
- } else {
118754
- Debug.assert(refCount > 1);
118755
- customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1);
118756
- }
118757
- }
118758
118775
  if (dirPath === rootPath) {
118759
118776
  removeAtRoot = true;
118760
118777
  } else {
@@ -118852,10 +118869,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118852
118869
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
118853
118870
  (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
118854
118871
  } else {
118855
- if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) {
118872
+ if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) {
118856
118873
  return false;
118857
118874
  }
118858
- if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) {
118875
+ if (fileExtensionIs(fileOrDirectoryPath, ".map")) {
118859
118876
  return false;
118860
118877
  }
118861
118878
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
@@ -118902,7 +118919,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118902
118919
  return (_a2 = resolution.failedLookupLocations) == null ? void 0 : _a2.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)));
118903
118920
  }
118904
118921
  function isInvalidatedFailedLookup(locationPath) {
118905
- return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (fileOrDirectoryPath) => isInDirectoryPath(fileOrDirectoryPath, locationPath) ? true : void 0);
118922
+ return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (dirPath) => locationPath.length > dirPath.length && startsWith(locationPath, dirPath) && (isDiskPathRoot(dirPath) || locationPath[dirPath.length] === directorySeparator) ? true : void 0);
118906
118923
  }
118907
118924
  function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) {
118908
118925
  var _a2;
@@ -118923,6 +118940,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118923
118940
  typeRoot,
118924
118941
  typeRootPath,
118925
118942
  rootPath,
118943
+ rootPathComponents,
118944
+ getCurrentDirectory,
118926
118945
  (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2)
118927
118946
  );
118928
118947
  if (dirPath) {
@@ -118953,7 +118972,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118953
118972
  function canWatchTypeRootPath(typeRoot) {
118954
118973
  if (resolutionHost.getCompilationSettings().typeRoots)
118955
118974
  return true;
118956
- return canWatchAtTypes(resolutionHost.toPath(typeRoot), rootPath);
118975
+ return canWatchAtTypes(resolutionHost.toPath(typeRoot));
118957
118976
  }
118958
118977
  }
118959
118978
  function resolutionIsSymlink(resolution) {