@typescript-deploys/pr-build 5.3.0-pr-55452-7 → 5.3.0-pr-55438-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -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-insiders.20230825`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230829`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -973,10 +973,7 @@ function getStringComparer(ignoreCase) {
973
973
  return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
974
974
  }
975
975
  var createUIStringComparer = (() => {
976
- let defaultComparer;
977
- let enUSComparer;
978
- const stringComparerFactory = getStringComparerFactory();
979
- return createStringComparer;
976
+ return createIntlCollatorStringComparer;
980
977
  function compareWithCallback(a, b, comparer) {
981
978
  if (a === b)
982
979
  return 0 /* EqualTo */;
@@ -991,41 +988,6 @@ var createUIStringComparer = (() => {
991
988
  const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
992
989
  return (a, b) => compareWithCallback(a, b, comparer);
993
990
  }
994
- function createLocaleCompareStringComparer(locale) {
995
- if (locale !== void 0)
996
- return createFallbackStringComparer();
997
- return (a, b) => compareWithCallback(a, b, compareStrings);
998
- function compareStrings(a, b) {
999
- return a.localeCompare(b);
1000
- }
1001
- }
1002
- function createFallbackStringComparer() {
1003
- return (a, b) => compareWithCallback(a, b, compareDictionaryOrder);
1004
- function compareDictionaryOrder(a, b) {
1005
- return compareStrings(a.toUpperCase(), b.toUpperCase()) || compareStrings(a, b);
1006
- }
1007
- function compareStrings(a, b) {
1008
- return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */;
1009
- }
1010
- }
1011
- function getStringComparerFactory() {
1012
- if (typeof Intl === "object" && typeof Intl.Collator === "function") {
1013
- return createIntlCollatorStringComparer;
1014
- }
1015
- if (typeof String.prototype.localeCompare === "function" && typeof String.prototype.toLocaleUpperCase === "function" && "a".localeCompare("B") < 0) {
1016
- return createLocaleCompareStringComparer;
1017
- }
1018
- return createFallbackStringComparer;
1019
- }
1020
- function createStringComparer(locale) {
1021
- if (locale === void 0) {
1022
- return defaultComparer || (defaultComparer = stringComparerFactory(locale));
1023
- } else if (locale === "en-US") {
1024
- return enUSComparer || (enUSComparer = stringComparerFactory(locale));
1025
- } else {
1026
- return stringComparerFactory(locale);
1027
- }
1028
- }
1029
991
  })();
1030
992
  var uiComparerCaseSensitive;
1031
993
  var uiLocale;
@@ -1111,9 +1073,6 @@ function endsWith(str, suffix) {
1111
1073
  function removeSuffix(str, suffix) {
1112
1074
  return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
1113
1075
  }
1114
- function stringContains(str, substring) {
1115
- return str.indexOf(substring) !== -1;
1116
- }
1117
1076
  function orderedRemoveItem(array, item) {
1118
1077
  for (let i = 0; i < array.length; i++) {
1119
1078
  if (array[i] === item) {
@@ -1261,12 +1220,6 @@ function cartesianProductWorker(arrays, result, outer, index) {
1261
1220
  }
1262
1221
  }
1263
1222
  }
1264
- function padLeft(s, length2, padString = " ") {
1265
- return length2 <= s.length ? s : padString.repeat(length2 - s.length) + s;
1266
- }
1267
- function padRight(s, length2, padString = " ") {
1268
- return length2 <= s.length ? s : s + padString.repeat(length2 - s.length);
1269
- }
1270
1223
  function takeWhile(array, predicate) {
1271
1224
  if (array) {
1272
1225
  const len = array.length;
@@ -1287,18 +1240,6 @@ function skipWhile(array, predicate) {
1287
1240
  return array.slice(index);
1288
1241
  }
1289
1242
  }
1290
- var trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s));
1291
- var trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl;
1292
- var trimStringStart = !!String.prototype.trimStart ? (s) => s.trimStart() : (s) => s.replace(/^\s+/g, "");
1293
- function trimEndImpl(s) {
1294
- let end = s.length - 1;
1295
- while (end >= 0) {
1296
- if (!isWhiteSpaceLike(s.charCodeAt(end)))
1297
- break;
1298
- end--;
1299
- }
1300
- return s.slice(0, end + 1);
1301
- }
1302
1243
  function isNodeLikeSystem() {
1303
1244
  return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
1304
1245
  }
@@ -2486,18 +2427,18 @@ var hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i;
2486
2427
  var rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;
2487
2428
  function parseRange(text) {
2488
2429
  const alternatives = [];
2489
- for (let range of trimString(text).split(logicalOrRegExp)) {
2430
+ for (let range of text.trim().split(logicalOrRegExp)) {
2490
2431
  if (!range)
2491
2432
  continue;
2492
2433
  const comparators = [];
2493
- range = trimString(range);
2434
+ range = range.trim();
2494
2435
  const match = hyphenRegExp.exec(range);
2495
2436
  if (match) {
2496
2437
  if (!parseHyphen(match[1], match[2], comparators))
2497
2438
  return void 0;
2498
2439
  } else {
2499
2440
  for (const simple of range.split(whitespaceRegExp)) {
2500
- const match2 = rangeRegExp.exec(trimString(simple));
2441
+ const match2 = rangeRegExp.exec(simple.trim());
2501
2442
  if (!match2 || !parseComparator(match2[1], match2[2], comparators))
2502
2443
  return void 0;
2503
2444
  }
@@ -4517,11 +4458,11 @@ function createDirectoryWatcherSupportingRecursive({
4517
4458
  return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
4518
4459
  }
4519
4460
  function isInPath(path, searchPath) {
4520
- if (stringContains(path, searchPath))
4461
+ if (path.includes(searchPath))
4521
4462
  return true;
4522
4463
  if (useCaseSensitiveFileNames2)
4523
4464
  return false;
4524
- return stringContains(toCanonicalFilePath(path), searchPath);
4465
+ return toCanonicalFilePath(path).includes(searchPath);
4525
4466
  }
4526
4467
  }
4527
4468
  function createFileWatcherCallback(callback) {
@@ -5358,7 +5299,7 @@ function pathIsBareSpecifier(path) {
5358
5299
  return !pathIsAbsolute(path) && !pathIsRelative(path);
5359
5300
  }
5360
5301
  function hasExtension(fileName) {
5361
- return stringContains(getBaseFileName(fileName), ".");
5302
+ return getBaseFileName(fileName).includes(".");
5362
5303
  }
5363
5304
  function fileExtensionIs(path, extension) {
5364
5305
  return path.length > extension.length && endsWith(path, extension);
@@ -5503,7 +5444,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
5503
5444
  return root + pathComponents2.slice(1, length2).join(directorySeparator);
5504
5445
  }
5505
5446
  function normalizeSlashes(path) {
5506
- return path.indexOf("\\") !== -1 ? path.replace(backslashRegExp, directorySeparator) : path;
5447
+ return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
5507
5448
  }
5508
5449
  function reducePathComponents(components) {
5509
5450
  if (!some(components))
@@ -8861,7 +8802,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8861
8802
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
8862
8803
  if (shouldEmitInvalidEscapeError) {
8863
8804
  const code = parseInt(text.substring(start2 + 1, pos), 8);
8864
- error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + padLeft(code.toString(16), 2, "0"));
8805
+ error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0"));
8865
8806
  return String.fromCharCode(code);
8866
8807
  }
8867
8808
  return text.substring(start2, pos);
@@ -9664,7 +9605,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9664
9605
  return token;
9665
9606
  }
9666
9607
  function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
9667
- const type = getDirectiveFromComment(trimStringStart(text2), commentDirectiveRegEx);
9608
+ const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
9668
9609
  if (type === void 0) {
9669
9610
  return commentDirectives2;
9670
9611
  }
@@ -9998,20 +9939,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9998
9939
  inJSDocType += inType ? 1 : -1;
9999
9940
  }
10000
9941
  }
10001
- var codePointAt = String.prototype.codePointAt ? (s, i) => s.codePointAt(i) : function codePointAt2(str, i) {
10002
- const size = str.length;
10003
- if (i < 0 || i >= size) {
10004
- return void 0;
10005
- }
10006
- const first2 = str.charCodeAt(i);
10007
- if (first2 >= 55296 && first2 <= 56319 && size > i + 1) {
10008
- const second = str.charCodeAt(i + 1);
10009
- if (second >= 56320 && second <= 57343) {
10010
- return (first2 - 55296) * 1024 + second - 56320 + 65536;
10011
- }
10012
- }
10013
- return first2;
10014
- };
9942
+ function codePointAt(s, i) {
9943
+ return s.codePointAt(i);
9944
+ }
10015
9945
  function charSize(ch) {
10016
9946
  if (ch >= 65536) {
10017
9947
  return 2;
@@ -11523,7 +11453,7 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
11523
11453
  void 0,
11524
11454
  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
11455
  node10Result,
11526
- node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageName)}` : packageName
11456
+ node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
11527
11457
  ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
11528
11458
  /*details*/
11529
11459
  void 0,
@@ -11750,7 +11680,7 @@ function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) {
11750
11680
  }
11751
11681
  let text = sourceText.substring(includeTrivia ? node.pos : skipTrivia(sourceText, node.pos), node.end);
11752
11682
  if (isJSDocTypeExpressionOrChild(node)) {
11753
- text = text.split(/\r\n|\n|\r/).map((line) => trimStringStart(line.replace(/^\s*\*/, ""))).join("\n");
11683
+ text = text.split(/\r\n|\n|\r/).map((line) => line.replace(/^\s*\*/, "").trimStart()).join("\n");
11754
11684
  }
11755
11685
  return text;
11756
11686
  }
@@ -14780,7 +14710,7 @@ function isQuoteOrBacktick(charCode) {
14780
14710
  }
14781
14711
  function isIntrinsicJsxName(name) {
14782
14712
  const ch = name.charCodeAt(0);
14783
- return ch >= 97 /* a */ && ch <= 122 /* z */ || stringContains(name, "-");
14713
+ return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
14784
14714
  }
14785
14715
  var indentStrings = ["", " "];
14786
14716
  function getIndentString(level) {
@@ -14794,7 +14724,7 @@ function getIndentSize() {
14794
14724
  return indentStrings[1].length;
14795
14725
  }
14796
14726
  function isNightly() {
14797
- return stringContains(version, "-dev") || stringContains(version, "-insiders");
14727
+ return version.includes("-dev") || version.includes("-insiders");
14798
14728
  }
14799
14729
  function createTextWriter(newLine) {
14800
14730
  var output;
@@ -14984,7 +14914,7 @@ function getExternalModuleNameFromDeclaration(host, resolver, declaration) {
14984
14914
  return void 0;
14985
14915
  }
14986
14916
  const specifier = getExternalModuleName(declaration);
14987
- if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).indexOf(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory()))) === -1) {
14917
+ if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
14988
14918
  return void 0;
14989
14919
  }
14990
14920
  return getResolvedExternalModuleName(host, file);
@@ -15329,7 +15259,7 @@ function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLin
15329
15259
  }
15330
15260
  function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) {
15331
15261
  const end = Math.min(commentEnd, nextLineStart - 1);
15332
- const currentLineText = trimString(text.substring(pos, end));
15262
+ const currentLineText = text.substring(pos, end).trim();
15333
15263
  if (currentLineText) {
15334
15264
  writer.writeComment(currentLineText);
15335
15265
  if (end !== commentEnd) {
@@ -16792,7 +16722,7 @@ function getSupportedExtensions(options, extraFileExtensions) {
16792
16722
  const flatBuiltins = flatten(builtins);
16793
16723
  const extensions = [
16794
16724
  ...builtins,
16795
- ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.indexOf(x.extension) === -1 ? [x.extension] : void 0)
16725
+ ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
16796
16726
  ];
16797
16727
  return extensions;
16798
16728
  }
@@ -17234,7 +17164,7 @@ function expressionResultIsUnused(node) {
17234
17164
  }
17235
17165
  }
17236
17166
  function containsIgnoredPath(path) {
17237
- return some(ignoredPaths, (p) => stringContains(path, p));
17167
+ return some(ignoredPaths, (p) => path.includes(p));
17238
17168
  }
17239
17169
  function getContainingNodeArray(node) {
17240
17170
  if (!node.parent)
@@ -17484,9 +17414,6 @@ function getPropertyNameFromType(type) {
17484
17414
  }
17485
17415
  return Debug.fail();
17486
17416
  }
17487
- function isNamedTupleMemberName(node) {
17488
- return node.kind === 80 /* Identifier */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */;
17489
- }
17490
17417
 
17491
17418
  // src/compiler/factory/baseNodeFactory.ts
17492
17419
  function createBaseNodeFactory() {
@@ -28660,29 +28587,21 @@ var Parser;
28660
28587
  }
28661
28588
  return type;
28662
28589
  }
28663
- function isTokenColonOrQuestionColon() {
28664
- return token() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
28590
+ function isNextTokenColonOrQuestionColon() {
28591
+ return nextToken() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
28665
28592
  }
28666
28593
  function isTupleElementName() {
28667
28594
  if (token() === 26 /* DotDotDotToken */) {
28668
- nextToken();
28669
- }
28670
- if (token() === 16 /* TemplateHead */) {
28671
- parseTemplateType();
28672
- return isTokenColonOrQuestionColon();
28673
- }
28674
- if (tokenIsIdentifierOrKeyword(token()) || token() === 15 /* NoSubstitutionTemplateLiteral */) {
28675
- nextToken();
28676
- return isTokenColonOrQuestionColon();
28595
+ return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon();
28677
28596
  }
28678
- return false;
28597
+ return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon();
28679
28598
  }
28680
28599
  function parseTupleElementNameOrTupleElementType() {
28681
28600
  if (lookAhead(isTupleElementName)) {
28682
28601
  const pos = getNodePos();
28683
28602
  const hasJSDoc = hasPrecedingJSDocComment();
28684
28603
  const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
28685
- const name = token() === 15 /* NoSubstitutionTemplateLiteral */ ? parseLiteralLikeNode(token()) : token() === 16 /* TemplateHead */ ? parseTemplateType() : parseIdentifierName();
28604
+ const name = parseIdentifierName();
28686
28605
  const questionToken = parseOptionalToken(58 /* QuestionToken */);
28687
28606
  parseExpected(59 /* ColonToken */);
28688
28607
  const type = parseTupleElementType();
@@ -31761,7 +31680,7 @@ var Parser;
31761
31680
  }
31762
31681
  function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) {
31763
31682
  const namespaceFlag = flags & 32 /* Namespace */;
31764
- const name = parseIdentifier();
31683
+ const name = flags & 8 /* NestedNamespace */ ? parseIdentifierName() : parseIdentifier();
31765
31684
  const body = parseOptional(25 /* DotToken */) ? parseModuleOrNamespaceDeclaration(
31766
31685
  getNodePos(),
31767
31686
  /*hasJSDoc*/
@@ -32231,8 +32150,6 @@ var Parser;
32231
32150
  PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
32232
32151
  })(PropertyLikeParse || (PropertyLikeParse = {}));
32233
32152
  function parseJSDocCommentWorker(start = 0, length2) {
32234
- const saveParsingContext = parsingContext;
32235
- parsingContext |= 1 << 25 /* JSDocComment */;
32236
32153
  const content = sourceText;
32237
32154
  const end = length2 === void 0 ? content.length : start + length2;
32238
32155
  length2 = end - start;
@@ -32249,6 +32166,8 @@ var Parser;
32249
32166
  let commentsPos;
32250
32167
  let comments = [];
32251
32168
  const parts = [];
32169
+ const saveParsingContext = parsingContext;
32170
+ parsingContext |= 1 << 25 /* JSDocComment */;
32252
32171
  const result = scanner.scanRange(start + 3, length2 - 5, doJSDocScan);
32253
32172
  parsingContext = saveParsingContext;
32254
32173
  return result;
@@ -32340,7 +32259,7 @@ var Parser;
32340
32259
  nextTokenJSDoc();
32341
32260
  }
32342
32261
  }
32343
- const trimmedComments = trimStringEnd(comments.join(""));
32262
+ const trimmedComments = comments.join("").trimEnd();
32344
32263
  if (parts.length && trimmedComments.length) {
32345
32264
  parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start, commentsPos));
32346
32265
  }
@@ -32356,7 +32275,7 @@ var Parser;
32356
32275
  }
32357
32276
  function removeTrailingWhitespace(comments2) {
32358
32277
  while (comments2.length) {
32359
- const trimmed = trimStringEnd(comments2[comments2.length - 1]);
32278
+ const trimmed = comments2[comments2.length - 1].trimEnd();
32360
32279
  if (trimmed === "") {
32361
32280
  comments2.pop();
32362
32281
  } else if (trimmed.length < comments2[comments2.length - 1].length) {
@@ -32596,7 +32515,7 @@ var Parser;
32596
32515
  }
32597
32516
  }
32598
32517
  removeLeadingNewlines(comments2);
32599
- const trimmedComments = trimStringEnd(comments2.join(""));
32518
+ const trimmedComments = comments2.join("").trimEnd();
32600
32519
  if (parts2.length) {
32601
32520
  if (trimmedComments.length) {
32602
32521
  parts2.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd2 ?? commentsPos2));
@@ -33494,7 +33413,7 @@ var IncrementalParser;
33494
33413
  })(InvalidPosition || (InvalidPosition = {}));
33495
33414
  })(IncrementalParser || (IncrementalParser = {}));
33496
33415
  function isDeclarationFileName(fileName) {
33497
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && stringContains(getBaseFileName(fileName), ".d.");
33416
+ return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
33498
33417
  }
33499
33418
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
33500
33419
  if (!mode) {
@@ -33680,7 +33599,7 @@ function getNamedPragmaArguments(pragma, text) {
33680
33599
  return {};
33681
33600
  if (!pragma.args)
33682
33601
  return {};
33683
- const args = trimString(text).split(/\s+/);
33602
+ const args = text.trim().split(/\s+/);
33684
33603
  const argMap = {};
33685
33604
  for (let i = 0; i < pragma.args.length; i++) {
33686
33605
  const argument = pragma.args[i];
@@ -35202,14 +35121,14 @@ function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
35202
35121
  return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
35203
35122
  }
35204
35123
  function parseCustomTypeOption(opt, value, errors) {
35205
- return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors);
35124
+ return convertJsonOptionOfCustomType(opt, (value ?? "").trim(), errors);
35206
35125
  }
35207
35126
  function parseListTypeOption(opt, value = "", errors) {
35208
- value = trimString(value);
35127
+ value = value.trim();
35209
35128
  if (startsWith(value, "-")) {
35210
35129
  return void 0;
35211
35130
  }
35212
- if (opt.type === "listOrElement" && !stringContains(value, ",")) {
35131
+ if (opt.type === "listOrElement" && !value.includes(",")) {
35213
35132
  return validateJsonOptionValue(opt, value, errors);
35214
35133
  }
35215
35134
  if (value === "") {
@@ -36233,7 +36152,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
36233
36152
  var _a;
36234
36153
  basePath = normalizeSlashes(basePath);
36235
36154
  const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
36236
- if (resolutionStack.indexOf(resolvedPath) >= 0) {
36155
+ if (resolutionStack.includes(resolvedPath)) {
36237
36156
  errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
36238
36157
  return { raw: json || convertToObject(sourceFile, errors) };
36239
36158
  }
@@ -37967,7 +37886,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
37967
37886
  result = tryResolve(extensions, state);
37968
37887
  }
37969
37888
  let legacyResult;
37970
- 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) {
37889
+ 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")) {
37971
37890
  traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
37972
37891
  const diagnosticState = {
37973
37892
  ...state,
@@ -38011,7 +37930,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
38011
37930
  resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
38012
37931
  }
38013
37932
  if (!resolved2) {
38014
- if (moduleName.indexOf(":") > -1) {
37933
+ if (moduleName.includes(":")) {
38015
37934
  if (traceEnabled) {
38016
37935
  trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
38017
37936
  }
@@ -38101,7 +38020,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
38101
38020
  }
38102
38021
  var nodeModulesPathPart = "/node_modules/";
38103
38022
  function pathContainsNodeModules(path) {
38104
- return stringContains(path, nodeModulesPathPart);
38023
+ return path.includes(nodeModulesPathPart);
38105
38024
  }
38106
38025
  function parseNodeModuleFromPath(resolved, isFolder) {
38107
38026
  const path = normalizePath(resolved);
@@ -38137,7 +38056,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
38137
38056
  }
38138
38057
  function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
38139
38058
  const filename = getBaseFileName(candidate);
38140
- if (filename.indexOf(".") === -1) {
38059
+ if (!filename.includes(".")) {
38141
38060
  return void 0;
38142
38061
  }
38143
38062
  let extensionless = removeFileExtension(candidate);
@@ -38561,7 +38480,7 @@ function comparePatternKeys(a, b) {
38561
38480
  }
38562
38481
  function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
38563
38482
  const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
38564
- if (!endsWith(moduleName, directorySeparator) && moduleName.indexOf("*") === -1 && hasProperty(lookupTable, moduleName)) {
38483
+ if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
38565
38484
  const target = lookupTable[moduleName];
38566
38485
  return loadModuleFromTargetImportOrExport(
38567
38486
  target,
@@ -38572,7 +38491,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
38572
38491
  moduleName
38573
38492
  );
38574
38493
  }
38575
- const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.indexOf("*") !== -1 || endsWith(k, "/")), comparePatternKeys);
38494
+ const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
38576
38495
  for (const potentialTarget of expandingKeys) {
38577
38496
  if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
38578
38497
  const target = lookupTable[potentialTarget];
@@ -38666,7 +38585,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38666
38585
  }
38667
38586
  const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
38668
38587
  const partsAfterFirst = parts.slice(1);
38669
- if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
38588
+ if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
38670
38589
  if (state.traceEnabled) {
38671
38590
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
38672
38591
  }
@@ -38677,7 +38596,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38677
38596
  }
38678
38597
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
38679
38598
  const subpathParts = getPathComponents(subpath);
38680
- if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) {
38599
+ if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
38681
38600
  if (state.traceEnabled) {
38682
38601
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
38683
38602
  }
@@ -38704,7 +38623,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38704
38623
  if (!Array.isArray(target)) {
38705
38624
  traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
38706
38625
  for (const condition of getOwnKeys(target)) {
38707
- if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) {
38626
+ if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
38708
38627
  traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
38709
38628
  const subTarget = target[condition];
38710
38629
  const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
@@ -38765,7 +38684,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38765
38684
  }
38766
38685
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
38767
38686
  var _a, _b, _c, _d;
38768
- 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)) {
38687
+ 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)) {
38769
38688
  const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
38770
38689
  const commonSourceDirGuesses = [];
38771
38690
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
@@ -38839,7 +38758,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
38839
38758
  }
38840
38759
  }
38841
38760
  function isApplicableVersionedTypesKey(conditions, key) {
38842
- if (conditions.indexOf("types") === -1)
38761
+ if (!conditions.includes("types"))
38843
38762
  return false;
38844
38763
  if (!startsWith(key, "types@"))
38845
38764
  return false;
@@ -39044,7 +38963,7 @@ function getPackageNameFromTypesPackageName(mangledName) {
39044
38963
  return mangledName;
39045
38964
  }
39046
38965
  function unmangleScopedPackageName(typesPackageName) {
39047
- return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
38966
+ return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
39048
38967
  }
39049
38968
  function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
39050
38969
  const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
@@ -42674,12 +42593,12 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
42674
42593
  /*currentDirectory*/
42675
42594
  void 0
42676
42595
  );
42677
- const mode2 = endsWith(k, "/") ? 1 /* Directory */ : stringContains(k, "*") ? 2 /* Pattern */ : 0 /* Exact */;
42596
+ const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
42678
42597
  return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
42679
42598
  });
42680
42599
  } else {
42681
42600
  for (const key of getOwnKeys(exports)) {
42682
- if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
42601
+ if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
42683
42602
  const subTarget = exports[key];
42684
42603
  const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
42685
42604
  if (result) {
@@ -42845,7 +42764,7 @@ function processEnding(fileName, allowedEndings, options, host) {
42845
42764
  return fileName;
42846
42765
  } else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
42847
42766
  return noExtension + getJSExtensionForFile(fileName, options);
42848
- } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && stringContains(fileName, ".d.")) {
42767
+ } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
42849
42768
  return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
42850
42769
  }
42851
42770
  switch (allowedEndings[0]) {
@@ -42871,7 +42790,7 @@ function processEnding(fileName, allowedEndings, options, host) {
42871
42790
  }
42872
42791
  function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
42873
42792
  const baseName = getBaseFileName(fileName);
42874
- if (!endsWith(fileName, ".ts" /* Ts */) || !stringContains(baseName, ".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
42793
+ if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
42875
42794
  return void 0;
42876
42795
  const noExtension = removeExtension(fileName, ".ts" /* Ts */);
42877
42796
  const ext = noExtension.substring(noExtension.lastIndexOf("."));
@@ -43590,6 +43509,7 @@ function createTypeChecker(host) {
43590
43509
  var anyType = createIntrinsicType(1 /* Any */, "any");
43591
43510
  var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */);
43592
43511
  var wildcardType = createIntrinsicType(1 /* Any */, "any");
43512
+ var blockedStringType = createIntrinsicType(1 /* Any */, "any");
43593
43513
  var errorType = createIntrinsicType(1 /* Any */, "error");
43594
43514
  var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
43595
43515
  var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */);
@@ -45276,7 +45196,7 @@ function createTypeChecker(host) {
45276
45196
  }
45277
45197
  }
45278
45198
  function isSameScopeDescendentOf(initial, parent, stopAt) {
45279
- return !!parent && !!findAncestor(initial, (n) => n === parent || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) || isAsyncFunction(n)) ? "quit" : false));
45199
+ return !!parent && !!findAncestor(initial, (n) => n === parent || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) || getFunctionFlags(n) & 3 /* AsyncGenerator */) ? "quit" : false));
45280
45200
  }
45281
45201
  function getAnyImportSyntax(node) {
45282
45202
  switch (node.kind) {
@@ -48094,11 +48014,10 @@ function createTypeChecker(host) {
48094
48014
  for (let i = 0; i < tupleConstituentNodes.length; i++) {
48095
48015
  const flags = type2.target.elementFlags[i];
48096
48016
  const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i];
48097
- const label = labeledElementDeclaration && getTupleElementLabel(type2, labeledElementDeclaration);
48098
- if (label) {
48017
+ if (labeledElementDeclaration) {
48099
48018
  tupleConstituentNodes[i] = factory.createNamedTupleMember(
48100
48019
  flags & 12 /* Variable */ ? factory.createToken(26 /* DotDotDotToken */) : void 0,
48101
- factory.createIdentifier(unescapeLeadingUnderscores(label)),
48020
+ factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(labeledElementDeclaration))),
48102
48021
  flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
48103
48022
  flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]
48104
48023
  );
@@ -48933,12 +48852,12 @@ function createTypeChecker(host) {
48933
48852
  if (!specifier) {
48934
48853
  specifier = getSpecifierForModuleSymbol(chain[0], context);
48935
48854
  }
48936
- if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.indexOf("/node_modules/") >= 0) {
48855
+ if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
48937
48856
  const oldSpecifier = specifier;
48938
48857
  if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
48939
48858
  const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
48940
48859
  specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
48941
- if (specifier.indexOf("/node_modules/") >= 0) {
48860
+ if (specifier.includes("/node_modules/")) {
48942
48861
  specifier = oldSpecifier;
48943
48862
  } else {
48944
48863
  assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
@@ -49501,6 +49420,7 @@ function createTypeChecker(host) {
49501
49420
  }
49502
49421
  }
49503
49422
  function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
49423
+ var _a;
49504
49424
  const serializePropertySymbolForClass = makeSerializePropertySymbol(
49505
49425
  factory.createPropertyDeclaration,
49506
49426
  174 /* MethodDeclaration */,
@@ -49522,12 +49442,15 @@ function createTypeChecker(host) {
49522
49442
  ...oldcontext,
49523
49443
  usedSymbolNames: new Set(oldcontext.usedSymbolNames),
49524
49444
  remappedSymbolNames: /* @__PURE__ */ new Map(),
49445
+ remappedSymbolReferences: new Map((_a = oldcontext.remappedSymbolReferences) == null ? void 0 : _a.entries()),
49525
49446
  tracker: void 0
49526
49447
  };
49527
49448
  const tracker = {
49528
49449
  ...oldcontext.tracker.inner,
49529
49450
  trackSymbol: (sym, decl, meaning) => {
49530
- var _a;
49451
+ var _a2, _b;
49452
+ if ((_a2 = context.remappedSymbolNames) == null ? void 0 : _a2.has(getSymbolId(sym)))
49453
+ return false;
49531
49454
  const accessibleResult = isSymbolAccessible(
49532
49455
  sym,
49533
49456
  decl,
@@ -49544,7 +49467,7 @@ function createTypeChecker(host) {
49544
49467
  includePrivateSymbol(root);
49545
49468
  }
49546
49469
  }
49547
- } else if ((_a = oldcontext.tracker.inner) == null ? void 0 : _a.trackSymbol) {
49470
+ } else if ((_b = oldcontext.tracker.inner) == null ? void 0 : _b.trackSymbol) {
49548
49471
  return oldcontext.tracker.inner.trackSymbol(sym, decl, meaning);
49549
49472
  }
49550
49473
  return false;
@@ -49644,7 +49567,7 @@ function createTypeChecker(host) {
49644
49567
  for (const group2 of groups) {
49645
49568
  if (group2.length > 1) {
49646
49569
  statements = [
49647
- ...filter(statements, (s) => group2.indexOf(s) === -1),
49570
+ ...filter(statements, (s) => !group2.includes(s)),
49648
49571
  factory.createExportDeclaration(
49649
49572
  /*modifiers*/
49650
49573
  void 0,
@@ -49753,10 +49676,10 @@ function createTypeChecker(host) {
49753
49676
  context = oldContext;
49754
49677
  }
49755
49678
  }
49756
- function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
49757
- var _a, _b, _c, _d;
49758
- const symbolName2 = unescapeLeadingUnderscores(symbol.escapedName);
49759
- const isDefault = symbol.escapedName === "default" /* Default */;
49679
+ function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) {
49680
+ var _a2, _b, _c, _d, _e, _f;
49681
+ const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName);
49682
+ const isDefault = escapedSymbolName === "default" /* Default */;
49760
49683
  if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) {
49761
49684
  context.encounteredError = true;
49762
49685
  return;
@@ -49767,7 +49690,7 @@ function createTypeChecker(host) {
49767
49690
  isPrivate = true;
49768
49691
  }
49769
49692
  const modifierFlags = (!isPrivate ? 1 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 1024 /* Default */ : 0);
49770
- const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && symbol.escapedName !== "export=" /* ExportEquals */;
49693
+ const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */;
49771
49694
  const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);
49772
49695
  if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {
49773
49696
  serializeAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags);
@@ -49775,7 +49698,7 @@ function createTypeChecker(host) {
49775
49698
  if (symbol.flags & 524288 /* TypeAlias */) {
49776
49699
  serializeTypeAlias(symbol, symbolName2, modifierFlags);
49777
49700
  }
49778
- if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
49701
+ if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && escapedSymbolName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
49779
49702
  if (propertyAsAlias) {
49780
49703
  const createdExport = serializeMaybeAliasAssignment(symbol);
49781
49704
  if (createdExport) {
@@ -49785,17 +49708,24 @@ function createTypeChecker(host) {
49785
49708
  } else {
49786
49709
  const type = getTypeOfSymbol(symbol);
49787
49710
  const localName = getInternalSymbolName(symbol, symbolName2);
49788
- if (!(symbol.flags & 16 /* Function */) && isTypeRepresentableAsFunctionNamespaceMerge(type, symbol)) {
49711
+ if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((_a2 = type.symbol.members) == null ? void 0 : _a2.size) || ((_b = type.symbol.exports) == null ? void 0 : _b.size))) {
49712
+ if (!context.remappedSymbolReferences) {
49713
+ context.remappedSymbolReferences = /* @__PURE__ */ new Map();
49714
+ }
49715
+ context.remappedSymbolReferences.set(getSymbolId(type.symbol), symbol);
49716
+ serializeSymbolWorker(type.symbol, isPrivate, propertyAsAlias, escapedSymbolName);
49717
+ context.remappedSymbolReferences.delete(getSymbolId(type.symbol));
49718
+ } else if (!(symbol.flags & 16 /* Function */) && isTypeRepresentableAsFunctionNamespaceMerge(type, symbol)) {
49789
49719
  serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags);
49790
49720
  } else {
49791
- const flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) && isSourceFile((_b = symbol.parent) == null ? void 0 : _b.valueDeclaration) ? 2 /* Const */ : void 0 : isConstantVariable(symbol) ? 2 /* Const */ : 1 /* Let */;
49721
+ const flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? ((_c = symbol.parent) == null ? void 0 : _c.valueDeclaration) && isSourceFile((_d = symbol.parent) == null ? void 0 : _d.valueDeclaration) ? 2 /* Const */ : void 0 : isConstantVariable(symbol) ? 2 /* Const */ : 1 /* Let */;
49792
49722
  const name = needsPostExportDefault || !(symbol.flags & 4 /* Property */) ? localName : getUnusedName(localName, symbol);
49793
49723
  let textRange = symbol.declarations && find(symbol.declarations, (d) => isVariableDeclaration(d));
49794
49724
  if (textRange && isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
49795
49725
  textRange = textRange.parent.parent;
49796
49726
  }
49797
- const propertyAccessRequire = (_c = symbol.declarations) == null ? void 0 : _c.find(isPropertyAccessExpression);
49798
- if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_d = type.symbol) == null ? void 0 : _d.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) {
49727
+ const propertyAccessRequire = (_e = symbol.declarations) == null ? void 0 : _e.find(isPropertyAccessExpression);
49728
+ if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_f = type.symbol) == null ? void 0 : _f.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) {
49799
49729
  const alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right;
49800
49730
  addResult(
49801
49731
  factory.createExportDeclaration(
@@ -49950,11 +49880,11 @@ function createTypeChecker(host) {
49950
49880
  results.push(node);
49951
49881
  }
49952
49882
  function serializeTypeAlias(symbol, symbolName2, modifierFlags) {
49953
- var _a;
49883
+ var _a2;
49954
49884
  const aliasType = getDeclaredTypeOfTypeAlias(symbol);
49955
49885
  const typeParams = getSymbolLinks(symbol).typeParameters;
49956
49886
  const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context));
49957
- const jsdocAliasDecl = (_a = symbol.declarations) == null ? void 0 : _a.find(isJSDocTypeAlias);
49887
+ const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias);
49958
49888
  const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
49959
49889
  const oldFlags = context.flags;
49960
49890
  context.flags |= 8388608 /* InTypeAlias */;
@@ -50025,12 +49955,12 @@ function createTypeChecker(host) {
50025
49955
  /*isTypeOnly*/
50026
49956
  false,
50027
49957
  factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => {
50028
- var _a, _b;
49958
+ var _a2, _b;
50029
49959
  const name = unescapeLeadingUnderscores(s.escapedName);
50030
49960
  const localName2 = getInternalSymbolName(s, name);
50031
49961
  const aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
50032
49962
  if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some(s.declarations, (d) => getSourceFileOfNode(d) === containingFile))) {
50033
- (_b = (_a = context.tracker) == null ? void 0 : _a.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a, containingFile, symbol, s);
49963
+ (_b = (_a2 = context.tracker) == null ? void 0 : _a2.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a2, containingFile, symbol, s);
50034
49964
  return void 0;
50035
49965
  }
50036
49966
  const target = aliasDecl && getTargetOfAliasDeclaration(
@@ -50196,8 +50126,8 @@ function createTypeChecker(host) {
50196
50126
  return void 0;
50197
50127
  }
50198
50128
  function serializeAsClass(symbol, localName, modifierFlags) {
50199
- var _a, _b;
50200
- const originalDecl = (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
50129
+ var _a2, _b;
50130
+ const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike);
50201
50131
  const oldEnclosing = context.enclosingDeclaration;
50202
50132
  context.enclosingDeclaration = originalDecl || oldEnclosing;
50203
50133
  const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
@@ -50293,7 +50223,7 @@ function createTypeChecker(host) {
50293
50223
  });
50294
50224
  }
50295
50225
  function serializeAsAlias(symbol, localName, modifierFlags) {
50296
- var _a, _b, _c, _d, _e;
50226
+ var _a2, _b, _c, _d, _e;
50297
50227
  const node = getDeclarationOfAliasSymbol(symbol);
50298
50228
  if (!node)
50299
50229
  return Debug.fail();
@@ -50313,7 +50243,7 @@ function createTypeChecker(host) {
50313
50243
  includePrivateSymbol(target);
50314
50244
  switch (node.kind) {
50315
50245
  case 208 /* BindingElement */:
50316
- if (((_b = (_a = node.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
50246
+ if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
50317
50247
  const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
50318
50248
  const { propertyName } = node;
50319
50249
  addResult(
@@ -50532,7 +50462,7 @@ function createTypeChecker(host) {
50532
50462
  );
50533
50463
  }
50534
50464
  function serializeMaybeAliasAssignment(symbol) {
50535
- var _a;
50465
+ var _a2;
50536
50466
  if (symbol.flags & 4194304 /* Prototype */) {
50537
50467
  return false;
50538
50468
  }
@@ -50615,7 +50545,7 @@ function createTypeChecker(host) {
50615
50545
  void 0,
50616
50546
  serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
50617
50547
  )
50618
- ], ((_a = context.enclosingDeclaration) == null ? void 0 : _a.kind) === 267 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
50548
+ ], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
50619
50549
  );
50620
50550
  addResult(
50621
50551
  statement,
@@ -50645,7 +50575,7 @@ function createTypeChecker(host) {
50645
50575
  }
50646
50576
  function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
50647
50577
  return function serializePropertySymbol(p, isStatic2, baseType) {
50648
- var _a, _b, _c, _d, _e;
50578
+ var _a2, _b, _c, _d, _e;
50649
50579
  const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
50650
50580
  const isPrivate = !!(modifierFlags & 8 /* Private */);
50651
50581
  if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
@@ -50656,7 +50586,7 @@ function createTypeChecker(host) {
50656
50586
  }
50657
50587
  const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
50658
50588
  const name = getPropertyNameNodeForSymbol(p, context);
50659
- const firstPropertyLikeDecl = (_a = p.declarations) == null ? void 0 : _a.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
50589
+ const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
50660
50590
  if (p.flags & 98304 /* Accessor */ && useAccessors) {
50661
50591
  const result = [];
50662
50592
  if (p.flags & 65536 /* SetAccessor */) {
@@ -50902,7 +50832,7 @@ function createTypeChecker(host) {
50902
50832
  }
50903
50833
  }
50904
50834
  function getUnusedName(input, symbol) {
50905
- var _a, _b;
50835
+ var _a2, _b;
50906
50836
  const id = symbol ? getSymbolId(symbol) : void 0;
50907
50837
  if (id) {
50908
50838
  if (context.remappedSymbolNames.has(id)) {
@@ -50914,7 +50844,7 @@ function createTypeChecker(host) {
50914
50844
  }
50915
50845
  let i = 0;
50916
50846
  const original = input;
50917
- while ((_a = context.usedSymbolNames) == null ? void 0 : _a.has(input)) {
50847
+ while ((_a2 = context.usedSymbolNames) == null ? void 0 : _a2.has(input)) {
50918
50848
  i++;
50919
50849
  input = `${original}_${i}`;
50920
50850
  }
@@ -51042,6 +50972,10 @@ function createTypeChecker(host) {
51042
50972
  }
51043
50973
  }
51044
50974
  function getNameOfSymbolAsWritten(symbol, context) {
50975
+ var _a;
50976
+ if ((_a = context == null ? void 0 : context.remappedSymbolReferences) == null ? void 0 : _a.has(getSymbolId(symbol))) {
50977
+ symbol = context.remappedSymbolReferences.get(getSymbolId(symbol));
50978
+ }
51045
50979
  if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && // If it's not the first part of an entity name, it must print as `default`
51046
50980
  (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
51047
50981
  !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
@@ -53094,7 +53028,7 @@ function createTypeChecker(host) {
53094
53028
  if (!lateSymbol)
53095
53029
  lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */));
53096
53030
  const earlySymbol = earlySymbols && earlySymbols.get(memberName);
53097
- if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
53031
+ if (!(parent.flags & 32 /* Class */) && (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol)) {
53098
53032
  const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
53099
53033
  const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
53100
53034
  forEach(declarations, (declaration) => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name));
@@ -53205,7 +53139,13 @@ function createTypeChecker(host) {
53205
53139
  const baseTypes = getBaseTypes(source);
53206
53140
  if (baseTypes.length) {
53207
53141
  if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
53208
- members = createSymbolTable(source.declaredProperties);
53142
+ const symbolTable = createSymbolTable();
53143
+ for (const symbol of members.values()) {
53144
+ if (!(symbol.flags & 262144 /* TypeParameter */)) {
53145
+ symbolTable.set(symbol.escapedName, symbol);
53146
+ }
53147
+ }
53148
+ members = symbolTable;
53209
53149
  }
53210
53150
  setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
53211
53151
  const thisArgument = lastOrUndefined(typeArguments);
@@ -53322,7 +53262,7 @@ function createTypeChecker(host) {
53322
53262
  function getUniqAssociatedNamesFromTupleType(type, restName) {
53323
53263
  const associatedNamesMap = /* @__PURE__ */ new Map();
53324
53264
  return map(type.target.labeledElementDeclarations, (labeledElement, i) => {
53325
- const name = getTupleElementLabel(type, labeledElement, i, restName);
53265
+ const name = getTupleElementLabel(labeledElement, i, restName);
53326
53266
  const prevCounter = associatedNamesMap.get(name);
53327
53267
  if (prevCounter === void 0) {
53328
53268
  associatedNamesMap.set(name, 1);
@@ -62604,6 +62544,9 @@ function createTypeChecker(host) {
62604
62544
  function isArrayLikeType(type) {
62605
62545
  return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);
62606
62546
  }
62547
+ function isMutableArrayLikeType(type) {
62548
+ return isMutableArrayOrTuple(type) || !(type.flags & (1 /* Any */ | 98304 /* Nullable */)) && isTypeAssignableTo(type, anyArrayType);
62549
+ }
62607
62550
  function getSingleBaseForNonAugmentingSubtype(type) {
62608
62551
  if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
62609
62552
  return void 0;
@@ -63021,7 +62964,7 @@ function createTypeChecker(host) {
63021
62964
  const param = declaration;
63022
62965
  if (isIdentifier(param.name)) {
63023
62966
  const originalKeywordKind = identifierToKeywordKind(param.name);
63024
- if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
62967
+ if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
63025
62968
  param,
63026
62969
  param.name.escapedText,
63027
62970
  788968 /* Type */,
@@ -63107,7 +63050,12 @@ function createTypeChecker(host) {
63107
63050
  callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
63108
63051
  }
63109
63052
  if (targetRestType) {
63110
- callback(getRestTypeAtPosition(source, paramCount), targetRestType);
63053
+ callback(getRestTypeAtPosition(
63054
+ source,
63055
+ paramCount,
63056
+ /*readonly*/
63057
+ isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType)
63058
+ ), targetRestType);
63111
63059
  }
63112
63060
  }
63113
63061
  function applyToReturnTypes(source, target, callback) {
@@ -64148,7 +64096,7 @@ function createTypeChecker(host) {
64148
64096
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
64149
64097
  if (constraint) {
64150
64098
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
64151
- if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
64099
+ if (!inferredType || inferredType === blockedStringType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
64152
64100
  inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
64153
64101
  }
64154
64102
  }
@@ -68093,7 +68041,7 @@ function createTypeChecker(host) {
68093
68041
  elementTypes,
68094
68042
  elementFlags,
68095
68043
  /*readonly*/
68096
- inConstContext
68044
+ inConstContext && !(contextualType && someType(contextualType, isMutableArrayLikeType))
68097
68045
  ));
68098
68046
  }
68099
68047
  return createArrayLiteralType(createArrayType(
@@ -68409,7 +68357,7 @@ function createTypeChecker(host) {
68409
68357
  return getJsxElementTypeAt(node) || anyType;
68410
68358
  }
68411
68359
  function isHyphenatedJsxName(name) {
68412
- return stringContains(name, "-");
68360
+ return name.includes("-");
68413
68361
  }
68414
68362
  function isJsxIntrinsicTagName(tagName) {
68415
68363
  return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
@@ -69331,7 +69279,7 @@ function createTypeChecker(host) {
69331
69279
  apparentType,
69332
69280
  right.escapedText,
69333
69281
  /*skipObjectFunctionPropertyAugment*/
69334
- false,
69282
+ isConstEnumObjectType(apparentType),
69335
69283
  /*includeTypeOnlyMembers*/
69336
69284
  node.kind === 166 /* QualifiedName */
69337
69285
  );
@@ -70114,7 +70062,7 @@ function createTypeChecker(host) {
70114
70062
  names.push(arg.tupleNameSource);
70115
70063
  }
70116
70064
  }
70117
- return createTupleType(types, flags, inConstContext, length(names) === length(types) ? names : void 0);
70065
+ return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), length(names) === length(types) ? names : void 0);
70118
70066
  }
70119
70067
  function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
70120
70068
  const isJavascript = isInJSFile(signature.declaration);
@@ -72099,18 +72047,11 @@ function createTypeChecker(host) {
72099
72047
  !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration))
72100
72048
  );
72101
72049
  }
72102
- function getTupleElementLabel(tupleType, d, index, restParameterName = "arg") {
72050
+ function getTupleElementLabel(d, index, restParameterName = "arg") {
72103
72051
  if (!d) {
72104
72052
  return `${restParameterName}_${index}`;
72105
72053
  }
72106
- Debug.assert(!isBindingPattern(d.name));
72107
- if (d.name.kind === 203 /* TemplateLiteralType */) {
72108
- const label = instantiateType(getTypeFromTypeNode(d.name), tupleType.mapper);
72109
- return label.flags & 128 /* StringLiteral */ ? escapeLeadingUnderscores(label.value) : typeof index === "number" ? `${restParameterName}_${index}` : void 0;
72110
- }
72111
- if (d.name.kind === 15 /* NoSubstitutionTemplateLiteral */) {
72112
- return escapeLeadingUnderscores(d.name.text);
72113
- }
72054
+ Debug.assert(isIdentifier(d.name));
72114
72055
  return d.name.escapedText;
72115
72056
  }
72116
72057
  function getParameterNameAtPosition(signature, pos, overrideRestType) {
@@ -72123,7 +72064,7 @@ function createTypeChecker(host) {
72123
72064
  if (isTupleType(restType)) {
72124
72065
  const associatedNames = restType.target.labeledElementDeclarations;
72125
72066
  const index = pos - paramCount;
72126
- return getTupleElementLabel(restType, associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
72067
+ return getTupleElementLabel(associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
72127
72068
  }
72128
72069
  return restParameter.escapedName;
72129
72070
  }
@@ -72153,7 +72094,8 @@ function createTypeChecker(host) {
72153
72094
  const index = pos - paramCount;
72154
72095
  const associatedName = associatedNames == null ? void 0 : associatedNames[index];
72155
72096
  const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken);
72156
- if (associatedName && isIdentifier(associatedName.name)) {
72097
+ if (associatedName) {
72098
+ Debug.assert(isIdentifier(associatedName.name));
72157
72099
  return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement };
72158
72100
  }
72159
72101
  return void 0;
@@ -72201,7 +72143,7 @@ function createTypeChecker(host) {
72201
72143
  }
72202
72144
  return void 0;
72203
72145
  }
72204
- function getRestTypeAtPosition(source, pos) {
72146
+ function getRestTypeAtPosition(source, pos, readonly) {
72205
72147
  const parameterCount = getParameterCount(source);
72206
72148
  const minArgumentCount = getMinArgumentCount(source);
72207
72149
  const restType = getEffectiveRestType(source);
@@ -72224,13 +72166,7 @@ function createTypeChecker(host) {
72224
72166
  names.push(name);
72225
72167
  }
72226
72168
  }
72227
- return createTupleType(
72228
- types,
72229
- flags,
72230
- /*readonly*/
72231
- false,
72232
- length(names) === length(types) ? names : void 0
72233
- );
72169
+ return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
72234
72170
  }
72235
72171
  function getParameterCount(signature) {
72236
72172
  const length2 = signature.parameters.length;
@@ -72310,18 +72246,16 @@ function createTypeChecker(host) {
72310
72246
  const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
72311
72247
  for (let i = 0; i < len; i++) {
72312
72248
  const declaration = signature.parameters[i].valueDeclaration;
72313
- if (declaration.type) {
72314
- const typeNode = getEffectiveTypeAnnotationNode(declaration);
72315
- if (typeNode) {
72316
- const source = addOptionality(
72317
- getTypeFromTypeNode(typeNode),
72318
- /*isProperty*/
72319
- false,
72320
- isOptionalDeclaration(declaration)
72321
- );
72322
- const target = getTypeAtPosition(context, i);
72323
- inferTypes(inferenceContext.inferences, source, target);
72324
- }
72249
+ const typeNode = getEffectiveTypeAnnotationNode(declaration);
72250
+ if (typeNode) {
72251
+ const source = addOptionality(
72252
+ getTypeFromTypeNode(typeNode),
72253
+ /*isProperty*/
72254
+ false,
72255
+ isOptionalDeclaration(declaration)
72256
+ );
72257
+ const target = getTypeAtPosition(context, i);
72258
+ inferTypes(inferenceContext.inferences, source, target);
72325
72259
  }
72326
72260
  }
72327
72261
  }
@@ -74753,7 +74687,7 @@ function createTypeChecker(host) {
74753
74687
  return nullWideningType;
74754
74688
  case 15 /* NoSubstitutionTemplateLiteral */:
74755
74689
  case 11 /* StringLiteral */:
74756
- return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
74690
+ return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
74757
74691
  case 9 /* NumericLiteral */: {
74758
74692
  checkGrammarNumericLiteral(node);
74759
74693
  const value = +node.text;
@@ -75102,7 +75036,7 @@ function createTypeChecker(host) {
75102
75036
  const isPrivate = isPrivateIdentifier(name);
75103
75037
  const privateStaticFlags = isPrivate && isStaticMember ? 16 /* PrivateStatic */ : 0;
75104
75038
  const names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames;
75105
- const memberName = name && getPropertyNameForPropertyNameNode(name);
75039
+ const memberName = name && getEffectivePropertyNameForPropertyNameNode(name);
75106
75040
  if (memberName) {
75107
75041
  switch (member.kind) {
75108
75042
  case 177 /* GetAccessor */:
@@ -75149,7 +75083,7 @@ function createTypeChecker(host) {
75149
75083
  const memberNameNode = member.name;
75150
75084
  const isStaticMember = isStatic(member);
75151
75085
  if (isStaticMember && memberNameNode) {
75152
- const memberName = getPropertyNameForPropertyNameNode(memberNameNode);
75086
+ const memberName = getEffectivePropertyNameForPropertyNameNode(memberNameNode);
75153
75087
  switch (memberName) {
75154
75088
  case "name":
75155
75089
  case "length":
@@ -75658,9 +75592,6 @@ function createTypeChecker(host) {
75658
75592
  if (node.type.kind === 191 /* RestType */) {
75659
75593
  grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
75660
75594
  }
75661
- if (node.name.kind === 203 /* TemplateLiteralType */) {
75662
- checkSourceElement(node.name);
75663
- }
75664
75595
  checkSourceElement(node.type);
75665
75596
  getTypeFromTypeNode(node);
75666
75597
  }
@@ -83581,7 +83512,7 @@ function createTypeChecker(host) {
83581
83512
  return false;
83582
83513
  }
83583
83514
  function checkGrammarNumericLiteral(node) {
83584
- const isFractional = getTextOfNode(node).indexOf(".") !== -1;
83515
+ const isFractional = getTextOfNode(node).includes(".");
83585
83516
  const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
83586
83517
  if (isFractional || isScientific) {
83587
83518
  return;
@@ -84472,7 +84403,7 @@ var visitEachChildTable = {
84472
84403
  return context.factory.updateNamedTupleMember(
84473
84404
  node,
84474
84405
  tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken,
84475
- Debug.checkDefined(nodeVisitor(node.name, visitor, isNamedTupleMemberName)),
84406
+ Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)),
84476
84407
  tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken,
84477
84408
  Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode))
84478
84409
  );
@@ -106556,7 +106487,7 @@ function getDeclarationDiagnostics(host, resolver, file) {
106556
106487
  }
106557
106488
  function hasInternalAnnotation(range, currentSourceFile) {
106558
106489
  const comment = currentSourceFile.text.substring(range.pos, range.end);
106559
- return stringContains(comment, "@internal");
106490
+ return comment.includes("@internal");
106560
106491
  }
106561
106492
  function isInternalDeclaration(node, currentSourceFile) {
106562
106493
  const parseTreeNode = getParseTreeNode(node);
@@ -107010,6 +106941,9 @@ function transformDeclarations(context) {
107010
106941
  if (elem.kind === 232 /* OmittedExpression */) {
107011
106942
  return elem;
107012
106943
  }
106944
+ if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
106945
+ checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
106946
+ }
107013
106947
  if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) {
107014
106948
  return factory2.updateBindingElement(
107015
106949
  elem,
@@ -111035,7 +110969,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111035
110969
  /*jsxAttributeEscape*/
111036
110970
  false
111037
110971
  );
111038
- return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !stringContains(text, tokenToString(25 /* DotToken */)) && !stringContains(text, String.fromCharCode(69 /* E */)) && !stringContains(text, String.fromCharCode(101 /* e */));
110972
+ return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
111039
110973
  } else if (isAccessExpression(expression)) {
111040
110974
  const constantValue = getConstantValue(expression);
111041
110975
  return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
@@ -114923,17 +114857,17 @@ function formatCodeSpan(file, start, length2, indent2, squiggleColor, host) {
114923
114857
  for (let i = firstLine; i <= lastLine; i++) {
114924
114858
  context += host.getNewLine();
114925
114859
  if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
114926
- context += indent2 + formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
114860
+ context += indent2 + formatColorAndReset(ellipsis.padStart(gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
114927
114861
  i = lastLine - 1;
114928
114862
  }
114929
114863
  const lineStart = getPositionOfLineAndCharacter(file, i, 0);
114930
114864
  const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
114931
114865
  let lineContent = file.text.slice(lineStart, lineEnd);
114932
- lineContent = trimStringEnd(lineContent);
114866
+ lineContent = lineContent.trimEnd();
114933
114867
  lineContent = lineContent.replace(/\t/g, " ");
114934
- context += indent2 + formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
114868
+ context += indent2 + formatColorAndReset((i + 1 + "").padStart(gutterWidth), gutterStyleSequence) + gutterSeparator;
114935
114869
  context += lineContent + host.getNewLine();
114936
- context += indent2 + formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
114870
+ context += indent2 + formatColorAndReset("".padStart(gutterWidth), gutterStyleSequence) + gutterSeparator;
114937
114871
  context += squiggleColor;
114938
114872
  if (i === firstLine) {
114939
114873
  const lastCharForLine = i === lastLine ? lastLineChar : void 0;
@@ -115868,7 +115802,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115868
115802
  const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
115869
115803
  if (resultFromDts)
115870
115804
  return resultFromDts;
115871
- if (!host.realpath || !options.preserveSymlinks || !stringContains(file.originalFileName, nodeModulesPathPart))
115805
+ if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
115872
115806
  return void 0;
115873
115807
  const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
115874
115808
  return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
@@ -117126,7 +117060,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117126
117060
  const path = toPath3(fileName);
117127
117061
  if (useSourceOfProjectReferenceRedirect) {
117128
117062
  let source = getSourceOfProjectReferenceRedirect(path);
117129
- if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && stringContains(fileName, nodeModulesPathPart)) {
117063
+ if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
117130
117064
  const realPath2 = toPath3(host.realpath(fileName));
117131
117065
  if (realPath2 !== path)
117132
117066
  source = getSourceOfProjectReferenceRedirect(realPath2);
@@ -118486,7 +118420,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
118486
118420
  var _a;
118487
118421
  if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
118488
118422
  return;
118489
- if (!originalRealpath || !stringContains(directory, nodeModulesPathPart))
118423
+ if (!originalRealpath || !directory.includes(nodeModulesPathPart))
118490
118424
  return;
118491
118425
  const symlinkCache = host.getSymlinkCache();
118492
118426
  const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
@@ -118514,7 +118448,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
118514
118448
  if (!symlinkedDirectories)
118515
118449
  return false;
118516
118450
  const fileOrDirectoryPath = host.toPath(fileOrDirectory);
118517
- if (!stringContains(fileOrDirectoryPath, nodeModulesPathPart))
118451
+ if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
118518
118452
  return false;
118519
118453
  if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
118520
118454
  return true;
@@ -120372,7 +120306,7 @@ function removeIgnoredPath(path) {
120372
120306
  if (endsWith(path, "/node_modules/.staging")) {
120373
120307
  return removeSuffix(path, "/.staging");
120374
120308
  }
120375
- return some(ignoredPaths, (searchPath) => stringContains(path, searchPath)) ? void 0 : path;
120309
+ return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
120376
120310
  }
120377
120311
  function perceivedOsRootLengthForWatching(pathComponents2, length2) {
120378
120312
  if (length2 <= 1)
@@ -124788,7 +124722,7 @@ function createColors(sys2) {
124788
124722
  function bold(str) {
124789
124723
  return `\x1B[1m${str}\x1B[22m`;
124790
124724
  }
124791
- const isWindows = sys2.getEnvironmentVariable("OS") && stringContains(sys2.getEnvironmentVariable("OS").toLowerCase(), "windows");
124725
+ const isWindows = sys2.getEnvironmentVariable("OS") && sys2.getEnvironmentVariable("OS").toLowerCase().includes("windows");
124792
124726
  const isWindowsTerminal = sys2.getEnvironmentVariable("WT_SESSION");
124793
124727
  const isVSCode = sys2.getEnvironmentVariable("TERM_PROGRAM") && sys2.getEnvironmentVariable("TERM_PROGRAM") === "vscode";
124794
124728
  function blue(str) {
@@ -124912,11 +124846,11 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
124912
124846
  while (remainRight.length > 0) {
124913
124847
  let curLeft = "";
124914
124848
  if (isFirstLine) {
124915
- curLeft = padLeft(left, rightAlignOfLeft2);
124916
- curLeft = padRight(curLeft, leftAlignOfRight2);
124849
+ curLeft = left.padStart(rightAlignOfLeft2);
124850
+ curLeft = curLeft.padEnd(leftAlignOfRight2);
124917
124851
  curLeft = colorLeft ? colors.blue(curLeft) : curLeft;
124918
124852
  } else {
124919
- curLeft = padLeft("", leftAlignOfRight2);
124853
+ curLeft = "".padStart(leftAlignOfRight2);
124920
124854
  }
124921
124855
  const curRight = remainRight.substr(0, rightCharacterNumber);
124922
124856
  remainRight = remainRight.slice(rightCharacterNumber);
@@ -125122,13 +125056,13 @@ function getHeader(sys2, message) {
125122
125056
  const header = [];
125123
125057
  const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? void 0 : _a.call(sys2)) ?? 0;
125124
125058
  const tsIconLength = 5;
125125
- const tsIconFirstLine = colors.blueBackground(padLeft("", tsIconLength));
125126
- const tsIconSecondLine = colors.blueBackground(colors.brightWhite(padLeft("TS ", tsIconLength)));
125059
+ const tsIconFirstLine = colors.blueBackground("".padStart(tsIconLength));
125060
+ const tsIconSecondLine = colors.blueBackground(colors.brightWhite("TS ".padStart(tsIconLength)));
125127
125061
  if (terminalWidth >= message.length + tsIconLength) {
125128
125062
  const rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
125129
125063
  const leftAlign = rightAlign - tsIconLength;
125130
- header.push(padRight(message, leftAlign) + tsIconFirstLine + sys2.newLine);
125131
- header.push(padLeft("", leftAlign) + tsIconSecondLine + sys2.newLine);
125064
+ header.push(message.padEnd(leftAlign) + tsIconFirstLine + sys2.newLine);
125065
+ header.push("".padStart(leftAlign) + tsIconSecondLine + sys2.newLine);
125132
125066
  } else {
125133
125067
  header.push(message + sys2.newLine);
125134
125068
  header.push(sys2.newLine);
@@ -125805,7 +125739,7 @@ function reportAllStatistics(sys2, statistics) {
125805
125739
  }
125806
125740
  }
125807
125741
  for (const s of statistics) {
125808
- sys2.write(padRight(s.name + ":", nameSize + 2) + padLeft(statisticValue(s).toString(), valueSize) + sys2.newLine);
125742
+ sys2.write(`${s.name}:`.padEnd(nameSize + 2) + statisticValue(s).toString().padStart(valueSize) + sys2.newLine);
125809
125743
  }
125810
125744
  }
125811
125745
  function statisticValue(s) {