typescript 5.3.0-dev.20230824 → 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.
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.3";
38
- version = `${versionMajorMinor}.0-dev.20230824`;
38
+ version = `${versionMajorMinor}.0-dev.20230826`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -1398,9 +1398,6 @@ var ts = (() => {
1398
1398
  function tryRemoveSuffix(str, suffix) {
1399
1399
  return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0;
1400
1400
  }
1401
- function stringContains(str, substring) {
1402
- return str.indexOf(substring) !== -1;
1403
- }
1404
1401
  function removeMinAndVersionNumbers(fileName) {
1405
1402
  let end = fileName.length;
1406
1403
  for (let pos = end - 1; pos > 0; pos--) {
@@ -5765,11 +5762,11 @@ ${lanes.join("\n")}
5765
5762
  return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
5766
5763
  }
5767
5764
  function isInPath(path, searchPath) {
5768
- if (stringContains(path, searchPath))
5765
+ if (path.includes(searchPath))
5769
5766
  return true;
5770
5767
  if (useCaseSensitiveFileNames2)
5771
5768
  return false;
5772
- return stringContains(toCanonicalFilePath(path), searchPath);
5769
+ return toCanonicalFilePath(path).includes(searchPath);
5773
5770
  }
5774
5771
  }
5775
5772
  function createFileWatcherCallback(callback) {
@@ -6638,7 +6635,7 @@ ${lanes.join("\n")}
6638
6635
  return !pathIsAbsolute(path) && !pathIsRelative(path);
6639
6636
  }
6640
6637
  function hasExtension(fileName) {
6641
- return stringContains(getBaseFileName(fileName), ".");
6638
+ return getBaseFileName(fileName).includes(".");
6642
6639
  }
6643
6640
  function fileExtensionIs(path, extension) {
6644
6641
  return path.length > extension.length && endsWith(path, extension);
@@ -6783,7 +6780,7 @@ ${lanes.join("\n")}
6783
6780
  return root + pathComponents2.slice(1, length2).join(directorySeparator);
6784
6781
  }
6785
6782
  function normalizeSlashes(path) {
6786
- return path.indexOf("\\") !== -1 ? path.replace(backslashRegExp, directorySeparator) : path;
6783
+ return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
6787
6784
  }
6788
6785
  function reducePathComponents(components) {
6789
6786
  if (!some(components))
@@ -13032,7 +13029,7 @@ ${lanes.join("\n")}
13032
13029
  void 0,
13033
13030
  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,
13034
13031
  node10Result,
13035
- node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageName)}` : packageName
13032
+ node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
13036
13033
  ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
13037
13034
  /*details*/
13038
13035
  void 0,
@@ -16053,7 +16050,7 @@ ${lanes.join("\n")}
16053
16050
  }
16054
16051
  function isIntrinsicJsxName(name) {
16055
16052
  const ch = name.charCodeAt(0);
16056
- return ch >= 97 /* a */ && ch <= 122 /* z */ || stringContains(name, "-");
16053
+ return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
16057
16054
  }
16058
16055
  function getIndentString(level) {
16059
16056
  const singleLevel = indentStrings[1];
@@ -16066,7 +16063,7 @@ ${lanes.join("\n")}
16066
16063
  return indentStrings[1].length;
16067
16064
  }
16068
16065
  function isNightly() {
16069
- return stringContains(version, "-dev") || stringContains(version, "-insiders");
16066
+ return version.includes("-dev") || version.includes("-insiders");
16070
16067
  }
16071
16068
  function createTextWriter(newLine) {
16072
16069
  var output;
@@ -16256,7 +16253,7 @@ ${lanes.join("\n")}
16256
16253
  return void 0;
16257
16254
  }
16258
16255
  const specifier = getExternalModuleName(declaration);
16259
- if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).indexOf(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory()))) === -1) {
16256
+ if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
16260
16257
  return void 0;
16261
16258
  }
16262
16259
  return getResolvedExternalModuleName(host, file);
@@ -18196,7 +18193,7 @@ ${lanes.join("\n")}
18196
18193
  const flatBuiltins = flatten(builtins);
18197
18194
  const extensions = [
18198
18195
  ...builtins,
18199
- ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.indexOf(x.extension) === -1 ? [x.extension] : void 0)
18196
+ ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
18200
18197
  ];
18201
18198
  return extensions;
18202
18199
  }
@@ -18646,7 +18643,7 @@ ${lanes.join("\n")}
18646
18643
  }
18647
18644
  }
18648
18645
  function containsIgnoredPath(path) {
18649
- return some(ignoredPaths, (p) => stringContains(path, p));
18646
+ return some(ignoredPaths, (p) => path.includes(p));
18650
18647
  }
18651
18648
  function getContainingNodeArray(node) {
18652
18649
  if (!node.parent)
@@ -28199,7 +28196,7 @@ ${lanes.join("\n")}
28199
28196
  return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
28200
28197
  }
28201
28198
  function isDeclarationFileName(fileName) {
28202
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && stringContains(getBaseFileName(fileName), ".d.");
28199
+ return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
28203
28200
  }
28204
28201
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
28205
28202
  if (!mode) {
@@ -32436,7 +32433,9 @@ ${lanes.join("\n")}
32436
32433
  let dotDotDotToken;
32437
32434
  let expression;
32438
32435
  if (token() !== 20 /* CloseBraceToken */) {
32439
- dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
32436
+ if (!inExpressionContext) {
32437
+ dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
32438
+ }
32440
32439
  expression = parseExpression();
32441
32440
  }
32442
32441
  if (inExpressionContext) {
@@ -35985,7 +35984,7 @@ ${lanes.join("\n")}
35985
35984
  if (startsWith(value, "-")) {
35986
35985
  return void 0;
35987
35986
  }
35988
- if (opt.type === "listOrElement" && !stringContains(value, ",")) {
35987
+ if (opt.type === "listOrElement" && !value.includes(",")) {
35989
35988
  return validateJsonOptionValue(opt, value, errors);
35990
35989
  }
35991
35990
  if (value === "") {
@@ -36964,7 +36963,7 @@ ${lanes.join("\n")}
36964
36963
  var _a;
36965
36964
  basePath = normalizeSlashes(basePath);
36966
36965
  const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
36967
- if (resolutionStack.indexOf(resolvedPath) >= 0) {
36966
+ if (resolutionStack.includes(resolvedPath)) {
36968
36967
  errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
36969
36968
  return { raw: json || convertToObject(sourceFile, errors) };
36970
36969
  }
@@ -40319,7 +40318,7 @@ ${lanes.join("\n")}
40319
40318
  result = tryResolve(extensions, state);
40320
40319
  }
40321
40320
  let legacyResult;
40322
- 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) {
40321
+ 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")) {
40323
40322
  traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
40324
40323
  const diagnosticState = {
40325
40324
  ...state,
@@ -40363,7 +40362,7 @@ ${lanes.join("\n")}
40363
40362
  resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
40364
40363
  }
40365
40364
  if (!resolved2) {
40366
- if (moduleName.indexOf(":") > -1) {
40365
+ if (moduleName.includes(":")) {
40367
40366
  if (traceEnabled) {
40368
40367
  trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
40369
40368
  }
@@ -40452,7 +40451,7 @@ ${lanes.join("\n")}
40452
40451
  return void 0;
40453
40452
  }
40454
40453
  function pathContainsNodeModules(path) {
40455
- return stringContains(path, nodeModulesPathPart);
40454
+ return path.includes(nodeModulesPathPart);
40456
40455
  }
40457
40456
  function parseNodeModuleFromPath(resolved, isFolder) {
40458
40457
  const path = normalizePath(resolved);
@@ -40488,7 +40487,7 @@ ${lanes.join("\n")}
40488
40487
  }
40489
40488
  function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
40490
40489
  const filename = getBaseFileName(candidate);
40491
- if (filename.indexOf(".") === -1) {
40490
+ if (!filename.includes(".")) {
40492
40491
  return void 0;
40493
40492
  }
40494
40493
  let extensionless = removeFileExtension(candidate);
@@ -40645,7 +40644,7 @@ ${lanes.join("\n")}
40645
40644
  function loadEntrypointsFromTargetExports(target) {
40646
40645
  var _a, _b;
40647
40646
  if (typeof target === "string" && startsWith(target, "./")) {
40648
- if (target.indexOf("*") >= 0 && state.host.readDirectory) {
40647
+ if (target.includes("*") && state.host.readDirectory) {
40649
40648
  if (target.indexOf("*") !== target.lastIndexOf("*")) {
40650
40649
  return false;
40651
40650
  }
@@ -40664,7 +40663,7 @@ ${lanes.join("\n")}
40664
40663
  });
40665
40664
  } else {
40666
40665
  const partsAfterFirst = getPathComponents(target).slice(2);
40667
- if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
40666
+ if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
40668
40667
  return false;
40669
40668
  }
40670
40669
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
@@ -41032,7 +41031,7 @@ ${lanes.join("\n")}
41032
41031
  }
41033
41032
  function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
41034
41033
  const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
41035
- if (!endsWith(moduleName, directorySeparator) && moduleName.indexOf("*") === -1 && hasProperty(lookupTable, moduleName)) {
41034
+ if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
41036
41035
  const target = lookupTable[moduleName];
41037
41036
  return loadModuleFromTargetImportOrExport(
41038
41037
  target,
@@ -41043,7 +41042,7 @@ ${lanes.join("\n")}
41043
41042
  moduleName
41044
41043
  );
41045
41044
  }
41046
- const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.indexOf("*") !== -1 || endsWith(k, "/")), comparePatternKeys);
41045
+ const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
41047
41046
  for (const potentialTarget of expandingKeys) {
41048
41047
  if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
41049
41048
  const target = lookupTable[potentialTarget];
@@ -41137,7 +41136,7 @@ ${lanes.join("\n")}
41137
41136
  }
41138
41137
  const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
41139
41138
  const partsAfterFirst = parts.slice(1);
41140
- if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
41139
+ if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
41141
41140
  if (state.traceEnabled) {
41142
41141
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
41143
41142
  }
@@ -41148,7 +41147,7 @@ ${lanes.join("\n")}
41148
41147
  }
41149
41148
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
41150
41149
  const subpathParts = getPathComponents(subpath);
41151
- if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) {
41150
+ if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
41152
41151
  if (state.traceEnabled) {
41153
41152
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
41154
41153
  }
@@ -41175,7 +41174,7 @@ ${lanes.join("\n")}
41175
41174
  if (!Array.isArray(target)) {
41176
41175
  traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
41177
41176
  for (const condition of getOwnKeys(target)) {
41178
- if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) {
41177
+ if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
41179
41178
  traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
41180
41179
  const subTarget = target[condition];
41181
41180
  const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
@@ -41236,7 +41235,7 @@ ${lanes.join("\n")}
41236
41235
  }
41237
41236
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
41238
41237
  var _a, _b, _c, _d;
41239
- 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)) {
41238
+ 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)) {
41240
41239
  const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
41241
41240
  const commonSourceDirGuesses = [];
41242
41241
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
@@ -41310,7 +41309,7 @@ ${lanes.join("\n")}
41310
41309
  }
41311
41310
  }
41312
41311
  function isApplicableVersionedTypesKey(conditions, key) {
41313
- if (conditions.indexOf("types") === -1)
41312
+ if (!conditions.includes("types"))
41314
41313
  return false;
41315
41314
  if (!startsWith(key, "types@"))
41316
41315
  return false;
@@ -41514,7 +41513,7 @@ ${lanes.join("\n")}
41514
41513
  return mangledName;
41515
41514
  }
41516
41515
  function unmangleScopedPackageName(typesPackageName) {
41517
- return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
41516
+ return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
41518
41517
  }
41519
41518
  function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
41520
41519
  const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
@@ -45229,12 +45228,12 @@ ${lanes.join("\n")}
45229
45228
  /*currentDirectory*/
45230
45229
  void 0
45231
45230
  );
45232
- const mode2 = endsWith(k, "/") ? 1 /* Directory */ : stringContains(k, "*") ? 2 /* Pattern */ : 0 /* Exact */;
45231
+ const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
45233
45232
  return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
45234
45233
  });
45235
45234
  } else {
45236
45235
  for (const key of getOwnKeys(exports)) {
45237
- if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
45236
+ if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
45238
45237
  const subTarget = exports[key];
45239
45238
  const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
45240
45239
  if (result) {
@@ -45400,7 +45399,7 @@ ${lanes.join("\n")}
45400
45399
  return fileName;
45401
45400
  } else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
45402
45401
  return noExtension + getJSExtensionForFile(fileName, options);
45403
- } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && stringContains(fileName, ".d.")) {
45402
+ } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
45404
45403
  return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
45405
45404
  }
45406
45405
  switch (allowedEndings[0]) {
@@ -45426,7 +45425,7 @@ ${lanes.join("\n")}
45426
45425
  }
45427
45426
  function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
45428
45427
  const baseName = getBaseFileName(fileName);
45429
- if (!endsWith(fileName, ".ts" /* Ts */) || !stringContains(baseName, ".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
45428
+ if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
45430
45429
  return void 0;
45431
45430
  const noExtension = removeExtension(fileName, ".ts" /* Ts */);
45432
45431
  const ext = noExtension.substring(noExtension.lastIndexOf("."));
@@ -46887,6 +46886,9 @@ ${lanes.join("\n")}
46887
46886
  const sourceFiles = host.getSourceFiles();
46888
46887
  return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
46889
46888
  }
46889
+ if (!!(usage.flags & 16777216 /* JSDoc */) || isInTypeQuery(usage) || isInAmbientOrTypeNode(usage)) {
46890
+ return true;
46891
+ }
46890
46892
  if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
46891
46893
  if (declaration.kind === 208 /* BindingElement */) {
46892
46894
  const errorBindingElement = getAncestor(usage, 208 /* BindingElement */);
@@ -46916,9 +46918,6 @@ ${lanes.join("\n")}
46916
46918
  if (usage.kind === 277 /* ExportAssignment */ && usage.isExportEquals) {
46917
46919
  return true;
46918
46920
  }
46919
- if (!!(usage.flags & 16777216 /* JSDoc */) || isInTypeQuery(usage) || isInAmbientOrTypeNode(usage)) {
46920
- return true;
46921
- }
46922
46921
  if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
46923
46922
  if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
46924
46923
  return !isPropertyImmediatelyReferencedWithinDeclaration(
@@ -51388,12 +51387,12 @@ ${lanes.join("\n")}
51388
51387
  if (!specifier) {
51389
51388
  specifier = getSpecifierForModuleSymbol(chain[0], context);
51390
51389
  }
51391
- if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.indexOf("/node_modules/") >= 0) {
51390
+ if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
51392
51391
  const oldSpecifier = specifier;
51393
51392
  if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
51394
51393
  const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
51395
51394
  specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
51396
- if (specifier.indexOf("/node_modules/") >= 0) {
51395
+ if (specifier.includes("/node_modules/")) {
51397
51396
  specifier = oldSpecifier;
51398
51397
  } else {
51399
51398
  assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
@@ -52099,7 +52098,7 @@ ${lanes.join("\n")}
52099
52098
  for (const group2 of groups) {
52100
52099
  if (group2.length > 1) {
52101
52100
  statements = [
52102
- ...filter(statements, (s) => group2.indexOf(s) === -1),
52101
+ ...filter(statements, (s) => !group2.includes(s)),
52103
52102
  factory.createExportDeclaration(
52104
52103
  /*modifiers*/
52105
52104
  void 0,
@@ -53128,8 +53127,8 @@ ${lanes.join("\n")}
53128
53127
  });
53129
53128
  }
53130
53129
  });
53131
- Debug.assert(setter && isFunctionLikeDeclaration(setter));
53132
- const paramSymbol = getSignatureFromDeclaration(setter).parameters[0];
53130
+ Debug.assert(!!setter);
53131
+ const paramSymbol = isFunctionLikeDeclaration(setter) ? getSignatureFromDeclaration(setter).parameters[0] : void 0;
53133
53132
  result.push(setTextRange(
53134
53133
  factory.createSetAccessorDeclaration(
53135
53134
  factory.createModifiersFromModifierFlags(flag),
@@ -53905,7 +53904,7 @@ ${lanes.join("\n")}
53905
53904
  const pattern = declaration.parent;
53906
53905
  if (strictNullChecks && declaration.flags & 33554432 /* Ambient */ && isParameterDeclaration(declaration)) {
53907
53906
  parentType = getNonNullableType(parentType);
53908
- } else if (strictNullChecks && pattern.parent.initializer && !(getTypeFacts(getTypeOfInitializer(pattern.parent.initializer)) & 65536 /* EQUndefined */)) {
53907
+ } else if (strictNullChecks && pattern.parent.initializer && !hasTypeFacts(getTypeOfInitializer(pattern.parent.initializer), 65536 /* EQUndefined */)) {
53909
53908
  parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);
53910
53909
  }
53911
53910
  let type;
@@ -53948,7 +53947,7 @@ ${lanes.join("\n")}
53948
53947
  return type;
53949
53948
  }
53950
53949
  if (getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration))) {
53951
- return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
53950
+ return strictNullChecks && !hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
53952
53951
  }
53953
53952
  return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
53954
53953
  }
@@ -62056,7 +62055,7 @@ ${lanes.join("\n")}
62056
62055
  if (sourceType && targetType) {
62057
62056
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
62058
62057
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
62059
- const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && (getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */);
62058
+ const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts(sourceType, 50331648 /* IsUndefinedOrNull */) === getTypeFacts(targetType, 50331648 /* IsUndefinedOrNull */);
62060
62059
  let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 /* StrictArity */ | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(
62061
62060
  sourceType,
62062
62061
  targetType,
@@ -65213,7 +65212,7 @@ ${lanes.join("\n")}
65213
65212
  return value.base10Value === "0";
65214
65213
  }
65215
65214
  function removeDefinitelyFalsyTypes(type) {
65216
- return filterType(type, (t) => !!(getTypeFacts(t) & 4194304 /* Truthy */));
65215
+ return filterType(type, (t) => hasTypeFacts(t, 4194304 /* Truthy */));
65217
65216
  }
65218
65217
  function extractDefinitelyFalsyTypes(type) {
65219
65218
  return mapType(type, getDefinitelyFalsyPartOfType);
@@ -65476,7 +65475,7 @@ ${lanes.join("\n")}
65476
65475
  const param = declaration;
65477
65476
  if (isIdentifier(param.name)) {
65478
65477
  const originalKeywordKind = identifierToKeywordKind(param.name);
65479
- if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
65478
+ if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
65480
65479
  param,
65481
65480
  param.name.escapedText,
65482
65481
  788968 /* Type */,
@@ -66958,7 +66957,13 @@ ${lanes.join("\n")}
66958
66957
  const resolved = resolveStructuredTypeMembers(type);
66959
66958
  return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
66960
66959
  }
66961
- function getTypeFacts(type) {
66960
+ function getTypeFacts(type, mask2) {
66961
+ return getTypeFactsWorker(type, mask2) & mask2;
66962
+ }
66963
+ function hasTypeFacts(type, mask2) {
66964
+ return getTypeFacts(type, mask2) !== 0;
66965
+ }
66966
+ function getTypeFactsWorker(type, callerOnlyNeeds) {
66962
66967
  if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
66963
66968
  type = getBaseConstraintOfType(type) || unknownType;
66964
66969
  }
@@ -66991,6 +66996,10 @@ ${lanes.join("\n")}
66991
66996
  return strictNullChecks ? type === falseType || type === regularFalseType ? 12121864 /* FalseStrictFacts */ : 7927560 /* TrueStrictFacts */ : type === falseType || type === regularFalseType ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
66992
66997
  }
66993
66998
  if (flags & 524288 /* Object */) {
66999
+ const possibleFacts = strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ | 7880640 /* FunctionStrictFacts */ | 7888800 /* ObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ | 16728e3 /* FunctionFacts */ | 16736160 /* ObjectFacts */;
67000
+ if ((callerOnlyNeeds & possibleFacts) === 0) {
67001
+ return 0;
67002
+ }
66994
67003
  return getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ? strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ : isFunctionObjectType(type) ? strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728e3 /* FunctionFacts */ : strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
66995
67004
  }
66996
67005
  if (flags & 16384 /* Void */) {
@@ -67012,20 +67021,20 @@ ${lanes.join("\n")}
67012
67021
  return 0 /* None */;
67013
67022
  }
67014
67023
  if (flags & 1048576 /* Union */) {
67015
- return reduceLeft(type.types, (facts, t) => facts | getTypeFacts(t), 0 /* None */);
67024
+ return reduceLeft(type.types, (facts, t) => facts | getTypeFactsWorker(t, callerOnlyNeeds), 0 /* None */);
67016
67025
  }
67017
67026
  if (flags & 2097152 /* Intersection */) {
67018
- return getIntersectionTypeFacts(type);
67027
+ return getIntersectionTypeFacts(type, callerOnlyNeeds);
67019
67028
  }
67020
67029
  return 83886079 /* UnknownFacts */;
67021
67030
  }
67022
- function getIntersectionTypeFacts(type) {
67031
+ function getIntersectionTypeFacts(type, callerOnlyNeeds) {
67023
67032
  const ignoreObjects = maybeTypeOfKind(type, 402784252 /* Primitive */);
67024
67033
  let oredFacts = 0 /* None */;
67025
67034
  let andedFacts = 134217727 /* All */;
67026
67035
  for (const t of type.types) {
67027
67036
  if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
67028
- const f = getTypeFacts(t);
67037
+ const f = getTypeFactsWorker(t, callerOnlyNeeds);
67029
67038
  oredFacts |= f;
67030
67039
  andedFacts &= f;
67031
67040
  }
@@ -67033,19 +67042,19 @@ ${lanes.join("\n")}
67033
67042
  return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
67034
67043
  }
67035
67044
  function getTypeWithFacts(type, include) {
67036
- return filterType(type, (t) => (getTypeFacts(t) & include) !== 0);
67045
+ return filterType(type, (t) => hasTypeFacts(t, include));
67037
67046
  }
67038
67047
  function getAdjustedTypeWithFacts(type, facts) {
67039
67048
  const reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
67040
67049
  if (strictNullChecks) {
67041
67050
  switch (facts) {
67042
67051
  case 524288 /* NEUndefined */:
67043
- return mapType(reduced, (t) => getTypeFacts(t) & 65536 /* EQUndefined */ ? getIntersectionType([t, getTypeFacts(t) & 131072 /* EQNull */ && !maybeTypeOfKind(reduced, 65536 /* Null */) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t);
67052
+ return mapType(reduced, (t) => hasTypeFacts(t, 65536 /* EQUndefined */) ? getIntersectionType([t, hasTypeFacts(t, 131072 /* EQNull */) && !maybeTypeOfKind(reduced, 65536 /* Null */) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t);
67044
67053
  case 1048576 /* NENull */:
67045
- return mapType(reduced, (t) => getTypeFacts(t) & 131072 /* EQNull */ ? getIntersectionType([t, getTypeFacts(t) & 65536 /* EQUndefined */ && !maybeTypeOfKind(reduced, 32768 /* Undefined */) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t);
67054
+ return mapType(reduced, (t) => hasTypeFacts(t, 131072 /* EQNull */) ? getIntersectionType([t, hasTypeFacts(t, 65536 /* EQUndefined */) && !maybeTypeOfKind(reduced, 32768 /* Undefined */) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t);
67046
67055
  case 2097152 /* NEUndefinedOrNull */:
67047
67056
  case 4194304 /* Truthy */:
67048
- return mapType(reduced, (t) => getTypeFacts(t) & 262144 /* EQUndefinedOrNull */ ? getGlobalNonNullableTypeInstantiation(t) : t);
67057
+ return mapType(reduced, (t) => hasTypeFacts(t, 262144 /* EQUndefinedOrNull */) ? getGlobalNonNullableTypeInstantiation(t) : t);
67049
67058
  }
67050
67059
  }
67051
67060
  return reduced;
@@ -68382,14 +68391,14 @@ ${lanes.join("\n")}
68382
68391
  // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
68383
68392
  // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
68384
68393
  // but are classified as "function" according to `typeof`.
68385
- isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
68394
+ isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? hasTypeFacts(t, facts) ? t : neverType : (
68386
68395
  // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
68387
68396
  // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
68388
68397
  isTypeSubtypeOf(impliedType, t) ? impliedType : (
68389
68398
  // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
68390
68399
  // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
68391
68400
  // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
68392
- getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
68401
+ hasTypeFacts(t, facts) ? getIntersectionType([t, impliedType]) : neverType
68393
68402
  )
68394
68403
  )
68395
68404
  ));
@@ -68403,7 +68412,7 @@ ${lanes.join("\n")}
68403
68412
  const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
68404
68413
  if (hasDefaultClause) {
68405
68414
  const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses);
68406
- return filterType(type, (t) => (getTypeFacts(t) & notEqualFacts) === notEqualFacts);
68415
+ return filterType(type, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
68407
68416
  }
68408
68417
  const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
68409
68418
  return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
@@ -68541,7 +68550,7 @@ ${lanes.join("\n")}
68541
68550
  false
68542
68551
  );
68543
68552
  }
68544
- if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) && !(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
68553
+ if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) && !hasTypeFacts(predicate.type, 65536 /* EQUndefined */)) {
68545
68554
  type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
68546
68555
  }
68547
68556
  const access = getDiscriminantPropertyAccess(predicateArgument, type);
@@ -68675,7 +68684,7 @@ ${lanes.join("\n")}
68675
68684
  reportCircularityError(declaration.symbol);
68676
68685
  return true;
68677
68686
  }
68678
- const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */);
68687
+ const containsUndefined = !!hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */);
68679
68688
  if (!popTypeResolution()) {
68680
68689
  reportCircularityError(declaration.symbol);
68681
68690
  return true;
@@ -68685,7 +68694,7 @@ ${lanes.join("\n")}
68685
68694
  return links.parameterInitializerContainsUndefined;
68686
68695
  }
68687
68696
  function removeOptionalityFromDeclaredType(declaredType, declaration) {
68688
- const removeUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration);
68697
+ const removeUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && hasTypeFacts(declaredType, 16777216 /* IsUndefined */) && !parameterInitializerContainsUndefined(declaration);
68689
68698
  return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
68690
68699
  }
68691
68700
  function isConstraintPosition(type, node) {
@@ -70854,7 +70863,7 @@ ${lanes.join("\n")}
70854
70863
  return getJsxElementTypeAt(node) || anyType;
70855
70864
  }
70856
70865
  function isHyphenatedJsxName(name) {
70857
- return stringContains(name, "-");
70866
+ return name.includes("-");
70858
70867
  }
70859
70868
  function isJsxIntrinsicTagName(tagName) {
70860
70869
  return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
@@ -71515,7 +71524,7 @@ ${lanes.join("\n")}
71515
71524
  return checkNonNullType(checkExpression(node), node);
71516
71525
  }
71517
71526
  function isNullableType(type) {
71518
- return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */);
71527
+ return hasTypeFacts(type, 50331648 /* IsUndefinedOrNull */);
71519
71528
  }
71520
71529
  function getNonNullableTypeIfNeeded(type) {
71521
71530
  return isNullableType(type) ? getNonNullableType(type) : type;
@@ -71561,7 +71570,7 @@ ${lanes.join("\n")}
71561
71570
  error2(node, Diagnostics.Object_is_of_type_unknown);
71562
71571
  return errorType;
71563
71572
  }
71564
- const facts = getTypeFacts(type);
71573
+ const facts = getTypeFacts(type, 50331648 /* IsUndefinedOrNull */);
71565
71574
  if (facts & 50331648 /* IsUndefinedOrNull */) {
71566
71575
  reportError(node, facts);
71567
71576
  const t = getNonNullableType(type);
@@ -75341,7 +75350,7 @@ ${lanes.join("\n")}
75341
75350
  if (operandConstraint.flags & 3 /* AnyOrUnknown */) {
75342
75351
  return (556800 /* AllTypeofNE */ & notEqualFacts) === 556800 /* AllTypeofNE */;
75343
75352
  }
75344
- return !someType(operandConstraint, (t) => (getTypeFacts(t) & notEqualFacts) === notEqualFacts);
75353
+ return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
75345
75354
  }
75346
75355
  const type = checkExpressionCached(node.expression);
75347
75356
  if (!isLiteralType(type)) {
@@ -75659,14 +75668,15 @@ ${lanes.join("\n")}
75659
75668
  if (symbol) {
75660
75669
  if (isReadonlySymbol(symbol)) {
75661
75670
  error2(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property);
75671
+ } else {
75672
+ checkDeleteExpressionMustBeOptional(expr, symbol);
75662
75673
  }
75663
- checkDeleteExpressionMustBeOptional(expr, symbol);
75664
75674
  }
75665
75675
  return booleanType;
75666
75676
  }
75667
75677
  function checkDeleteExpressionMustBeOptional(expr, symbol) {
75668
75678
  const type = getTypeOfSymbol(symbol);
75669
- if (strictNullChecks && !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) {
75679
+ if (strictNullChecks && !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : hasTypeFacts(type, 16777216 /* IsUndefined */))) {
75670
75680
  error2(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
75671
75681
  }
75672
75682
  }
@@ -75801,7 +75811,7 @@ ${lanes.join("\n")}
75801
75811
  return getUnaryResultType(operandType);
75802
75812
  case 54 /* ExclamationToken */:
75803
75813
  checkTruthinessOfType(operandType, node.operand);
75804
- const facts = getTypeFacts(operandType) & (4194304 /* Truthy */ | 8388608 /* Falsy */);
75814
+ const facts = getTypeFacts(operandType, 4194304 /* Truthy */ | 8388608 /* Falsy */);
75805
75815
  return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType;
75806
75816
  case 46 /* PlusPlusToken */:
75807
75817
  case 47 /* MinusMinusToken */:
@@ -76032,7 +76042,7 @@ ${lanes.join("\n")}
76032
76042
  if (exprOrAssignment.kind === 304 /* ShorthandPropertyAssignment */) {
76033
76043
  const prop = exprOrAssignment;
76034
76044
  if (prop.objectAssignmentInitializer) {
76035
- if (strictNullChecks && !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
76045
+ if (strictNullChecks && !hasTypeFacts(checkExpression(prop.objectAssignmentInitializer), 16777216 /* IsUndefined */)) {
76036
76046
  sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
76037
76047
  }
76038
76048
  checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -76444,7 +76454,7 @@ ${lanes.join("\n")}
76444
76454
  return checkInExpression(left, right, leftType, rightType);
76445
76455
  case 56 /* AmpersandAmpersandToken */:
76446
76456
  case 77 /* AmpersandAmpersandEqualsToken */: {
76447
- const resultType2 = getTypeFacts(leftType) & 4194304 /* Truthy */ ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType;
76457
+ const resultType2 = hasTypeFacts(leftType, 4194304 /* Truthy */) ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType;
76448
76458
  if (operator === 77 /* AmpersandAmpersandEqualsToken */) {
76449
76459
  checkAssignmentOperator(rightType);
76450
76460
  }
@@ -76452,7 +76462,7 @@ ${lanes.join("\n")}
76452
76462
  }
76453
76463
  case 57 /* BarBarToken */:
76454
76464
  case 76 /* BarBarEqualsToken */: {
76455
- const resultType2 = getTypeFacts(leftType) & 8388608 /* Falsy */ ? getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) : leftType;
76465
+ const resultType2 = hasTypeFacts(leftType, 8388608 /* Falsy */) ? getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) : leftType;
76456
76466
  if (operator === 76 /* BarBarEqualsToken */) {
76457
76467
  checkAssignmentOperator(rightType);
76458
76468
  }
@@ -76460,7 +76470,7 @@ ${lanes.join("\n")}
76460
76470
  }
76461
76471
  case 61 /* QuestionQuestionToken */:
76462
76472
  case 78 /* QuestionQuestionEqualsToken */: {
76463
- const resultType2 = getTypeFacts(leftType) & 262144 /* EQUndefinedOrNull */ ? getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) : leftType;
76473
+ const resultType2 = hasTypeFacts(leftType, 262144 /* EQUndefinedOrNull */) ? getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) : leftType;
76464
76474
  if (operator === 78 /* QuestionQuestionEqualsToken */) {
76465
76475
  checkAssignmentOperator(rightType);
76466
76476
  }
@@ -79777,7 +79787,7 @@ ${lanes.join("\n")}
79777
79787
  }
79778
79788
  const type = location === condExpr2 ? condType : checkTruthinessExpression(location);
79779
79789
  const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
79780
- if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
79790
+ if (!hasTypeFacts(type, 4194304 /* Truthy */) || isPropertyExpressionCast)
79781
79791
  return;
79782
79792
  const callSignatures = getSignaturesOfType(type, 0 /* Call */);
79783
79793
  const isPromise = !!getAwaitedTypeOfPromise(type);
@@ -86016,7 +86026,7 @@ ${lanes.join("\n")}
86016
86026
  return false;
86017
86027
  }
86018
86028
  function checkGrammarNumericLiteral(node) {
86019
- const isFractional = getTextOfNode(node).indexOf(".") !== -1;
86029
+ const isFractional = getTextOfNode(node).includes(".");
86020
86030
  const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
86021
86031
  if (isFractional || isScientific) {
86022
86032
  return;
@@ -109473,7 +109483,7 @@ ${lanes.join("\n")}
109473
109483
  }
109474
109484
  function hasInternalAnnotation(range, currentSourceFile) {
109475
109485
  const comment = currentSourceFile.text.substring(range.pos, range.end);
109476
- return stringContains(comment, "@internal");
109486
+ return comment.includes("@internal");
109477
109487
  }
109478
109488
  function isInternalDeclaration(node, currentSourceFile) {
109479
109489
  const parseTreeNode = getParseTreeNode(node);
@@ -113930,7 +113940,7 @@ ${lanes.join("\n")}
113930
113940
  /*jsxAttributeEscape*/
113931
113941
  false
113932
113942
  );
113933
- return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !stringContains(text, tokenToString(25 /* DotToken */)) && !stringContains(text, String.fromCharCode(69 /* E */)) && !stringContains(text, String.fromCharCode(101 /* e */));
113943
+ return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
113934
113944
  } else if (isAccessExpression(expression)) {
113935
113945
  const constantValue = getConstantValue(expression);
113936
113946
  return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
@@ -118758,7 +118768,7 @@ ${lanes.join("\n")}
118758
118768
  const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
118759
118769
  if (resultFromDts)
118760
118770
  return resultFromDts;
118761
- if (!host.realpath || !options.preserveSymlinks || !stringContains(file.originalFileName, nodeModulesPathPart))
118771
+ if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
118762
118772
  return void 0;
118763
118773
  const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
118764
118774
  return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
@@ -120016,7 +120026,7 @@ ${lanes.join("\n")}
120016
120026
  const path = toPath3(fileName);
120017
120027
  if (useSourceOfProjectReferenceRedirect) {
120018
120028
  let source = getSourceOfProjectReferenceRedirect(path);
120019
- if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && stringContains(fileName, nodeModulesPathPart)) {
120029
+ if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
120020
120030
  const realPath2 = toPath3(host.realpath(fileName));
120021
120031
  if (realPath2 !== path)
120022
120032
  source = getSourceOfProjectReferenceRedirect(realPath2);
@@ -121376,7 +121386,7 @@ ${lanes.join("\n")}
121376
121386
  var _a;
121377
121387
  if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
121378
121388
  return;
121379
- if (!originalRealpath || !stringContains(directory, nodeModulesPathPart))
121389
+ if (!originalRealpath || !directory.includes(nodeModulesPathPart))
121380
121390
  return;
121381
121391
  const symlinkCache = host.getSymlinkCache();
121382
121392
  const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
@@ -121404,7 +121414,7 @@ ${lanes.join("\n")}
121404
121414
  if (!symlinkedDirectories)
121405
121415
  return false;
121406
121416
  const fileOrDirectoryPath = host.toPath(fileOrDirectory);
121407
- if (!stringContains(fileOrDirectoryPath, nodeModulesPathPart))
121417
+ if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
121408
121418
  return false;
121409
121419
  if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
121410
121420
  return true;
@@ -123452,7 +123462,7 @@ ${lanes.join("\n")}
123452
123462
  if (endsWith(path, "/node_modules/.staging")) {
123453
123463
  return removeSuffix(path, "/.staging");
123454
123464
  }
123455
- return some(ignoredPaths, (searchPath) => stringContains(path, searchPath)) ? void 0 : path;
123465
+ return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
123456
123466
  }
123457
123467
  function perceivedOsRootLengthForWatching(pathComponents2, length2) {
123458
123468
  if (length2 <= 1)
@@ -128301,7 +128311,7 @@ ${lanes.join("\n")}
128301
128311
 
128302
128312
  // src/jsTyping/shared.ts
128303
128313
  function hasArgument(argumentName) {
128304
- return sys.args.indexOf(argumentName) >= 0;
128314
+ return sys.args.includes(argumentName);
128305
128315
  }
128306
128316
  function findArgument(argumentName) {
128307
128317
  const index = sys.args.indexOf(argumentName);
@@ -131129,7 +131139,7 @@ ${lanes.join("\n")}
131129
131139
  return false;
131130
131140
  }
131131
131141
  function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) {
131132
- if (!stringContains(importedFileName, "node_modules")) {
131142
+ if (!importedFileName.includes("node_modules")) {
131133
131143
  return void 0;
131134
131144
  }
131135
131145
  const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName(
@@ -131746,7 +131756,7 @@ ${lanes.join("\n")}
131746
131756
  var _a;
131747
131757
  const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName)));
131748
131758
  for (const ambient of checker.getAmbientModules()) {
131749
- if (!stringContains(ambient.name, "*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
131759
+ if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
131750
131760
  cb(
131751
131761
  ambient,
131752
131762
  /*sourceFile*/
@@ -140780,7 +140790,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
140780
140790
  return symbolId;
140781
140791
  }
140782
140792
  function checkForUsedDeclarations(node) {
140783
- if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0) {
140793
+ if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) {
140784
140794
  return;
140785
140795
  }
140786
140796
  const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node);
@@ -142646,7 +142656,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
142646
142656
  return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */;
142647
142657
  }
142648
142658
  function isNodeModulesFile(path) {
142649
- return stringContains(path, "/node_modules/");
142659
+ return path.includes("/node_modules/");
142650
142660
  }
142651
142661
  }
142652
142662
  function getRenameInfo2(fileName, position, preferences) {
@@ -152487,7 +152497,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152487
152497
  }
152488
152498
  }
152489
152499
  function isCallbackLike(checker, sourceFile, name) {
152490
- return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0);
152500
+ return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference));
152491
152501
  }
152492
152502
  function isLastParameter(func, parameter, isFixAll) {
152493
152503
  const parameters = func.parameters;
@@ -160339,7 +160349,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160339
160349
  function addReplacementSpans(text, textStart, names) {
160340
160350
  const span = getDirectoryFragmentTextSpan(text, textStart);
160341
160351
  const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length);
160342
- return names.map(({ name, kind, extension }) => Math.max(name.indexOf(directorySeparator), name.indexOf(altDirectorySeparator)) !== -1 ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
160352
+ return names.map(({ name, kind, extension }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
160343
160353
  }
160344
160354
  function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
160345
160355
  return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences));
@@ -160665,7 +160675,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160665
160675
  }
160666
160676
  if (target && typeof target === "object" && !isArray(target)) {
160667
160677
  for (const condition in target) {
160668
- if (condition === "default" || conditions.indexOf(condition) > -1 || isApplicableVersionedTypesKey(conditions, condition)) {
160678
+ if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) {
160669
160679
  const pattern = target[condition];
160670
160680
  return getPatternFromFirstMatchingCondition(pattern, conditions);
160671
160681
  }
@@ -160677,7 +160687,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160677
160687
  }
160678
160688
  function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
160679
160689
  if (!endsWith(path, "*")) {
160680
- return !stringContains(path, "*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
160690
+ return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
160681
160691
  }
160682
160692
  const pathPrefix = path.slice(0, path.length - 1);
160683
160693
  const remainingFragment = tryRemovePrefix(fragment, pathPrefix);
@@ -160747,7 +160757,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160747
160757
  }
160748
160758
  function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
160749
160759
  const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
160750
- const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.indexOf("*") < 0);
160760
+ const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && !moduleName.includes("*"));
160751
160761
  if (fragmentDirectory !== void 0) {
160752
160762
  const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory);
160753
160763
  return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator));
@@ -160861,7 +160871,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160861
160871
  return false;
160862
160872
  }
160863
160873
  function containsSlash(fragment) {
160864
- return stringContains(fragment, directorySeparator);
160874
+ return fragment.includes(directorySeparator);
160865
160875
  }
160866
160876
  function isRequireCallArgument(node) {
160867
160877
  return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require";
@@ -169754,7 +169764,7 @@ ${options.prefix}` : "\n" : options.prefix
169754
169764
  return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
169755
169765
  }
