typescript 5.3.0-dev.20230825 → 5.3.0-dev.20230827

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.
@@ -60,7 +60,7 @@ function createCancellationToken(args) {
60
60
  }
61
61
  if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") {
62
62
  const namePrefix = cancellationPipeName.slice(0, -1);
63
- if (namePrefix.length === 0 || namePrefix.indexOf("*") >= 0) {
63
+ if (namePrefix.length === 0 || namePrefix.includes("*")) {
64
64
  throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'.");
65
65
  }
66
66
  let perRequestPipeName;
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.3";
21
- var version = `${versionMajorMinor}.0-dev.20230825`;
21
+ var version = `${versionMajorMinor}.0-dev.20230827`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -1111,9 +1111,6 @@ function endsWith(str, suffix) {
1111
1111
  function removeSuffix(str, suffix) {
1112
1112
  return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
1113
1113
  }
1114
- function stringContains(str, substring) {
1115
- return str.indexOf(substring) !== -1;
1116
- }
1117
1114
  function orderedRemoveItem(array, item) {
1118
1115
  for (let i = 0; i < array.length; i++) {
1119
1116
  if (array[i] === item) {
@@ -4517,11 +4514,11 @@ function createDirectoryWatcherSupportingRecursive({
4517
4514
  return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
4518
4515
  }
4519
4516
  function isInPath(path, searchPath) {
4520
- if (stringContains(path, searchPath))
4517
+ if (path.includes(searchPath))
4521
4518
  return true;
4522
4519
  if (useCaseSensitiveFileNames2)
4523
4520
  return false;
4524
- return stringContains(toCanonicalFilePath(path), searchPath);
4521
+ return toCanonicalFilePath(path).includes(searchPath);
4525
4522
  }
4526
4523
  }
4527
4524
  function createFileWatcherCallback(callback) {
@@ -5358,7 +5355,7 @@ function pathIsBareSpecifier(path) {
5358
5355
  return !pathIsAbsolute(path) && !pathIsRelative(path);
5359
5356
  }
5360
5357
  function hasExtension(fileName) {
5361
- return stringContains(getBaseFileName(fileName), ".");
5358
+ return getBaseFileName(fileName).includes(".");
5362
5359
  }
5363
5360
  function fileExtensionIs(path, extension) {
5364
5361
  return path.length > extension.length && endsWith(path, extension);
@@ -5503,7 +5500,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
5503
5500
  return root + pathComponents2.slice(1, length2).join(directorySeparator);
5504
5501
  }
5505
5502
  function normalizeSlashes(path) {
5506
- return path.indexOf("\\") !== -1 ? path.replace(backslashRegExp, directorySeparator) : path;
5503
+ return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
5507
5504
  }
5508
5505
  function reducePathComponents(components) {
5509
5506
  if (!some(components))
@@ -11523,7 +11520,7 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
11523
11520
  void 0,
11524
11521
  Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
11525
11522
  node10Result,
11526
- node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageName)}` : packageName
11523
+ node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
11527
11524
  ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
11528
11525
  /*details*/
11529
11526
  void 0,
@@ -14780,7 +14777,7 @@ function isQuoteOrBacktick(charCode) {
14780
14777
  }
14781
14778
  function isIntrinsicJsxName(name) {
14782
14779
  const ch = name.charCodeAt(0);
14783
- return ch >= 97 /* a */ && ch <= 122 /* z */ || stringContains(name, "-");
14780
+ return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
14784
14781
  }
14785
14782
  var indentStrings = ["", " "];
14786
14783
  function getIndentString(level) {
@@ -14794,7 +14791,7 @@ function getIndentSize() {
14794
14791
  return indentStrings[1].length;
14795
14792
  }
14796
14793
  function isNightly() {
14797
- return stringContains(version, "-dev") || stringContains(version, "-insiders");
14794
+ return version.includes("-dev") || version.includes("-insiders");
14798
14795
  }
14799
14796
  function createTextWriter(newLine) {
14800
14797
  var output;
@@ -14984,7 +14981,7 @@ function getExternalModuleNameFromDeclaration(host, resolver, declaration) {
14984
14981
  return void 0;
14985
14982
  }
14986
14983
  const specifier = getExternalModuleName(declaration);
14987
- if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).indexOf(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory()))) === -1) {
14984
+ if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
14988
14985
  return void 0;
14989
14986
  }
14990
14987
  return getResolvedExternalModuleName(host, file);
@@ -16792,7 +16789,7 @@ function getSupportedExtensions(options, extraFileExtensions) {
16792
16789
  const flatBuiltins = flatten(builtins);
16793
16790
  const extensions = [
16794
16791
  ...builtins,
16795
- ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.indexOf(x.extension) === -1 ? [x.extension] : void 0)
16792
+ ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
16796
16793
  ];
16797
16794
  return extensions;
16798
16795
  }
@@ -17234,7 +17231,7 @@ function expressionResultIsUnused(node) {
17234
17231
  }
17235
17232
  }
17236
17233
  function containsIgnoredPath(path) {
17237
- return some(ignoredPaths, (p) => stringContains(path, p));
17234
+ return some(ignoredPaths, (p) => path.includes(p));
17238
17235
  }
17239
17236
  function getContainingNodeArray(node) {
17240
17237
  if (!node.parent)
@@ -33483,7 +33480,7 @@ var IncrementalParser;
33483
33480
  })(InvalidPosition || (InvalidPosition = {}));
33484
33481
  })(IncrementalParser || (IncrementalParser = {}));
33485
33482
  function isDeclarationFileName(fileName) {
33486
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && stringContains(getBaseFileName(fileName), ".d.");
33483
+ return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
33487
33484
  }
33488
33485
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
33489
33486
  if (!mode) {
@@ -35198,7 +35195,7 @@ function parseListTypeOption(opt, value = "", errors) {
35198
35195
  if (startsWith(value, "-")) {
35199
35196
  return void 0;
35200
35197
  }
35201
- if (opt.type === "listOrElement" && !stringContains(value, ",")) {
35198
+ if (opt.type === "listOrElement" && !value.includes(",")) {
35202
35199
  return validateJsonOptionValue(opt, value, errors);
35203
35200
  }
35204
35201
  if (value === "") {
@@ -36222,7 +36219,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
36222
36219
  var _a;
36223
36220
  basePath = normalizeSlashes(basePath);
36224
36221
  const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
36225
- if (resolutionStack.indexOf(resolvedPath) >= 0) {
36222
+ if (resolutionStack.includes(resolvedPath)) {
36226
36223
  errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
36227
36224
  return { raw: json || convertToObject(sourceFile, errors) };
36228
36225
  }
@@ -37956,7 +37953,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
37956
37953
  result = tryResolve(extensions, state);
37957
37954
  }
37958
37955
  let legacyResult;
37959
- 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) {
37956
+ 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")) {
37960
37957
  traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
37961
37958
  const diagnosticState = {
37962
37959
  ...state,
@@ -38000,7 +37997,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
38000
37997
  resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
38001
37998
  }
38002
37999
  if (!resolved2) {
38003
- if (moduleName.indexOf(":") > -1) {
38000
+ if (moduleName.includes(":")) {
38004
38001
  if (traceEnabled) {
38005
38002
  trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
38006
38003
  }
@@ -38090,7 +38087,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
38090
38087
  }
38091
38088
  var nodeModulesPathPart = "/node_modules/";
38092
38089
  function pathContainsNodeModules(path) {
38093
- return stringContains(path, nodeModulesPathPart);
38090
+ return path.includes(nodeModulesPathPart);
38094
38091
  }
38095
38092
  function parseNodeModuleFromPath(resolved, isFolder) {
38096
38093
  const path = normalizePath(resolved);
@@ -38126,7 +38123,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
38126
38123
  }
38127
38124
  function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
38128
38125
  const filename = getBaseFileName(candidate);
38129
- if (filename.indexOf(".") === -1) {
38126
+ if (!filename.includes(".")) {
38130
38127
  return void 0;
38131
38128
  }
38132
38129
  let extensionless = removeFileExtension(candidate);
@@ -38550,7 +38547,7 @@ function comparePatternKeys(a, b) {
38550
38547
  }
38551
38548
  function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
38552
38549
  const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
38553
- if (!endsWith(moduleName, directorySeparator) && moduleName.indexOf("*") === -1 && hasProperty(lookupTable, moduleName)) {
38550
+ if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
38554
38551
  const target = lookupTable[moduleName];
38555
38552
  return loadModuleFromTargetImportOrExport(
38556
38553
  target,
@@ -38561,7 +38558,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
38561
38558
  moduleName
38562
38559
  );
38563
38560
  }
38564
- const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.indexOf("*") !== -1 || endsWith(k, "/")), comparePatternKeys);
38561
+ const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
38565
38562
  for (const potentialTarget of expandingKeys) {
38566
38563
  if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
38567
38564
  const target = lookupTable[potentialTarget];
@@ -38655,7 +38652,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38655
38652
  }
38656
38653
  const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
38657
38654
  const partsAfterFirst = parts.slice(1);
38658
- if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
38655
+ if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
38659
38656
  if (state.traceEnabled) {
38660
38657
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
38661
38658
  }
@@ -38666,7 +38663,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38666
38663
  }
38667
38664
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
38668
38665
  const subpathParts = getPathComponents(subpath);
38669
- if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) {
38666
+ if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
38670
38667
  if (state.traceEnabled) {
38671
38668
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
38672
38669
  }
@@ -38693,7 +38690,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38693
38690
  if (!Array.isArray(target)) {
38694
38691
  traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
38695
38692
  for (const condition of getOwnKeys(target)) {
38696
- if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) {
38693
+ if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
38697
38694
  traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
38698
38695
  const subTarget = target[condition];
38699
38696
  const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
@@ -38754,7 +38751,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38754
38751
  }
38755
38752
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
38756
38753
  var _a, _b, _c, _d;
38757
- 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)) {
38754
+ 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)) {
38758
38755
  const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
38759
38756
  const commonSourceDirGuesses = [];
38760
38757
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
@@ -38828,7 +38825,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38828
38825
  }
38829
38826
  }
38830
38827
  function isApplicableVersionedTypesKey(conditions, key) {
38831
- if (conditions.indexOf("types") === -1)
38828
+ if (!conditions.includes("types"))
38832
38829
  return false;
38833
38830
  if (!startsWith(key, "types@"))
38834
38831
  return false;
@@ -39033,7 +39030,7 @@ function getPackageNameFromTypesPackageName(mangledName) {
39033
39030
  return mangledName;
39034
39031
  }
39035
39032
  function unmangleScopedPackageName(typesPackageName) {
39036
- return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
39033
+ return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
39037
39034
  }
39038
39035
  function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
39039
39036
  const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
@@ -42663,12 +42660,12 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
42663
42660
  /*currentDirectory*/
42664
42661
  void 0
42665
42662
  );
42666
- const mode2 = endsWith(k, "/") ? 1 /* Directory */ : stringContains(k, "*") ? 2 /* Pattern */ : 0 /* Exact */;
42663
+ const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
42667
42664
  return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
42668
42665
  });
42669
42666
  } else {
42670
42667
  for (const key of getOwnKeys(exports)) {
42671
- if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
42668
+ if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
42672
42669
  const subTarget = exports[key];
42673
42670
  const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
42674
42671
  if (result) {
@@ -42834,7 +42831,7 @@ function processEnding(fileName, allowedEndings, options, host) {
42834
42831
  return fileName;
42835
42832
  } else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
42836
42833
  return noExtension + getJSExtensionForFile(fileName, options);
42837
- } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && stringContains(fileName, ".d.")) {
42834
+ } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
42838
42835
  return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
42839
42836
  }
42840
42837
  switch (allowedEndings[0]) {
@@ -42860,7 +42857,7 @@ function processEnding(fileName, allowedEndings, options, host) {
42860
42857
  }
42861
42858
  function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
42862
42859
  const baseName = getBaseFileName(fileName);
42863
- if (!endsWith(fileName, ".ts" /* Ts */) || !stringContains(baseName, ".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
42860
+ if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
42864
42861
  return void 0;
42865
42862
  const noExtension = removeExtension(fileName, ".ts" /* Ts */);
42866
42863
  const ext = noExtension.substring(noExtension.lastIndexOf("."));
@@ -48921,12 +48918,12 @@ function createTypeChecker(host) {
48921
48918
  if (!specifier) {
48922
48919
  specifier = getSpecifierForModuleSymbol(chain[0], context);
48923
48920
  }
48924
- if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.indexOf("/node_modules/") >= 0) {
48921
+ if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
48925
48922
  const oldSpecifier = specifier;
48926
48923
  if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
48927
48924
  const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
48928
48925
  specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
48929
- if (specifier.indexOf("/node_modules/") >= 0) {
48926
+ if (specifier.includes("/node_modules/")) {
48930
48927
  specifier = oldSpecifier;
48931
48928
  } else {
48932
48929
  assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
@@ -49632,7 +49629,7 @@ function createTypeChecker(host) {
49632
49629
  for (const group2 of groups) {
49633
49630
  if (group2.length > 1) {
49634
49631
  statements = [
49635
- ...filter(statements, (s) => group2.indexOf(s) === -1),
49632
+ ...filter(statements, (s) => !group2.includes(s)),
49636
49633
  factory.createExportDeclaration(
49637
49634
  /*modifiers*/
49638
49635
  void 0,
@@ -62592,6 +62589,9 @@ function createTypeChecker(host) {
62592
62589
  function isArrayLikeType(type) {
62593
62590
  return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);
62594
62591
  }
62592
+ function isMutableArrayLikeType(type) {
62593
+ return isMutableArrayOrTuple(type) || !(type.flags & (1 /* Any */ | 98304 /* Nullable */)) && isTypeAssignableTo(type, anyArrayType);
62594
+ }
62595
62595
  function getSingleBaseForNonAugmentingSubtype(type) {
62596
62596
  if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
62597
62597
  return void 0;
@@ -63009,7 +63009,7 @@ function createTypeChecker(host) {
63009
63009
  const param = declaration;
63010
63010
  if (isIdentifier(param.name)) {
63011
63011
  const originalKeywordKind = identifierToKeywordKind(param.name);
63012
- if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
63012
+ if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
63013
63013
  param,
63014
63014
  param.name.escapedText,
63015
63015
  788968 /* Type */,
@@ -63095,7 +63095,12 @@ function createTypeChecker(host) {
63095
63095
  callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
63096
63096
  }
63097
63097
  if (targetRestType) {
63098
- callback(getRestTypeAtPosition(source, paramCount), targetRestType);
63098
+ callback(getRestTypeAtPosition(
63099
+ source,
63100
+ paramCount,
63101
+ /*readonly*/
63102
+ isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType)
63103
+ ), targetRestType);
63099
63104
  }
63100
63105
  }
63101
63106
  function applyToReturnTypes(source, target, callback) {
@@ -68081,7 +68086,7 @@ function createTypeChecker(host) {
68081
68086
  elementTypes,
68082
68087
  elementFlags,
68083
68088
  /*readonly*/
68084
- inConstContext
68089
+ inConstContext && !(contextualType && someType(contextualType, isMutableArrayLikeType))
68085
68090
  ));
68086
68091
  }
68087
68092
  return createArrayLiteralType(createArrayType(
@@ -68397,7 +68402,7 @@ function createTypeChecker(host) {
68397
68402
  return getJsxElementTypeAt(node) || anyType;
68398
68403
  }
68399
68404
  function isHyphenatedJsxName(name) {
68400
- return stringContains(name, "-");
68405
+ return name.includes("-");
68401
68406
  }
68402
68407
  function isJsxIntrinsicTagName(tagName) {
68403
68408
  return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
@@ -70102,7 +70107,7 @@ function createTypeChecker(host) {
70102
70107
  names.push(arg.tupleNameSource);
70103
70108
  }
70104
70109
  }
70105
- return createTupleType(types, flags, inConstContext, length(names) === length(types) ? names : void 0);
70110
+ return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), length(names) === length(types) ? names : void 0);
70106
70111
  }
70107
70112
  function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
70108
70113
  const isJavascript = isInJSFile(signature.declaration);
@@ -72183,7 +72188,7 @@ function createTypeChecker(host) {
72183
72188
  }
72184
72189
  return void 0;
72185
72190
  }
72186
- function getRestTypeAtPosition(source, pos) {
72191
+ function getRestTypeAtPosition(source, pos, readonly) {
72187
72192
  const parameterCount = getParameterCount(source);
72188
72193
  const minArgumentCount = getMinArgumentCount(source);
72189
72194
  const restType = getEffectiveRestType(source);
@@ -72206,13 +72211,7 @@ function createTypeChecker(host) {
72206
72211
  names.push(name);
72207
72212
  }
72208
72213
  }
72209
- return createTupleType(
72210
- types,
72211
- flags,
72212
- /*readonly*/
72213
- false,
72214
- length(names) === length(types) ? names : void 0
72215
- );
72214
+ return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
72216
72215
  }
72217
72216
  function getParameterCount(signature) {
72218
72217
  const length2 = signature.parameters.length;
@@ -83560,7 +83559,7 @@ function createTypeChecker(host) {
83560
83559
  return false;
83561
83560
  }
83562
83561
  function checkGrammarNumericLiteral(node) {
83563
- const isFractional = getTextOfNode(node).indexOf(".") !== -1;
83562
+ const isFractional = getTextOfNode(node).includes(".");
83564
83563
  const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
83565
83564
  if (isFractional || isScientific) {
83566
83565
  return;
@@ -106535,7 +106534,7 @@ function getDeclarationDiagnostics(host, resolver, file) {
106535
106534
  }
106536
106535
  function hasInternalAnnotation(range, currentSourceFile) {
106537
106536
  const comment = currentSourceFile.text.substring(range.pos, range.end);
106538
- return stringContains(comment, "@internal");
106537
+ return comment.includes("@internal");
106539
106538
  }
106540
106539
  function isInternalDeclaration(node, currentSourceFile) {
106541
106540
  const parseTreeNode = getParseTreeNode(node);
@@ -111014,7 +111013,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111014
111013
  /*jsxAttributeEscape*/
111015
111014
  false
111016
111015
  );
111017
- return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !stringContains(text, tokenToString(25 /* DotToken */)) && !stringContains(text, String.fromCharCode(69 /* E */)) && !stringContains(text, String.fromCharCode(101 /* e */));
111016
+ return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
111018
111017
  } else if (isAccessExpression(expression)) {
111019
111018
  const constantValue = getConstantValue(expression);
111020
111019
  return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
@@ -115847,7 +115846,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115847
115846
  const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
115848
115847
  if (resultFromDts)
115849
115848
  return resultFromDts;
115850
- if (!host.realpath || !options.preserveSymlinks || !stringContains(file.originalFileName, nodeModulesPathPart))
115849
+ if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
115851
115850
  return void 0;
115852
115851
  const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
115853
115852
  return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
@@ -117105,7 +117104,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117105
117104
  const path = toPath3(fileName);
117106
117105
  if (useSourceOfProjectReferenceRedirect) {
117107
117106
  let source = getSourceOfProjectReferenceRedirect(path);
117108
- if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && stringContains(fileName, nodeModulesPathPart)) {
117107
+ if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
117109
117108
  const realPath2 = toPath3(host.realpath(fileName));
117110
117109
  if (realPath2 !== path)
117111
117110
  source = getSourceOfProjectReferenceRedirect(realPath2);
@@ -118465,7 +118464,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
118465
118464
  var _a;
118466
118465
  if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
118467
118466
  return;
118468
- if (!originalRealpath || !stringContains(directory, nodeModulesPathPart))
118467
+ if (!originalRealpath || !directory.includes(nodeModulesPathPart))
118469
118468
  return;
118470
118469
  const symlinkCache = host.getSymlinkCache();
118471
118470
  const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
@@ -118493,7 +118492,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
118493
118492
  if (!symlinkedDirectories)
118494
118493
  return false;
118495
118494
  const fileOrDirectoryPath = host.toPath(fileOrDirectory);
118496
- if (!stringContains(fileOrDirectoryPath, nodeModulesPathPart))
118495
+ if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
118497
118496
  return false;
118498
118497
  if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
118499
118498
  return true;
@@ -120351,7 +120350,7 @@ function removeIgnoredPath(path) {
120351
120350
  if (endsWith(path, "/node_modules/.staging")) {
120352
120351
  return removeSuffix(path, "/.staging");
120353
120352
  }
120354
- return some(ignoredPaths, (searchPath) => stringContains(path, searchPath)) ? void 0 : path;
120353
+ return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
120355
120354
  }
120356
120355
  function perceivedOsRootLengthForWatching(pathComponents2, length2) {
120357
120356
  if (length2 <= 1)
@@ -124767,7 +124766,7 @@ function createColors(sys2) {
124767
124766
  function bold(str) {
124768
124767
  return `\x1B[1m${str}\x1B[22m`;
124769
124768
  }
124770
- const isWindows = sys2.getEnvironmentVariable("OS") && stringContains(sys2.getEnvironmentVariable("OS").toLowerCase(), "windows");
124769
+ const isWindows = sys2.getEnvironmentVariable("OS") && sys2.getEnvironmentVariable("OS").toLowerCase().includes("windows");
124771
124770
  const isWindowsTerminal = sys2.getEnvironmentVariable("WT_SESSION");
124772
124771
  const isVSCode = sys2.getEnvironmentVariable("TERM_PROGRAM") && sys2.getEnvironmentVariable("TERM_PROGRAM") === "vscode";
124773
124772
  function blue(str) {