typescript 5.3.0-dev.20230825 → 5.3.0-dev.20230826

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.
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-dev.20230825`;
57
+ var version = `${versionMajorMinor}.0-dev.20230826`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -693,9 +693,6 @@ function endsWith(str, suffix) {
693
693
  const expectedPos = str.length - suffix.length;
694
694
  return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
695
695
  }
696
- function stringContains(str, substring) {
697
- return str.indexOf(substring) !== -1;
698
- }
699
696
  function removeMinAndVersionNumbers(fileName) {
700
697
  let end = fileName.length;
701
698
  for (let pos = end - 1; pos > 0; pos--) {
@@ -3927,11 +3924,11 @@ function createDirectoryWatcherSupportingRecursive({
3927
3924
  return some(ignoredPaths, (searchPath) => isInPath(path2, searchPath)) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames2, getCurrentDirectory);
3928
3925
  }
3929
3926
  function isInPath(path2, searchPath) {
3930
- if (stringContains(path2, searchPath))
3927
+ if (path2.includes(searchPath))
3931
3928
  return true;
3932
3929
  if (useCaseSensitiveFileNames2)
3933
3930
  return false;
3934
- return stringContains(toCanonicalFilePath(path2), searchPath);
3931
+ return toCanonicalFilePath(path2).includes(searchPath);
3935
3932
  }
3936
3933
  }
3937
3934
  function createFileWatcherCallback(callback) {
@@ -4761,7 +4758,7 @@ function pathIsRelative(path2) {
4761
4758
  return /^\.\.?($|[\\/])/.test(path2);
4762
4759
  }
4763
4760
  function hasExtension(fileName) {
4764
- return stringContains(getBaseFileName(fileName), ".");
4761
+ return getBaseFileName(fileName).includes(".");
4765
4762
  }
4766
4763
  function fileExtensionIs(path2, extension) {
4767
4764
  return path2.length > extension.length && endsWith(path2, extension);
@@ -4906,7 +4903,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
4906
4903
  return root + pathComponents2.slice(1, length2).join(directorySeparator);
4907
4904
  }
4908
4905
  function normalizeSlashes(path2) {
4909
- return path2.indexOf("\\") !== -1 ? path2.replace(backslashRegExp, directorySeparator) : path2;
4906
+ return path2.includes("\\") ? path2.replace(backslashRegExp, directorySeparator) : path2;
4910
4907
  }
4911
4908
  function reducePathComponents(components) {
4912
4909
  if (!some(components))
@@ -25340,7 +25337,7 @@ var IncrementalParser;
25340
25337
  })(InvalidPosition || (InvalidPosition = {}));
25341
25338
  })(IncrementalParser || (IncrementalParser = {}));
25342
25339
  function isDeclarationFileName(fileName) {
25343
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && stringContains(getBaseFileName(fileName), ".d.");
25340
+ return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
25344
25341
  }
25345
25342
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
25346
25343
  if (!mode) {
@@ -27865,7 +27862,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
27865
27862
  result = tryResolve(extensions, state);
27866
27863
  }
27867
27864
  let legacyResult;
27868
- if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) {
27865
+ if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.includes("import")) {
27869
27866
  traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
27870
27867
  const diagnosticState = {
27871
27868
  ...state,
@@ -27909,7 +27906,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
27909
27906
  resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
27910
27907
  }
27911
27908
  if (!resolved2) {
27912
- if (moduleName.indexOf(":") > -1) {
27909
+ if (moduleName.includes(":")) {
27913
27910
  if (traceEnabled) {
27914
27911
  trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
27915
27912
  }
@@ -27999,7 +27996,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
27999
27996
  }
28000
27997
  var nodeModulesPathPart = "/node_modules/";
28001
27998
  function pathContainsNodeModules(path2) {
28002
- return stringContains(path2, nodeModulesPathPart);
27999
+ return path2.includes(nodeModulesPathPart);
28003
28000
  }
28004
28001
  function parseNodeModuleFromPath(resolved, isFolder) {
28005
28002
  const path2 = normalizePath(resolved);
@@ -28035,7 +28032,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
28035
28032
  }
28036
28033
  function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
28037
28034
  const filename = getBaseFileName(candidate);
28038
- if (filename.indexOf(".") === -1) {
28035
+ if (!filename.includes(".")) {
28039
28036
  return void 0;
28040
28037
  }
28041
28038
  let extensionless = removeFileExtension(candidate);
@@ -28443,7 +28440,7 @@ function comparePatternKeys(a, b) {
28443
28440
  }
28444
28441
  function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
28445
28442
  const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
28446
- if (!endsWith(moduleName, directorySeparator) && moduleName.indexOf("*") === -1 && hasProperty(lookupTable, moduleName)) {
28443
+ if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
28447
28444
  const target = lookupTable[moduleName];
28448
28445
  return loadModuleFromTargetImportOrExport(
28449
28446
  target,
@@ -28454,7 +28451,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
28454
28451
  moduleName
28455
28452
  );
28456
28453
  }
28457
- const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.indexOf("*") !== -1 || endsWith(k, "/")), comparePatternKeys);
28454
+ const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
28458
28455
  for (const potentialTarget of expandingKeys) {
28459
28456
  if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
28460
28457
  const target = lookupTable[potentialTarget];
@@ -28548,7 +28545,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
28548
28545
  }
28549
28546
  const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
28550
28547
  const partsAfterFirst = parts.slice(1);
28551
- if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
28548
+ if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
28552
28549
  if (state.traceEnabled) {
28553
28550
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
28554
28551
  }
@@ -28559,7 +28556,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
28559
28556
  }
28560
28557
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
28561
28558
  const subpathParts = getPathComponents(subpath);
28562
- if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) {
28559
+ if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
28563
28560
  if (state.traceEnabled) {
28564
28561
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
28565
28562
  }
@@ -28586,7 +28583,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
28586
28583
  if (!Array.isArray(target)) {
28587
28584
  traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
28588
28585
  for (const condition of getOwnKeys(target)) {
28589
- if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) {
28586
+ if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
28590
28587
  traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
28591
28588
  const subTarget = target[condition];
28592
28589
  const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
@@ -28647,7 +28644,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
28647
28644
  }
28648
28645
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
28649
28646
  var _a, _b, _c, _d;
28650
- 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)) {
28647
+ if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
28651
28648
  const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
28652
28649
  const commonSourceDirGuesses = [];
28653
28650
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
@@ -28721,7 +28718,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
28721
28718
  }
28722
28719
  }
28723
28720
  function isApplicableVersionedTypesKey(conditions, key) {
28724
- if (conditions.indexOf("types") === -1)
28721
+ if (!conditions.includes("types"))
28725
28722
  return false;
28726
28723
  if (!startsWith(key, "types@"))
28727
28724
  return false;
@@ -31669,7 +31666,7 @@ var Arguments;
31669
31666
  Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
31670
31667
  })(Arguments || (Arguments = {}));
31671
31668
  function hasArgument(argumentName) {
31672
- return sys.args.indexOf(argumentName) >= 0;
31669
+ return sys.args.includes(argumentName);
31673
31670
  }
31674
31671
  function findArgument(argumentName) {
31675
31672
  const index = sys.args.indexOf(argumentName);
@@ -32096,7 +32093,7 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
32096
32093
  log2
32097
32094
  );
32098
32095
  this.npmPath = npmLocation2 !== void 0 ? npmLocation2 : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation2, this.installTypingHost);
32099
- if (stringContains(this.npmPath, " ") && this.npmPath[0] !== `"`) {
32096
+ if (this.npmPath.includes(" ") && this.npmPath[0] !== `"`) {
32100
32097
  this.npmPath = `"${this.npmPath}"`;
32101
32098
  }
32102
32099
  if (this.log.isEnabled()) {
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.3.0-dev.20230825",
5
+ "version": "5.3.0-dev.20230826",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -112,5 +112,5 @@
112
112
  "node": "20.1.0",
113
113
  "npm": "8.19.4"
114
114
  },
115
- "gitHead": "c3c5abb3a7d960de6e2fb75bc2a74fb90d9109b6"
115
+ "gitHead": "51e7a34c2c1557259599d6039c3e20da05d23abe"
116
116
  }