typescript 5.1.0-dev.20230413 → 5.1.0-dev.20230414

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.1";
38
- version = `${versionMajorMinor}.0-dev.20230413`;
38
+ version = `${versionMajorMinor}.0-dev.20230414`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6737,11 +6737,11 @@ ${lanes.join("\n")}
6737
6737
  path = combinePaths(currentDirectory, path);
6738
6738
  return pathComponents(path, getRootLength(path));
6739
6739
  }
6740
- function getPathFromPathComponents(pathComponents2) {
6740
+ function getPathFromPathComponents(pathComponents2, length2) {
6741
6741
  if (pathComponents2.length === 0)
6742
6742
  return "";
6743
6743
  const root = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]);
6744
- return root + pathComponents2.slice(1).join(directorySeparator);
6744
+ return root + pathComponents2.slice(1, length2).join(directorySeparator);
6745
6745
  }
6746
6746
  function normalizeSlashes(path) {
6747
6747
  return path.indexOf("\\") !== -1 ? path.replace(backslashRegExp, directorySeparator) : path;
@@ -20595,7 +20595,7 @@ ${lanes.join("\n")}
20595
20595
  function createBigIntLiteral(value) {
20596
20596
  const node = createBaseToken(10 /* BigIntLiteral */);
20597
20597
  node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n";
20598
- node.transformFlags |= 4 /* ContainsESNext */;
20598
+ node.transformFlags |= 32 /* ContainsES2020 */;
20599
20599
  return node;
20600
20600
  }
20601
20601
  function createBaseStringLiteral(text, isSingleQuote) {
@@ -22105,7 +22105,7 @@ ${lanes.join("\n")}
22105
22105
  node.transformFlags |= 1024 /* ContainsES2015 */;
22106
22106
  break;
22107
22107
  case 102 /* ImportKeyword */:
22108
- node.transformFlags |= 4 /* ContainsESNext */;
22108
+ node.transformFlags |= 32 /* ContainsES2020 */;
22109
22109
  break;
22110
22110
  default:
22111
22111
  return Debug.assertNever(keywordToken);
@@ -22633,7 +22633,7 @@ ${lanes.join("\n")}
22633
22633
  function createNamespaceExport(name) {
22634
22634
  const node = createBaseDeclaration(279 /* NamespaceExport */);
22635
22635
  node.name = name;
22636
- node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
22636
+ node.transformFlags |= propagateChildFlags(node.name) | 32 /* ContainsES2020 */;
22637
22637
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
22638
22638
  return node;
22639
22639
  }
@@ -121181,60 +121181,62 @@ ${lanes.join("\n")}
121181
121181
  }
121182
121182
  return some(ignoredPaths, (searchPath) => stringContains(path, searchPath)) ? void 0 : path;
121183
121183
  }