169756
169766
  function isNotPropertyAccessOnIntegerLiteral(context) {
169757
- return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().indexOf(".") !== -1;
169767
+ return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().includes(".");
169758
169768
  }
169759
169769
  var init_rules = __esm({
169760
169770
  "src/services/formatting/rules.ts"() {
@@ -170950,7 +170960,7 @@ ${options.prefix}` : "\n" : options.prefix
170950
170960
  }
170951
170961
  const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
170952
170962
  if (containerList && !rangeContainsRange(containerList, precedingToken)) {
170953
- const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1;
170963
+ const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind);
170954
170964
  const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
170955
170965
  return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
170956
170966
  }
@@ -172541,7 +172551,7 @@ ${options.prefix}` : "\n" : options.prefix
172541
172551
 
172542
172552
  // src/server/scriptInfo.ts
172543
172553
  function isDynamicFileName(fileName) {
172544
- return fileName[0] === "^" || (stringContains(fileName, "walkThroughSnippet:/") || stringContains(fileName, "untitled:/")) && getBaseFileName(fileName)[0] === "^" || stringContains(fileName, ":^") && !stringContains(fileName, directorySeparator);
172554
+ return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator);
172545
172555
  }
172546
172556
  function ensurePrimaryProjectKind(project) {
172547
172557
  if (!project || project.projectKind === 3 /* AutoImportProvider */ || project.projectKind === 4 /* Auxiliary */) {
@@ -174191,7 +174201,7 @@ ${options.prefix}` : "\n" : options.prefix
174191
174201
  }
174192
174202
  removeExistingTypings(include) {
174193
174203
  const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
174194
- return include.filter((i) => existing.indexOf(i) < 0);
174204
+ return include.filter((i) => !existing.includes(i));
174195
174205
  }
174196
174206
  updateGraphWorker() {
174197
174207
  var _a, _b;
@@ -178388,7 +178398,7 @@ Dynamic files must always be opened with service's current directory or service
178388
178398
  this.logger.info(`Excluding files based on rule ${name} matching file '${root}'`);
178389
178399
  if (rule2.types) {
178390
178400
  for (const type of rule2.types) {
178391
- if (typeAcqInclude.indexOf(type) < 0) {
178401
+ if (!typeAcqInclude.includes(type)) {
178392
178402
  typeAcqInclude.push(type);
178393
178403
  }
178394
178404
  }
@@ -178407,13 +178417,13 @@ Dynamic files must always be opened with service's current directory or service
178407
178417
  return groupNumberOrString;
178408
178418
  }).join("");
178409
178419
  });
178410
- if (excludeRules.indexOf(processedRule) === -1) {
178420
+ if (!excludeRules.includes(processedRule)) {
178411
178421
  excludeRules.push(processedRule);
178412
178422
  }
178413
178423
  }
178414
178424
  } else {
178415
178425
  const escaped = _ProjectService.escapeFilenameForRegex(root);
178416
- if (excludeRules.indexOf(escaped) < 0) {
178426
+ if (!excludeRules.includes(escaped)) {
178417
178427
  excludeRules.push(escaped);
178418
178428
  }
178419
178429
  }
@@ -178437,7 +178447,7 @@ Dynamic files must always be opened with service's current directory or service
178437
178447
  this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`);
178438
178448
  excludedFiles.push(normalizedNames[i]);
178439
178449
  exclude = true;
178440
- if (typeAcqInclude.indexOf(typeName) < 0) {
178450
+ if (!typeAcqInclude.includes(typeName)) {
178441
178451
  typeAcqInclude.push(typeName);
178442
178452
  }
178443
178453
  }
@@ -181977,7 +181987,7 @@ ${e.message}`;
181977
181987
  if (languageServiceDisabled) {
181978
181988
  return;
181979
181989
  }
181980
- const fileNamesInProject = fileNames.filter((value) => !stringContains(value, "lib.d.ts"));
181990
+ const fileNamesInProject = fileNames.filter((value) => !value.includes("lib.d.ts"));
181981
181991
  if (fileNamesInProject.length === 0) {
181982
181992
  return;
181983
181993
  }
@@ -185239,7 +185249,6 @@ ${e.message}`;
185239
185249
  startsWithDirectory: () => startsWithDirectory,
185240
185250
  startsWithUnderscore: () => startsWithUnderscore,
185241
185251
  startsWithUseStrict: () => startsWithUseStrict,
185242
- stringContains: () => stringContains,
185243
185252
  stringContainsAt: () => stringContainsAt,
185244
185253
  stringToToken: () => stringToToken,
185245
185254
  stripQuotes: () => stripQuotes,
@@ -187648,7 +187657,6 @@ ${e.message}`;
187648
187657
  startsWithDirectory: () => startsWithDirectory,
187649
187658
  startsWithUnderscore: () => startsWithUnderscore,
187650
187659
  startsWithUseStrict: () => startsWithUseStrict,
187651
- stringContains: () => stringContains,
187652
187660
  stringContainsAt: () => stringContainsAt,
187653
187661
  stringToToken: () => stringToToken,
187654
187662
  stripQuotes: () => stripQuotes,