121184
- function canWatchDirectoryOrFile(dirPath) {
121185
- const rootLength = getRootLength(dirPath);
121186
- if (dirPath.length === rootLength) {
121187
- return false;
121188
- }
121189
- let nextDirectorySeparator = dirPath.indexOf(directorySeparator, rootLength);
121190
- if (nextDirectorySeparator === -1) {
121191
- return false;
121192
- }
121193
- let pathPartForUserCheck = dirPath.substring(rootLength, nextDirectorySeparator + 1);
121194
- const isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47 /* slash */;
121195
- if (isNonDirectorySeparatorRoot && dirPath.search(/[a-zA-Z]:/) !== 0 && // Non dos style paths
121196
- pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) {
121197
- nextDirectorySeparator = dirPath.indexOf(directorySeparator, nextDirectorySeparator + 1);
121198
- if (nextDirectorySeparator === -1) {
121199
- return false;
121200
- }
121201
- pathPartForUserCheck = dirPath.substring(rootLength + pathPartForUserCheck.length, nextDirectorySeparator + 1);
121184
+ function perceivedOsRootLengthForWatching(pathComponents2, length2) {
121185
+ if (length2 <= 1)
121186
+ return 1;
121187
+ let userCheckIndex = 1;
121188
+ let isDosStyle = pathComponents2[0].search(/[a-zA-Z]:/) === 0;
121189
+ if (pathComponents2[0] !== directorySeparator && !isDosStyle && // Non dos style paths
121190
+ pathComponents2[1].search(/[a-zA-Z]\$$/) === 0) {
121191
+ if (length2 === 2)
121192
+ return 2;
121193
+ userCheckIndex = 2;
121194
+ isDosStyle = true;
121202
121195
  }
121203
- if (isNonDirectorySeparatorRoot && pathPartForUserCheck.search(/users\//i) !== 0) {
121204
- return true;
121196
+ if (isDosStyle && !pathComponents2[userCheckIndex].match(/^users$/i)) {
121197
+ return userCheckIndex;
121205
121198
  }
121206
- for (let searchIndex = nextDirectorySeparator + 1, searchLevels = 2; searchLevels > 0; searchLevels--) {
121207
- searchIndex = dirPath.indexOf(directorySeparator, searchIndex) + 1;
121208
- if (searchIndex === 0) {
121209
- return false;
121210
- }
121211
- }
121212
- return true;
121199
+ return userCheckIndex + 2;
121200
+ }
121201
+ function canWatchDirectoryOrFile(pathComponents2, length2) {
121202
+ if (length2 === void 0)
121203
+ length2 = pathComponents2.length;
121204
+ if (length2 <= 2)
121205
+ return false;
121206
+ const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2);
121207
+ return length2 > perceivedOsRootLength + 1;
121213
121208
  }
121214
- function canWatchAtTypes(atTypes, rootPath) {
121215
- const dirPath = getDirectoryPath(getDirectoryPath(atTypes));
121216
- return dirPath === rootPath || canWatchDirectoryOrFile(dirPath);
121209
+ function canWatchAtTypes(atTypes) {
121210
+ return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes));
121217
121211
  }
121218
- function isInDirectoryPath(dir, file) {
121219
- if (dir === void 0 || file.length <= dir.length) {
121212
+ function isInDirectoryPath(dirComponents, fileOrDirComponents) {
121213
+ if (fileOrDirComponents.length < fileOrDirComponents.length)
121220
121214
  return false;
121215
+ for (let i = 0; i < dirComponents.length; i++) {
121216
+ if (fileOrDirComponents[i] !== dirComponents[i])
121217
+ return false;
121221
121218
  }
121222
- return startsWith(file, dir) && file[dir.length] === directorySeparator;
121219
+ return true;
121220
+ }
121221
+ function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) {
121222
+ return canWatchDirectoryOrFile(getPathComponents(fileOrDirPath));
121223
121223
  }
121224
121224
  function canWatchAffectingLocation(filePath) {
121225
- return canWatchDirectoryOrFile(filePath);
121226
- }
121227
- function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootSplitLength, getCurrentDirectory) {
121228
- if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
121229
- failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
121230
- const failedLookupPathSplit = failedLookupLocationPath.split(directorySeparator);
121231
- const failedLookupSplit = failedLookupLocation.split(directorySeparator);
121232
- Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`);
121233
- if (failedLookupPathSplit.length > rootSplitLength + 1) {
121234
- return {
121235
- dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(directorySeparator),
121236
- dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(directorySeparator)
121237
- };
121225
+ return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath);
121226
+ }
121227
+ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory) {
121228
+ const failedLookupPathComponents = getPathComponents(failedLookupLocationPath);
121229
+ failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
121230
+ const failedLookupComponents = getPathComponents(failedLookupLocation);
121231
+ const perceivedOsRootLength = perceivedOsRootLengthForWatching(failedLookupPathComponents, failedLookupPathComponents.length);
121232
+ if (failedLookupPathComponents.length <= perceivedOsRootLength + 1)
121233
+ return void 0;
121234
+ const nodeModulesIndex = failedLookupPathComponents.indexOf("node_modules");
121235
+ if (nodeModulesIndex !== -1 && nodeModulesIndex + 1 <= perceivedOsRootLength + 1)
121236
+ return void 0;
121237
+ if (isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
121238
+ if (failedLookupPathComponents.length > rootPathComponents.length + 1) {
121239
+ return getDirectoryOfFailedLookupWatch(failedLookupComponents, failedLookupPathComponents, Math.max(rootPathComponents.length + 1, perceivedOsRootLength + 1));
121238
121240
  } else {
121239
121241
  return {
121240
121242
  dir: rootDir,
@@ -121244,45 +121246,58 @@ ${lanes.join("\n")}
121244
121246
  }
121245
121247
  }
121246
121248
  return getDirectoryToWatchFromFailedLookupLocationDirectory(
121247
- getDirectoryPath(getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())),
121248
- getDirectoryPath(failedLookupLocationPath),
121249
- rootPath
121249
+ failedLookupComponents,
121250
+ failedLookupPathComponents,
121251
+ failedLookupPathComponents.length - 1,
121252
+ perceivedOsRootLength,
121253
+ nodeModulesIndex,
121254
+ rootPathComponents
121250
121255
  );
121251
121256
  }
121252
- function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath, rootPath) {
121253
- while (pathContainsNodeModules(dirPath)) {
121254
- dir = getDirectoryPath(dir);
121255
- dirPath = getDirectoryPath(dirPath);
121256
- }
121257
- if (isNodeModulesDirectory(dirPath)) {
121258
- return canWatchDirectoryOrFile(getDirectoryPath(dirPath)) ? { dir, dirPath } : void 0;
121257
+ function getDirectoryToWatchFromFailedLookupLocationDirectory(dirComponents, dirPathComponents, dirPathComponentsLength, perceivedOsRootLength, nodeModulesIndex, rootPathComponents) {
121258
+ if (nodeModulesIndex !== -1) {
121259
+ return getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, nodeModulesIndex + 1);
121259
121260
  }
121260
121261
  let nonRecursive = true;
121261
- let subDirectoryPath, subDirectory;
121262
- if (rootPath !== void 0) {
121263
- while (!isInDirectoryPath(dirPath, rootPath)) {
121264
- const parentPath = getDirectoryPath(dirPath);
121265
- if (parentPath === dirPath) {
121266
- break;
121267
- }
121262
+ let length2 = dirPathComponentsLength;
121263
+ for (let i = 0; i < dirPathComponentsLength; i++) {
121264
+ if (dirPathComponents[i] !== rootPathComponents[i]) {
121268
121265
  nonRecursive = false;
121269
- subDirectoryPath = dirPath;
121270
- subDirectory = dir;
121271
- dirPath = parentPath;
121272
- dir = getDirectoryPath(dir);
121266
+ length2 = Math.max(i + 1, perceivedOsRootLength + 1);
121267
+ break;
121273
121268
  }
121274
121269
  }
121275
- return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : void 0;
121270
+ return getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, length2, nonRecursive);
121271
+ }
121272
+ function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, length2, nonRecursive) {
121273
+ return {
121274
+ dir: getPathFromPathComponents(dirComponents, length2),
121275
+ dirPath: getPathFromPathComponents(dirPathComponents, length2),
121276
+ nonRecursive
121277
+ };
121276
121278
  }
121277
- function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, filterCustomPath) {
121278
- if (isInDirectoryPath(rootPath, typeRootPath)) {
121279
+ function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, filterCustomPath) {
121280
+ const typeRootPathComponents = getPathComponents(typeRootPath);
121281
+ if (isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
121279
121282
  return rootPath;
121280
121283
  }
121281
- const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath, rootPath);
121284
+ typeRoot = isRootedDiskPath(typeRoot) ? normalizePath(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory());
121285
+ const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(
121286
+ getPathComponents(typeRoot),
121287
+ typeRootPathComponents,
121288
+ typeRootPathComponents.length,
121289
+ perceivedOsRootLengthForWatching(typeRootPathComponents, typeRootPathComponents.length),
121290
+ typeRootPathComponents.indexOf("node_modules"),
121291
+ rootPathComponents
121292
+ );
121282
121293
  return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : void 0;
121283
121294
  }
121284
121295
  function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory) {
121285
- return rootDirForResolution && removeTrailingDirectorySeparator(getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()));
121296
+ const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
121297
+ return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
121298
+ }
121299
+ function getRootPathSplitLength(rootPath) {
121300
+ return rootPath.split(directorySeparator).length - (hasTrailingDirectorySeparator(rootPath) ? 1 : 0);
121286
121301
  }
121287
121302
  function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
121288
121303
  let filesWithChangedSetOfUnresolvedImports;
@@ -121314,13 +121329,11 @@ ${lanes.join("\n")}
121314
121329
  resolutionHost.getCompilationSettings(),
121315
121330
  moduleResolutionCache.getPackageJsonInfoCache()
121316
121331
  );
121317
- const failedLookupDefaultExtensions = [".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
121318
- const customFailedLookupPaths = /* @__PURE__ */ new Map();
121319
121332
  const directoryWatchesOfFailedLookups = /* @__PURE__ */ new Map();
121320
121333
  const fileWatchesOfAffectingLocations = /* @__PURE__ */ new Map();
121321
121334
  const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory);
121322
- const rootPath = rootDir && resolutionHost.toPath(rootDir);
121323
- const rootSplitLength = rootPath !== void 0 ? rootPath.split(directorySeparator).length : 0;
121335
+ const rootPath = resolutionHost.toPath(rootDir);
121336
+ const rootPathComponents = getPathComponents(rootPath);
121324
121337
  const typeRootsWatches = /* @__PURE__ */ new Map();
121325
121338
  return {
121326
121339
  getModuleResolutionCache: () => moduleResolutionCache,
@@ -121354,7 +121367,6 @@ ${lanes.join("\n")}
121354
121367
  function clear2() {
121355
121368
  clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf);
121356
121369
  clearMap(fileWatchesOfAffectingLocations, closeFileWatcherOf);
121357
- customFailedLookupPaths.clear();
121358
121370
  nonRelativeExternalModuleResolutions.clear();
121359
121371
  closeTypeRootsWatch();
121360
121372
  resolvedModuleNames.clear();
@@ -121634,9 +121646,6 @@ ${lanes.join("\n")}
121634
121646
  function isNodeModulesAtTypesDirectory(dirPath) {
121635
121647
  return endsWith(dirPath, "/node_modules/@types");
121636
121648
  }
121637
- function isPathWithDefaultFailedLookupExtension(path) {
121638
- return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
121639
- }
121640
121649
  function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
121641
121650
  var _a2, _b;
121642
121651
  if (resolution.refCount) {
@@ -121677,15 +121686,11 @@ ${lanes.join("\n")}
121677
121686
  failedLookupLocationPath,
121678
121687
  rootDir,
121679
121688
  rootPath,
121680
- rootSplitLength,
121689
+ rootPathComponents,
121681
121690
  getCurrentDirectory
121682
121691
  );
121683
121692
  if (toWatch) {
121684
121693
  const { dir, dirPath, nonRecursive } = toWatch;
121685
- if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
121686
- const refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
121687
- customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);
121688
- }
121689
121694
  if (dirPath === rootPath) {
121690
121695
  Debug.assert(nonRecursive);
121691
121696
  setAtRoot = true;
@@ -121820,20 +121825,11 @@ ${lanes.join("\n")}
121820
121825
  failedLookupLocationPath,
121821
121826
  rootDir,
121822
121827
  rootPath,
121823
- rootSplitLength,
121828
+ rootPathComponents,
121824
121829
  getCurrentDirectory
121825
121830
  );
121826
121831
  if (toWatch) {
121827
121832
  const { dirPath } = toWatch;
121828
- const refCount = customFailedLookupPaths.get(failedLookupLocationPath);
121829
- if (refCount) {
121830
- if (refCount === 1) {
121831
- customFailedLookupPaths.delete(failedLookupLocationPath);
121832
- } else {
121833
- Debug.assert(refCount > 1);
121834
- customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1);
121835
- }
121836
- }
121837
121833
  if (dirPath === rootPath) {
121838
121834
  removeAtRoot = true;
121839
121835
  } else {
@@ -121931,10 +121927,10 @@ ${lanes.join("\n")}
121931
121927
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
121932
121928
  (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
121933
121929
  } else {
121934
- if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) {
121930
+ if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) {
121935
121931
  return false;
121936
121932
  }
121937
- if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) {
121933
+ if (fileExtensionIs(fileOrDirectoryPath, ".map")) {
121938
121934
  return false;
121939
121935
  }
121940
121936
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
@@ -121981,7 +121977,7 @@ ${lanes.join("\n")}
121981
121977
  return (_a2 = resolution.failedLookupLocations) == null ? void 0 : _a2.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)));
121982
121978
  }
121983
121979
  function isInvalidatedFailedLookup(locationPath) {
121984
- 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);
121980
+ 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);
121985
121981
  }
121986
121982
  function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) {
121987
121983
  var _a2;
@@ -122002,6 +121998,8 @@ ${lanes.join("\n")}
122002
121998
  typeRoot,
122003
121999
  typeRootPath,
122004
122000
  rootPath,
122001
+ rootPathComponents,
122002
+ getCurrentDirectory,
122005
122003
  (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2)
122006
122004
  );
122007
122005
  if (dirPath) {
@@ -122032,7 +122030,7 @@ ${lanes.join("\n")}
122032
122030
  function canWatchTypeRootPath(typeRoot) {
122033
122031
  if (resolutionHost.getCompilationSettings().typeRoots)
122034
122032
  return true;
122035
- return canWatchAtTypes(resolutionHost.toPath(typeRoot), rootPath);
122033
+ return canWatchAtTypes(resolutionHost.toPath(typeRoot));
122036
122034
  }
122037
122035
  }
122038
122036
  function resolutionIsSymlink(resolution) {
@@ -125977,7 +125975,8 @@ ${lanes.join("\n")}
125977
125975
  placeOpenBraceOnNewLineForFunctions: false,
125978
125976
  placeOpenBraceOnNewLineForControlBlocks: false,
125979
125977
  semicolons: "ignore" /* Ignore */,
125980
- trimTrailingWhitespace: true
125978
+ trimTrailingWhitespace: true,
125979
+ indentSwitchCase: true
125981
125980
  };
125982
125981
  }
125983
125982
  var ScriptSnapshot, PackageJsonDependencyGroup, PackageJsonAutoImportPreference, LanguageServiceMode, emptyOptions, SemanticClassificationFormat, OrganizeImportsMode, CompletionTriggerKind, InlayHintKind, HighlightSpanKind, IndentStyle, SemicolonPreference, testFormatSettings, SymbolDisplayPartKind, CompletionInfoFlags, OutliningSpanKind, OutputFileType, EndOfLineState, TokenClass, ScriptElementKind, ScriptElementKindModifier, ClassificationTypeNames, ClassificationType;
@@ -155348,7 +155347,7 @@ ${lanes.join("\n")}
155348
155347
  false,
155349
155348
  failedAliasResolution
155350
155349
  )) : emptyArray;
155351
- return concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker, node) || emptyArray);
155350
+ return concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker, node));
155352
155351
  }
155353
155352
  if (isPropertyName(node) && isBindingElement(parent2) && isObjectBindingPattern(parent2.parent) && node === (parent2.propertyName || parent2.name)) {
155354
155353
  const name = getNameFromPropertyName(node);
@@ -155358,7 +155357,8 @@ ${lanes.join("\n")}
155358
155357
  return prop && getDefinitionFromSymbol(typeChecker, prop, node);
155359
155358
  });
155360
155359
  }
155361
- return concatenate(fileReferenceDefinition, getDefinitionFromObjectLiteralElement(typeChecker, node) || getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution));
155360
+ const objectLiteralElementDefinition = getDefinitionFromObjectLiteralElement(typeChecker, node);
155361
+ return concatenate(fileReferenceDefinition, objectLiteralElementDefinition.length ? objectLiteralElementDefinition : getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution));
155362
155362
  }
155363
155363
  function symbolMatchesSignature(s, calledDeclaration) {
155364
155364
  var _a2;
@@ -155378,6 +155378,7 @@ ${lanes.join("\n")}
155378
155378
  ), (propertySymbol) => getDefinitionFromSymbol(typeChecker, propertySymbol, node));
155379
155379
  }
155380
155380
  }
155381
+ return emptyArray;
155381
155382
  }
155382
155383
  function getDefinitionFromOverriddenMember(typeChecker, node) {
155383
155384
  const classElement = findAncestor(node, isClassElement);
@@ -168102,6 +168103,7 @@ ${options.prefix}` : "\n" : options.prefix
168102
168103
  }
168103
168104
  SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
168104
168105
  function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
168106
+ var _a2;
168105
168107
  const childKind = child ? child.kind : 0 /* Unknown */;
168106
168108
  switch (parent2.kind) {
168107
168109
  case 243 /* ExpressionStatement */:
@@ -168117,9 +168119,6 @@ ${options.prefix}` : "\n" : options.prefix
168117
168119
  case 186 /* TypeLiteral */:
168118
168120
  case 199 /* MappedType */:
168119
168121
  case 188 /* TupleType */:
168120
- case 268 /* CaseBlock */:
168121
- case 295 /* DefaultClause */:
168122
- case 294 /* CaseClause */:
168123
168122
  case 216 /* ParenthesizedExpression */:
168124
168123
  case 210 /* PropertyAccessExpression */:
168125
168124
  case 212 /* CallExpression */:
@@ -168148,7 +168147,11 @@ ${options.prefix}` : "\n" : options.prefix
168148
168147
  case 280 /* ExportSpecifier */:
168149
168148
  case 275 /* ImportSpecifier */:
168150
168149
  case 171 /* PropertyDeclaration */:
168150
+ case 294 /* CaseClause */:
168151
+ case 295 /* DefaultClause */:
168151
168152
  return true;
168153
+ case 268 /* CaseBlock */:
168154
+ return (_a2 = settings.indentSwitchCase) != null ? _a2 : true;
168152
168155
  case 259 /* VariableDeclaration */:
168153
168156
  case 301 /* PropertyAssignment */:
168154
168157
  case 225 /* BinaryExpression */:
@@ -169430,6 +169433,7 @@ ${options.prefix}` : "\n" : options.prefix
169430
169433
  getRootDeclaration: () => getRootDeclaration,
169431
169434
  getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache,
169432
169435
  getRootLength: () => getRootLength,
169436
+ getRootPathSplitLength: () => getRootPathSplitLength,
169433
169437
  getScriptKind: () => getScriptKind,
169434
169438
  getScriptKindFromFileName: () => getScriptKindFromFileName,
169435
169439
  getScriptTargetFeatures: () => getScriptTargetFeatures,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-dev.20230413`;
57
+ var version = `${versionMajorMinor}.0-dev.20230414`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -4851,11 +4851,11 @@ function getPathComponents(path2, currentDirectory = "") {
4851
4851
  path2 = combinePaths(currentDirectory, path2);
4852
4852
  return pathComponents(path2, getRootLength(path2));
4853
4853
  }
4854
- function getPathFromPathComponents(pathComponents2) {
4854
+ function getPathFromPathComponents(pathComponents2, length2) {
4855
4855
  if (pathComponents2.length === 0)
4856
4856
  return "";
4857
4857
  const root = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]);
4858
- return root + pathComponents2.slice(1).join(directorySeparator);
4858
+ return root + pathComponents2.slice(1, length2).join(directorySeparator);
4859
4859
  }
4860
4860
  function normalizeSlashes(path2) {
4861
4861
  return path2.indexOf("\\") !== -1 ? path2.replace(backslashRegExp, directorySeparator) : path2;
@@ -12942,7 +12942,7 @@ function createNodeFactory(flags, baseFactory2) {
12942
12942
  function createBigIntLiteral(value) {
12943
12943
  const node = createBaseToken(10 /* BigIntLiteral */);
12944
12944
  node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n";
12945
- node.transformFlags |= 4 /* ContainsESNext */;
12945
+ node.transformFlags |= 32 /* ContainsES2020 */;
12946
12946
  return node;
12947
12947
  }
12948
12948
  function createBaseStringLiteral(text, isSingleQuote) {
@@ -14452,7 +14452,7 @@ function createNodeFactory(flags, baseFactory2) {
14452
14452
  node.transformFlags |= 1024 /* ContainsES2015 */;
14453
14453
  break;
14454
14454
  case 102 /* ImportKeyword */:
14455
- node.transformFlags |= 4 /* ContainsESNext */;
14455
+ node.transformFlags |= 32 /* ContainsES2020 */;
14456
14456
  break;
14457
14457
  default:
14458
14458
  return Debug.assertNever(keywordToken);
@@ -14980,7 +14980,7 @@ function createNodeFactory(flags, baseFactory2) {
14980
14980
  function createNamespaceExport(name) {
14981
14981
  const node = createBaseDeclaration(279 /* NamespaceExport */);
14982
14982
  node.name = name;
14983
- node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
14983
+ node.transformFlags |= propagateChildFlags(node.name) | 32 /* ContainsES2020 */;
14984
14984
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14985
14985
  return node;
14986
14986
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.1.0-dev.20230413",
5
+ "version": "5.1.0-dev.20230414",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "14.21.1",
114
114
  "npm": "8.19.3"
115
115
  },
116
- "gitHead": "33ab6fd0d5eceb7715000398382b60d64dde1c67"
116
+ "gitHead": "3445e58815bae0c1c3752e9d364b56f548fa5634"
117
117
  }