@typescript-deploys/pr-build 5.3.0-pr-55371-11 → 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/cancellationToken.js +1 -1
- package/lib/tsc.js +161 -218
- package/lib/tsserver.js +178 -253
- package/lib/typescript.js +180 -249
- package/lib/typingsInstaller.js +37 -104
- package/package.json +2 -2
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-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230829`;
|
|
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--) {
|
|
@@ -1583,12 +1580,6 @@ var ts = (() => {
|
|
|
1583
1580
|
}
|
|
1584
1581
|
}
|
|
1585
1582
|
}
|
|
1586
|
-
function padLeft(s, length2, padString = " ") {
|
|
1587
|
-
return length2 <= s.length ? s : padString.repeat(length2 - s.length) + s;
|
|
1588
|
-
}
|
|
1589
|
-
function padRight(s, length2, padString = " ") {
|
|
1590
|
-
return length2 <= s.length ? s : s + padString.repeat(length2 - s.length);
|
|
1591
|
-
}
|
|
1592
1583
|
function takeWhile(array, predicate) {
|
|
1593
1584
|
if (array) {
|
|
1594
1585
|
const len = array.length;
|
|
@@ -1609,19 +1600,10 @@ var ts = (() => {
|
|
|
1609
1600
|
return array.slice(index);
|
|
1610
1601
|
}
|
|
1611
1602
|
}
|
|
1612
|
-
function trimEndImpl(s) {
|
|
1613
|
-
let end = s.length - 1;
|
|
1614
|
-
while (end >= 0) {
|
|
1615
|
-
if (!isWhiteSpaceLike(s.charCodeAt(end)))
|
|
1616
|
-
break;
|
|
1617
|
-
end--;
|
|
1618
|
-
}
|
|
1619
|
-
return s.slice(0, end + 1);
|
|
1620
|
-
}
|
|
1621
1603
|
function isNodeLikeSystem() {
|
|
1622
1604
|
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
1623
1605
|
}
|
|
1624
|
-
var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale
|
|
1606
|
+
var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale;
|
|
1625
1607
|
var init_core = __esm({
|
|
1626
1608
|
"src/compiler/core.ts"() {
|
|
1627
1609
|
"use strict";
|
|
@@ -1655,10 +1637,7 @@ var ts = (() => {
|
|
|
1655
1637
|
return AssertionLevel2;
|
|
1656
1638
|
})(AssertionLevel || {});
|
|
1657
1639
|
createUIStringComparer = (() => {
|
|
1658
|
-
|
|
1659
|
-
let enUSComparer;
|
|
1660
|
-
const stringComparerFactory = getStringComparerFactory();
|
|
1661
|
-
return createStringComparer;
|
|
1640
|
+
return createIntlCollatorStringComparer;
|
|
1662
1641
|
function compareWithCallback(a, b, comparer) {
|
|
1663
1642
|
if (a === b)
|
|
1664
1643
|
return 0 /* EqualTo */;
|
|
@@ -1673,45 +1652,7 @@ var ts = (() => {
|
|
|
1673
1652
|
const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
|
|
1674
1653
|
return (a, b) => compareWithCallback(a, b, comparer);
|
|
1675
1654
|
}
|
|
1676
|
-
function createLocaleCompareStringComparer(locale) {
|
|
1677
|
-
if (locale !== void 0)
|
|
1678
|
-
return createFallbackStringComparer();
|
|
1679
|
-
return (a, b) => compareWithCallback(a, b, compareStrings);
|
|
1680
|
-
function compareStrings(a, b) {
|
|
1681
|
-
return a.localeCompare(b);
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
function createFallbackStringComparer() {
|
|
1685
|
-
return (a, b) => compareWithCallback(a, b, compareDictionaryOrder);
|
|
1686
|
-
function compareDictionaryOrder(a, b) {
|
|
1687
|
-
return compareStrings(a.toUpperCase(), b.toUpperCase()) || compareStrings(a, b);
|
|
1688
|
-
}
|
|
1689
|
-
function compareStrings(a, b) {
|
|
1690
|
-
return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
function getStringComparerFactory() {
|
|
1694
|
-
if (typeof Intl === "object" && typeof Intl.Collator === "function") {
|
|
1695
|
-
return createIntlCollatorStringComparer;
|
|
1696
|
-
}
|
|
1697
|
-
if (typeof String.prototype.localeCompare === "function" && typeof String.prototype.toLocaleUpperCase === "function" && "a".localeCompare("B") < 0) {
|
|
1698
|
-
return createLocaleCompareStringComparer;
|
|
1699
|
-
}
|
|
1700
|
-
return createFallbackStringComparer;
|
|
1701
|
-
}
|
|
1702
|
-
function createStringComparer(locale) {
|
|
1703
|
-
if (locale === void 0) {
|
|
1704
|
-
return defaultComparer || (defaultComparer = stringComparerFactory(locale));
|
|
1705
|
-
} else if (locale === "en-US") {
|
|
1706
|
-
return enUSComparer || (enUSComparer = stringComparerFactory(locale));
|
|
1707
|
-
} else {
|
|
1708
|
-
return stringComparerFactory(locale);
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
1655
|
})();
|
|
1712
|
-
trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s));
|
|
1713
|
-
trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl;
|
|
1714
|
-
trimStringStart = !!String.prototype.trimStart ? (s) => s.trimStart() : (s) => s.replace(/^\s+/g, "");
|
|
1715
1656
|
}
|
|
1716
1657
|
});
|
|
1717
1658
|
|
|
@@ -2810,18 +2751,18 @@ ${lanes.join("\n")}
|
|
|
2810
2751
|
}
|
|
2811
2752
|
function parseRange(text) {
|
|
2812
2753
|
const alternatives = [];
|
|
2813
|
-
for (let range of
|
|
2754
|
+
for (let range of text.trim().split(logicalOrRegExp)) {
|
|
2814
2755
|
if (!range)
|
|
2815
2756
|
continue;
|
|
2816
2757
|
const comparators = [];
|
|
2817
|
-
range =
|
|
2758
|
+
range = range.trim();
|
|
2818
2759
|
const match = hyphenRegExp.exec(range);
|
|
2819
2760
|
if (match) {
|
|
2820
2761
|
if (!parseHyphen(match[1], match[2], comparators))
|
|
2821
2762
|
return void 0;
|
|
2822
2763
|
} else {
|
|
2823
2764
|
for (const simple of range.split(whitespaceRegExp)) {
|
|
2824
|
-
const match2 = rangeRegExp.exec(
|
|
2765
|
+
const match2 = rangeRegExp.exec(simple.trim());
|
|
2825
2766
|
if (!match2 || !parseComparator(match2[1], match2[2], comparators))
|
|
2826
2767
|
return void 0;
|
|
2827
2768
|
}
|
|
@@ -5765,11 +5706,11 @@ ${lanes.join("\n")}
|
|
|
5765
5706
|
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
5766
5707
|
}
|
|
5767
5708
|
function isInPath(path, searchPath) {
|
|
5768
|
-
if (
|
|
5709
|
+
if (path.includes(searchPath))
|
|
5769
5710
|
return true;
|
|
5770
5711
|
if (useCaseSensitiveFileNames2)
|
|
5771
5712
|
return false;
|
|
5772
|
-
return
|
|
5713
|
+
return toCanonicalFilePath(path).includes(searchPath);
|
|
5773
5714
|
}
|
|
5774
5715
|
}
|
|
5775
5716
|
function createFileWatcherCallback(callback) {
|
|
@@ -6638,7 +6579,7 @@ ${lanes.join("\n")}
|
|
|
6638
6579
|
return !pathIsAbsolute(path) && !pathIsRelative(path);
|
|
6639
6580
|
}
|
|
6640
6581
|
function hasExtension(fileName) {
|
|
6641
|
-
return
|
|
6582
|
+
return getBaseFileName(fileName).includes(".");
|
|
6642
6583
|
}
|
|
6643
6584
|
function fileExtensionIs(path, extension) {
|
|
6644
6585
|
return path.length > extension.length && endsWith(path, extension);
|
|
@@ -6783,7 +6724,7 @@ ${lanes.join("\n")}
|
|
|
6783
6724
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
6784
6725
|
}
|
|
6785
6726
|
function normalizeSlashes(path) {
|
|
6786
|
-
return path.
|
|
6727
|
+
return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
|
|
6787
6728
|
}
|
|
6788
6729
|
function reducePathComponents(components) {
|
|
6789
6730
|
if (!some(components))
|
|
@@ -10025,7 +9966,7 @@ ${lanes.join("\n")}
|
|
|
10025
9966
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10026
9967
|
if (shouldEmitInvalidEscapeError) {
|
|
10027
9968
|
const code = parseInt(text.substring(start2 + 1, pos), 8);
|
|
10028
|
-
error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" +
|
|
9969
|
+
error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0"));
|
|
10029
9970
|
return String.fromCharCode(code);
|
|
10030
9971
|
}
|
|
10031
9972
|
return text.substring(start2, pos);
|
|
@@ -10828,7 +10769,7 @@ ${lanes.join("\n")}
|
|
|
10828
10769
|
return token;
|
|
10829
10770
|
}
|
|
10830
10771
|
function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
|
|
10831
|
-
const type = getDirectiveFromComment(
|
|
10772
|
+
const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
|
|
10832
10773
|
if (type === void 0) {
|
|
10833
10774
|
return commentDirectives2;
|
|
10834
10775
|
}
|
|
@@ -11162,6 +11103,9 @@ ${lanes.join("\n")}
|
|
|
11162
11103
|
inJSDocType += inType ? 1 : -1;
|
|
11163
11104
|
}
|
|
11164
11105
|
}
|
|
11106
|
+
function codePointAt(s, i) {
|
|
11107
|
+
return s.codePointAt(i);
|
|
11108
|
+
}
|
|
11165
11109
|
function charSize(ch) {
|
|
11166
11110
|
if (ch >= 65536) {
|
|
11167
11111
|
return 2;
|
|
@@ -11180,7 +11124,7 @@ ${lanes.join("\n")}
|
|
|
11180
11124
|
function utf16EncodeAsString(codePoint) {
|
|
11181
11125
|
return utf16EncodeAsStringWorker(codePoint);
|
|
11182
11126
|
}
|
|
11183
|
-
var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex,
|
|
11127
|
+
var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
|
|
11184
11128
|
var init_scanner = __esm({
|
|
11185
11129
|
"src/compiler/scanner.ts"() {
|
|
11186
11130
|
"use strict";
|
|
@@ -11346,20 +11290,6 @@ ${lanes.join("\n")}
|
|
|
11346
11290
|
tokenStrings = makeReverseMap(textToToken);
|
|
11347
11291
|
mergeConflictMarkerLength = "<<<<<<<".length;
|
|
11348
11292
|
shebangTriviaRegex = /^#!.*/;
|
|
11349
|
-
codePointAt = String.prototype.codePointAt ? (s, i) => s.codePointAt(i) : function codePointAt2(str, i) {
|
|
11350
|
-
const size = str.length;
|
|
11351
|
-
if (i < 0 || i >= size) {
|
|
11352
|
-
return void 0;
|
|
11353
|
-
}
|
|
11354
|
-
const first2 = str.charCodeAt(i);
|
|
11355
|
-
if (first2 >= 55296 && first2 <= 56319 && size > i + 1) {
|
|
11356
|
-
const second = str.charCodeAt(i + 1);
|
|
11357
|
-
if (second >= 56320 && second <= 57343) {
|
|
11358
|
-
return (first2 - 55296) * 1024 + second - 56320 + 65536;
|
|
11359
|
-
}
|
|
11360
|
-
}
|
|
11361
|
-
return first2;
|
|
11362
|
-
};
|
|
11363
11293
|
utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback;
|
|
11364
11294
|
}
|
|
11365
11295
|
});
|
|
@@ -13032,7 +12962,7 @@ ${lanes.join("\n")}
|
|
|
13032
12962
|
void 0,
|
|
13033
12963
|
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
12964
|
node10Result,
|
|
13035
|
-
node10Result.
|
|
12965
|
+
node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
|
|
13036
12966
|
) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
|
|
13037
12967
|
/*details*/
|
|
13038
12968
|
void 0,
|
|
@@ -13308,7 +13238,7 @@ ${lanes.join("\n")}
|
|
|
13308
13238
|
}
|
|
13309
13239
|
let text = sourceText.substring(includeTrivia ? node.pos : skipTrivia(sourceText, node.pos), node.end);
|
|
13310
13240
|
if (isJSDocTypeExpressionOrChild(node)) {
|
|
13311
|
-
text = text.split(/\r\n|\n|\r/).map((line) =>
|
|
13241
|
+
text = text.split(/\r\n|\n|\r/).map((line) => line.replace(/^\s*\*/, "").trimStart()).join("\n");
|
|
13312
13242
|
}
|
|
13313
13243
|
return text;
|
|
13314
13244
|
}
|
|
@@ -16053,7 +15983,7 @@ ${lanes.join("\n")}
|
|
|
16053
15983
|
}
|
|
16054
15984
|
function isIntrinsicJsxName(name) {
|
|
16055
15985
|
const ch = name.charCodeAt(0);
|
|
16056
|
-
return ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
15986
|
+
return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
|
|
16057
15987
|
}
|
|
16058
15988
|
function getIndentString(level) {
|
|
16059
15989
|
const singleLevel = indentStrings[1];
|
|
@@ -16066,7 +15996,7 @@ ${lanes.join("\n")}
|
|
|
16066
15996
|
return indentStrings[1].length;
|
|
16067
15997
|
}
|
|
16068
15998
|
function isNightly() {
|
|
16069
|
-
return
|
|
15999
|
+
return version.includes("-dev") || version.includes("-insiders");
|
|
16070
16000
|
}
|
|
16071
16001
|
function createTextWriter(newLine) {
|
|
16072
16002
|
var output;
|
|
@@ -16256,7 +16186,7 @@ ${lanes.join("\n")}
|
|
|
16256
16186
|
return void 0;
|
|
16257
16187
|
}
|
|
16258
16188
|
const specifier = getExternalModuleName(declaration);
|
|
16259
|
-
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).
|
|
16189
|
+
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
|
|
16260
16190
|
return void 0;
|
|
16261
16191
|
}
|
|
16262
16192
|
return getResolvedExternalModuleName(host, file);
|
|
@@ -16608,7 +16538,7 @@ ${lanes.join("\n")}
|
|
|
16608
16538
|
}
|
|
16609
16539
|
function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) {
|
|
16610
16540
|
const end = Math.min(commentEnd, nextLineStart - 1);
|
|
16611
|
-
const currentLineText =
|
|
16541
|
+
const currentLineText = text.substring(pos, end).trim();
|
|
16612
16542
|
if (currentLineText) {
|
|
16613
16543
|
writer.writeComment(currentLineText);
|
|
16614
16544
|
if (end !== commentEnd) {
|
|
@@ -18196,7 +18126,7 @@ ${lanes.join("\n")}
|
|
|
18196
18126
|
const flatBuiltins = flatten(builtins);
|
|
18197
18127
|
const extensions = [
|
|
18198
18128
|
...builtins,
|
|
18199
|
-
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.
|
|
18129
|
+
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
|
|
18200
18130
|
];
|
|
18201
18131
|
return extensions;
|
|
18202
18132
|
}
|
|
@@ -18646,7 +18576,7 @@ ${lanes.join("\n")}
|
|
|
18646
18576
|
}
|
|
18647
18577
|
}
|
|
18648
18578
|
function containsIgnoredPath(path) {
|
|
18649
|
-
return some(ignoredPaths, (p) =>
|
|
18579
|
+
return some(ignoredPaths, (p) => path.includes(p));
|
|
18650
18580
|
}
|
|
18651
18581
|
function getContainingNodeArray(node) {
|
|
18652
18582
|
if (!node.parent)
|
|
@@ -28199,7 +28129,7 @@ ${lanes.join("\n")}
|
|
|
28199
28129
|
return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
|
|
28200
28130
|
}
|
|
28201
28131
|
function isDeclarationFileName(fileName) {
|
|
28202
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) &&
|
|
28132
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
|
|
28203
28133
|
}
|
|
28204
28134
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
28205
28135
|
if (!mode) {
|
|
@@ -28382,7 +28312,7 @@ ${lanes.join("\n")}
|
|
|
28382
28312
|
return {};
|
|
28383
28313
|
if (!pragma.args)
|
|
28384
28314
|
return {};
|
|
28385
|
-
const args =
|
|
28315
|
+
const args = text.trim().split(/\s+/);
|
|
28386
28316
|
const argMap = {};
|
|
28387
28317
|
for (let i = 0; i < pragma.args.length; i++) {
|
|
28388
28318
|
const argument = pragma.args[i];
|
|
@@ -34219,7 +34149,7 @@ ${lanes.join("\n")}
|
|
|
34219
34149
|
}
|
|
34220
34150
|
function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) {
|
|
34221
34151
|
const namespaceFlag = flags & 32 /* Namespace */;
|
|
34222
|
-
const name = parseIdentifier();
|
|
34152
|
+
const name = flags & 8 /* NestedNamespace */ ? parseIdentifierName() : parseIdentifier();
|
|
34223
34153
|
const body = parseOptional(25 /* DotToken */) ? parseModuleOrNamespaceDeclaration(
|
|
34224
34154
|
getNodePos(),
|
|
34225
34155
|
/*hasJSDoc*/
|
|
@@ -34689,8 +34619,6 @@ ${lanes.join("\n")}
|
|
|
34689
34619
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
34690
34620
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
34691
34621
|
function parseJSDocCommentWorker(start = 0, length2) {
|
|
34692
|
-
const saveParsingContext = parsingContext;
|
|
34693
|
-
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
34694
34622
|
const content = sourceText;
|
|
34695
34623
|
const end = length2 === void 0 ? content.length : start + length2;
|
|
34696
34624
|
length2 = end - start;
|
|
@@ -34707,6 +34635,8 @@ ${lanes.join("\n")}
|
|
|
34707
34635
|
let commentsPos;
|
|
34708
34636
|
let comments = [];
|
|
34709
34637
|
const parts = [];
|
|
34638
|
+
const saveParsingContext = parsingContext;
|
|
34639
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
34710
34640
|
const result = scanner2.scanRange(start + 3, length2 - 5, doJSDocScan);
|
|
34711
34641
|
parsingContext = saveParsingContext;
|
|
34712
34642
|
return result;
|
|
@@ -34798,7 +34728,7 @@ ${lanes.join("\n")}
|
|
|
34798
34728
|
nextTokenJSDoc();
|
|
34799
34729
|
}
|
|
34800
34730
|
}
|
|
34801
|
-
const trimmedComments =
|
|
34731
|
+
const trimmedComments = comments.join("").trimEnd();
|
|
34802
34732
|
if (parts.length && trimmedComments.length) {
|
|
34803
34733
|
parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start, commentsPos));
|
|
34804
34734
|
}
|
|
@@ -34814,7 +34744,7 @@ ${lanes.join("\n")}
|
|
|
34814
34744
|
}
|
|
34815
34745
|
function removeTrailingWhitespace(comments2) {
|
|
34816
34746
|
while (comments2.length) {
|
|
34817
|
-
const trimmed =
|
|
34747
|
+
const trimmed = comments2[comments2.length - 1].trimEnd();
|
|
34818
34748
|
if (trimmed === "") {
|
|
34819
34749
|
comments2.pop();
|
|
34820
34750
|
} else if (trimmed.length < comments2[comments2.length - 1].length) {
|
|
@@ -35054,7 +34984,7 @@ ${lanes.join("\n")}
|
|
|
35054
34984
|
}
|
|
35055
34985
|
}
|
|
35056
34986
|
removeLeadingNewlines(comments2);
|
|
35057
|
-
const trimmedComments =
|
|
34987
|
+
const trimmedComments = comments2.join("").trimEnd();
|
|
35058
34988
|
if (parts2.length) {
|
|
35059
34989
|
if (trimmedComments.length) {
|
|
35060
34990
|
parts2.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd2 ?? commentsPos2));
|
|
@@ -35980,14 +35910,14 @@ ${lanes.join("\n")}
|
|
|
35980
35910
|
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
35981
35911
|
}
|
|
35982
35912
|
function parseCustomTypeOption(opt, value, errors) {
|
|
35983
|
-
return convertJsonOptionOfCustomType(opt,
|
|
35913
|
+
return convertJsonOptionOfCustomType(opt, (value ?? "").trim(), errors);
|
|
35984
35914
|
}
|
|
35985
35915
|
function parseListTypeOption(opt, value = "", errors) {
|
|
35986
|
-
value =
|
|
35916
|
+
value = value.trim();
|
|
35987
35917
|
if (startsWith(value, "-")) {
|
|
35988
35918
|
return void 0;
|
|
35989
35919
|
}
|
|
35990
|
-
if (opt.type === "listOrElement" && !
|
|
35920
|
+
if (opt.type === "listOrElement" && !value.includes(",")) {
|
|
35991
35921
|
return validateJsonOptionValue(opt, value, errors);
|
|
35992
35922
|
}
|
|
35993
35923
|
if (value === "") {
|
|
@@ -36966,7 +36896,7 @@ ${lanes.join("\n")}
|
|
|
36966
36896
|
var _a;
|
|
36967
36897
|
basePath = normalizeSlashes(basePath);
|
|
36968
36898
|
const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
|
|
36969
|
-
if (resolutionStack.
|
|
36899
|
+
if (resolutionStack.includes(resolvedPath)) {
|
|
36970
36900
|
errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
|
|
36971
36901
|
return { raw: json || convertToObject(sourceFile, errors) };
|
|
36972
36902
|
}
|
|
@@ -40321,7 +40251,7 @@ ${lanes.join("\n")}
|
|
|
40321
40251
|
result = tryResolve(extensions, state);
|
|
40322
40252
|
}
|
|
40323
40253
|
let legacyResult;
|
|
40324
|
-
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.
|
|
40254
|
+
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")) {
|
|
40325
40255
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
40326
40256
|
const diagnosticState = {
|
|
40327
40257
|
...state,
|
|
@@ -40365,7 +40295,7 @@ ${lanes.join("\n")}
|
|
|
40365
40295
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
40366
40296
|
}
|
|
40367
40297
|
if (!resolved2) {
|
|
40368
|
-
if (moduleName.
|
|
40298
|
+
if (moduleName.includes(":")) {
|
|
40369
40299
|
if (traceEnabled) {
|
|
40370
40300
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
40371
40301
|
}
|
|
@@ -40454,7 +40384,7 @@ ${lanes.join("\n")}
|
|
|
40454
40384
|
return void 0;
|
|
40455
40385
|
}
|
|
40456
40386
|
function pathContainsNodeModules(path) {
|
|
40457
|
-
return
|
|
40387
|
+
return path.includes(nodeModulesPathPart);
|
|
40458
40388
|
}
|
|
40459
40389
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
40460
40390
|
const path = normalizePath(resolved);
|
|
@@ -40490,7 +40420,7 @@ ${lanes.join("\n")}
|
|
|
40490
40420
|
}
|
|
40491
40421
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
40492
40422
|
const filename = getBaseFileName(candidate);
|
|
40493
|
-
if (filename.
|
|
40423
|
+
if (!filename.includes(".")) {
|
|
40494
40424
|
return void 0;
|
|
40495
40425
|
}
|
|
40496
40426
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -40647,7 +40577,7 @@ ${lanes.join("\n")}
|
|
|
40647
40577
|
function loadEntrypointsFromTargetExports(target) {
|
|
40648
40578
|
var _a, _b;
|
|
40649
40579
|
if (typeof target === "string" && startsWith(target, "./")) {
|
|
40650
|
-
if (target.
|
|
40580
|
+
if (target.includes("*") && state.host.readDirectory) {
|
|
40651
40581
|
if (target.indexOf("*") !== target.lastIndexOf("*")) {
|
|
40652
40582
|
return false;
|
|
40653
40583
|
}
|
|
@@ -40666,7 +40596,7 @@ ${lanes.join("\n")}
|
|
|
40666
40596
|
});
|
|
40667
40597
|
} else {
|
|
40668
40598
|
const partsAfterFirst = getPathComponents(target).slice(2);
|
|
40669
|
-
if (partsAfterFirst.
|
|
40599
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
40670
40600
|
return false;
|
|
40671
40601
|
}
|
|
40672
40602
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
@@ -41034,7 +40964,7 @@ ${lanes.join("\n")}
|
|
|
41034
40964
|
}
|
|
41035
40965
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
41036
40966
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
41037
|
-
if (!endsWith(moduleName, directorySeparator) && moduleName.
|
|
40967
|
+
if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
|
|
41038
40968
|
const target = lookupTable[moduleName];
|
|
41039
40969
|
return loadModuleFromTargetImportOrExport(
|
|
41040
40970
|
target,
|
|
@@ -41045,7 +40975,7 @@ ${lanes.join("\n")}
|
|
|
41045
40975
|
moduleName
|
|
41046
40976
|
);
|
|
41047
40977
|
}
|
|
41048
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
40978
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
|
|
41049
40979
|
for (const potentialTarget of expandingKeys) {
|
|
41050
40980
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
41051
40981
|
const target = lookupTable[potentialTarget];
|
|
@@ -41139,7 +41069,7 @@ ${lanes.join("\n")}
|
|
|
41139
41069
|
}
|
|
41140
41070
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
41141
41071
|
const partsAfterFirst = parts.slice(1);
|
|
41142
|
-
if (partsAfterFirst.
|
|
41072
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
41143
41073
|
if (state.traceEnabled) {
|
|
41144
41074
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
41145
41075
|
}
|
|
@@ -41150,7 +41080,7 @@ ${lanes.join("\n")}
|
|
|
41150
41080
|
}
|
|
41151
41081
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
41152
41082
|
const subpathParts = getPathComponents(subpath);
|
|
41153
|
-
if (subpathParts.
|
|
41083
|
+
if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
|
|
41154
41084
|
if (state.traceEnabled) {
|
|
41155
41085
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
41156
41086
|
}
|
|
@@ -41177,7 +41107,7 @@ ${lanes.join("\n")}
|
|
|
41177
41107
|
if (!Array.isArray(target)) {
|
|
41178
41108
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
41179
41109
|
for (const condition of getOwnKeys(target)) {
|
|
41180
|
-
if (condition === "default" || state.conditions.
|
|
41110
|
+
if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
41181
41111
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
41182
41112
|
const subTarget = target[condition];
|
|
41183
41113
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -41238,7 +41168,7 @@ ${lanes.join("\n")}
|
|
|
41238
41168
|
}
|
|
41239
41169
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
41240
41170
|
var _a, _b, _c, _d;
|
|
41241
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.
|
|
41171
|
+
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)) {
|
|
41242
41172
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
41243
41173
|
const commonSourceDirGuesses = [];
|
|
41244
41174
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -41312,7 +41242,7 @@ ${lanes.join("\n")}
|
|
|
41312
41242
|
}
|
|
41313
41243
|
}
|
|
41314
41244
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
41315
|
-
if (conditions.
|
|
41245
|
+
if (!conditions.includes("types"))
|
|
41316
41246
|
return false;
|
|
41317
41247
|
if (!startsWith(key, "types@"))
|
|
41318
41248
|
return false;
|
|
@@ -41516,7 +41446,7 @@ ${lanes.join("\n")}
|
|
|
41516
41446
|
return mangledName;
|
|
41517
41447
|
}
|
|
41518
41448
|
function unmangleScopedPackageName(typesPackageName) {
|
|
41519
|
-
return
|
|
41449
|
+
return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
41520
41450
|
}
|
|
41521
41451
|
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
41522
41452
|
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
@@ -45231,12 +45161,12 @@ ${lanes.join("\n")}
|
|
|
45231
45161
|
/*currentDirectory*/
|
|
45232
45162
|
void 0
|
|
45233
45163
|
);
|
|
45234
|
-
const mode2 = endsWith(k, "/") ? 1 /* Directory */ :
|
|
45164
|
+
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
45235
45165
|
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
|
|
45236
45166
|
});
|
|
45237
45167
|
} else {
|
|
45238
45168
|
for (const key of getOwnKeys(exports)) {
|
|
45239
|
-
if (key === "default" || conditions.
|
|
45169
|
+
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
45240
45170
|
const subTarget = exports[key];
|
|
45241
45171
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
45242
45172
|
if (result) {
|
|
@@ -45402,7 +45332,7 @@ ${lanes.join("\n")}
|
|
|
45402
45332
|
return fileName;
|
|
45403
45333
|
} else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
|
|
45404
45334
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
45405
|
-
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) &&
|
|
45335
|
+
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
|
|
45406
45336
|
return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
|
|
45407
45337
|
}
|
|
45408
45338
|
switch (allowedEndings[0]) {
|
|
@@ -45428,7 +45358,7 @@ ${lanes.join("\n")}
|
|
|
45428
45358
|
}
|
|
45429
45359
|
function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
|
|
45430
45360
|
const baseName = getBaseFileName(fileName);
|
|
45431
|
-
if (!endsWith(fileName, ".ts" /* Ts */) || !
|
|
45361
|
+
if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
|
|
45432
45362
|
return void 0;
|
|
45433
45363
|
const noExtension = removeExtension(fileName, ".ts" /* Ts */);
|
|
45434
45364
|
const ext = noExtension.substring(noExtension.lastIndexOf("."));
|
|
@@ -46048,6 +45978,7 @@ ${lanes.join("\n")}
|
|
|
46048
45978
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
46049
45979
|
var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */);
|
|
46050
45980
|
var wildcardType = createIntrinsicType(1 /* Any */, "any");
|
|
45981
|
+
var blockedStringType = createIntrinsicType(1 /* Any */, "any");
|
|
46051
45982
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
46052
45983
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
46053
45984
|
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */);
|
|
@@ -47734,7 +47665,7 @@ ${lanes.join("\n")}
|
|
|
47734
47665
|
}
|
|
47735
47666
|
}
|
|
47736
47667
|
function isSameScopeDescendentOf(initial, parent2, stopAt) {
|
|
47737
|
-
return !!parent2 && !!findAncestor(initial, (n) => n === parent2 || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) ||
|
|
47668
|
+
return !!parent2 && !!findAncestor(initial, (n) => n === parent2 || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) || getFunctionFlags(n) & 3 /* AsyncGenerator */) ? "quit" : false));
|
|
47738
47669
|
}
|
|
47739
47670
|
function getAnyImportSyntax(node) {
|
|
47740
47671
|
switch (node.kind) {
|
|
@@ -51390,12 +51321,12 @@ ${lanes.join("\n")}
|
|
|
51390
51321
|
if (!specifier) {
|
|
51391
51322
|
specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
51392
51323
|
}
|
|
51393
|
-
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.
|
|
51324
|
+
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
|
|
51394
51325
|
const oldSpecifier = specifier;
|
|
51395
51326
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
51396
51327
|
const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
51397
51328
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
51398
|
-
if (specifier.
|
|
51329
|
+
if (specifier.includes("/node_modules/")) {
|
|
51399
51330
|
specifier = oldSpecifier;
|
|
51400
51331
|
} else {
|
|
51401
51332
|
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
@@ -51958,6 +51889,7 @@ ${lanes.join("\n")}
|
|
|
51958
51889
|
}
|
|
51959
51890
|
}
|
|
51960
51891
|
function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
|
|
51892
|
+
var _a;
|
|
51961
51893
|
const serializePropertySymbolForClass = makeSerializePropertySymbol(
|
|
51962
51894
|
factory.createPropertyDeclaration,
|
|
51963
51895
|
174 /* MethodDeclaration */,
|
|
@@ -51979,12 +51911,15 @@ ${lanes.join("\n")}
|
|
|
51979
51911
|
...oldcontext,
|
|
51980
51912
|
usedSymbolNames: new Set(oldcontext.usedSymbolNames),
|
|
51981
51913
|
remappedSymbolNames: /* @__PURE__ */ new Map(),
|
|
51914
|
+
remappedSymbolReferences: new Map((_a = oldcontext.remappedSymbolReferences) == null ? void 0 : _a.entries()),
|
|
51982
51915
|
tracker: void 0
|
|
51983
51916
|
};
|
|
51984
51917
|
const tracker = {
|
|
51985
51918
|
...oldcontext.tracker.inner,
|
|
51986
51919
|
trackSymbol: (sym, decl, meaning) => {
|
|
51987
|
-
var
|
|
51920
|
+
var _a2, _b;
|
|
51921
|
+
if ((_a2 = context.remappedSymbolNames) == null ? void 0 : _a2.has(getSymbolId(sym)))
|
|
51922
|
+
return false;
|
|
51988
51923
|
const accessibleResult = isSymbolAccessible(
|
|
51989
51924
|
sym,
|
|
51990
51925
|
decl,
|
|
@@ -52001,7 +51936,7 @@ ${lanes.join("\n")}
|
|
|
52001
51936
|
includePrivateSymbol(root);
|
|
52002
51937
|
}
|
|
52003
51938
|
}
|
|
52004
|
-
} else if ((
|
|
51939
|
+
} else if ((_b = oldcontext.tracker.inner) == null ? void 0 : _b.trackSymbol) {
|
|
52005
51940
|
return oldcontext.tracker.inner.trackSymbol(sym, decl, meaning);
|
|
52006
51941
|
}
|
|
52007
51942
|
return false;
|
|
@@ -52101,7 +52036,7 @@ ${lanes.join("\n")}
|
|
|
52101
52036
|
for (const group2 of groups) {
|
|
52102
52037
|
if (group2.length > 1) {
|
|
52103
52038
|
statements = [
|
|
52104
|
-
...filter(statements, (s) => group2.
|
|
52039
|
+
...filter(statements, (s) => !group2.includes(s)),
|
|
52105
52040
|
factory.createExportDeclaration(
|
|
52106
52041
|
/*modifiers*/
|
|
52107
52042
|
void 0,
|
|
@@ -52210,10 +52145,10 @@ ${lanes.join("\n")}
|
|
|
52210
52145
|
context = oldContext;
|
|
52211
52146
|
}
|
|
52212
52147
|
}
|
|
52213
|
-
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
|
|
52214
|
-
var
|
|
52215
|
-
const symbolName2 = unescapeLeadingUnderscores(
|
|
52216
|
-
const isDefault =
|
|
52148
|
+
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) {
|
|
52149
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
52150
|
+
const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName);
|
|
52151
|
+
const isDefault = escapedSymbolName === "default" /* Default */;
|
|
52217
52152
|
if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) {
|
|
52218
52153
|
context.encounteredError = true;
|
|
52219
52154
|
return;
|
|
@@ -52224,7 +52159,7 @@ ${lanes.join("\n")}
|
|
|
52224
52159
|
isPrivate = true;
|
|
52225
52160
|
}
|
|
52226
52161
|
const modifierFlags = (!isPrivate ? 1 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 1024 /* Default */ : 0);
|
|
52227
|
-
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) &&
|
|
52162
|
+
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */;
|
|
52228
52163
|
const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);
|
|
52229
52164
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
52230
52165
|
serializeAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags);
|
|
@@ -52232,7 +52167,7 @@ ${lanes.join("\n")}
|
|
|
52232
52167
|
if (symbol.flags & 524288 /* TypeAlias */) {
|
|
52233
52168
|
serializeTypeAlias(symbol, symbolName2, modifierFlags);
|
|
52234
52169
|
}
|
|
52235
|
-
if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) &&
|
|
52170
|
+
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) {
|
|
52236
52171
|
if (propertyAsAlias) {
|
|
52237
52172
|
const createdExport = serializeMaybeAliasAssignment(symbol);
|
|
52238
52173
|
if (createdExport) {
|
|
@@ -52242,17 +52177,24 @@ ${lanes.join("\n")}
|
|
|
52242
52177
|
} else {
|
|
52243
52178
|
const type = getTypeOfSymbol(symbol);
|
|
52244
52179
|
const localName = getInternalSymbolName(symbol, symbolName2);
|
|
52245
|
-
if (
|
|
52180
|
+
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))) {
|
|
52181
|
+
if (!context.remappedSymbolReferences) {
|
|
52182
|
+
context.remappedSymbolReferences = /* @__PURE__ */ new Map();
|
|
52183
|
+
}
|
|
52184
|
+
context.remappedSymbolReferences.set(getSymbolId(type.symbol), symbol);
|
|
52185
|
+
serializeSymbolWorker(type.symbol, isPrivate, propertyAsAlias, escapedSymbolName);
|
|
52186
|
+
context.remappedSymbolReferences.delete(getSymbolId(type.symbol));
|
|
52187
|
+
} else if (!(symbol.flags & 16 /* Function */) && isTypeRepresentableAsFunctionNamespaceMerge(type, symbol)) {
|
|
52246
52188
|
serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags);
|
|
52247
52189
|
} else {
|
|
52248
|
-
const flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? ((
|
|
52190
|
+
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 */;
|
|
52249
52191
|
const name = needsPostExportDefault || !(symbol.flags & 4 /* Property */) ? localName : getUnusedName(localName, symbol);
|
|
52250
52192
|
let textRange = symbol.declarations && find(symbol.declarations, (d) => isVariableDeclaration(d));
|
|
52251
52193
|
if (textRange && isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
|
|
52252
52194
|
textRange = textRange.parent.parent;
|
|
52253
52195
|
}
|
|
52254
|
-
const propertyAccessRequire = (
|
|
52255
|
-
if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((
|
|
52196
|
+
const propertyAccessRequire = (_e = symbol.declarations) == null ? void 0 : _e.find(isPropertyAccessExpression);
|
|
52197
|
+
if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_f = type.symbol) == null ? void 0 : _f.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) {
|
|
52256
52198
|
const alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right;
|
|
52257
52199
|
addResult(
|
|
52258
52200
|
factory.createExportDeclaration(
|
|
@@ -52407,11 +52349,11 @@ ${lanes.join("\n")}
|
|
|
52407
52349
|
results.push(node);
|
|
52408
52350
|
}
|
|
52409
52351
|
function serializeTypeAlias(symbol, symbolName2, modifierFlags) {
|
|
52410
|
-
var
|
|
52352
|
+
var _a2;
|
|
52411
52353
|
const aliasType = getDeclaredTypeOfTypeAlias(symbol);
|
|
52412
52354
|
const typeParams = getSymbolLinks(symbol).typeParameters;
|
|
52413
52355
|
const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
52414
|
-
const jsdocAliasDecl = (
|
|
52356
|
+
const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias);
|
|
52415
52357
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
52416
52358
|
const oldFlags = context.flags;
|
|
52417
52359
|
context.flags |= 8388608 /* InTypeAlias */;
|
|
@@ -52482,12 +52424,12 @@ ${lanes.join("\n")}
|
|
|
52482
52424
|
/*isTypeOnly*/
|
|
52483
52425
|
false,
|
|
52484
52426
|
factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => {
|
|
52485
|
-
var
|
|
52427
|
+
var _a2, _b;
|
|
52486
52428
|
const name = unescapeLeadingUnderscores(s.escapedName);
|
|
52487
52429
|
const localName2 = getInternalSymbolName(s, name);
|
|
52488
52430
|
const aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
|
|
52489
52431
|
if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some(s.declarations, (d) => getSourceFileOfNode(d) === containingFile))) {
|
|
52490
|
-
(_b = (
|
|
52432
|
+
(_b = (_a2 = context.tracker) == null ? void 0 : _a2.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a2, containingFile, symbol, s);
|
|
52491
52433
|
return void 0;
|
|
52492
52434
|
}
|
|
52493
52435
|
const target = aliasDecl && getTargetOfAliasDeclaration(
|
|
@@ -52653,8 +52595,8 @@ ${lanes.join("\n")}
|
|
|
52653
52595
|
return void 0;
|
|
52654
52596
|
}
|
|
52655
52597
|
function serializeAsClass(symbol, localName, modifierFlags) {
|
|
52656
|
-
var
|
|
52657
|
-
const originalDecl = (
|
|
52598
|
+
var _a2, _b;
|
|
52599
|
+
const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike);
|
|
52658
52600
|
const oldEnclosing = context.enclosingDeclaration;
|
|
52659
52601
|
context.enclosingDeclaration = originalDecl || oldEnclosing;
|
|
52660
52602
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
|
|
@@ -52750,7 +52692,7 @@ ${lanes.join("\n")}
|
|
|
52750
52692
|
});
|
|
52751
52693
|
}
|
|
52752
52694
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
52753
|
-
var
|
|
52695
|
+
var _a2, _b, _c, _d, _e;
|
|
52754
52696
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
52755
52697
|
if (!node)
|
|
52756
52698
|
return Debug.fail();
|
|
@@ -52770,7 +52712,7 @@ ${lanes.join("\n")}
|
|
|
52770
52712
|
includePrivateSymbol(target);
|
|
52771
52713
|
switch (node.kind) {
|
|
52772
52714
|
case 208 /* BindingElement */:
|
|
52773
|
-
if (((_b = (
|
|
52715
|
+
if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
|
|
52774
52716
|
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
52775
52717
|
const { propertyName } = node;
|
|
52776
52718
|
addResult(
|
|
@@ -52989,7 +52931,7 @@ ${lanes.join("\n")}
|
|
|
52989
52931
|
);
|
|
52990
52932
|
}
|
|
52991
52933
|
function serializeMaybeAliasAssignment(symbol) {
|
|
52992
|
-
var
|
|
52934
|
+
var _a2;
|
|
52993
52935
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
52994
52936
|
return false;
|
|
52995
52937
|
}
|
|
@@ -53072,7 +53014,7 @@ ${lanes.join("\n")}
|
|
|
53072
53014
|
void 0,
|
|
53073
53015
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
53074
53016
|
)
|
|
53075
|
-
], ((
|
|
53017
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
53076
53018
|
);
|
|
53077
53019
|
addResult(
|
|
53078
53020
|
statement,
|
|
@@ -53102,7 +53044,7 @@ ${lanes.join("\n")}
|
|
|
53102
53044
|
}
|
|
53103
53045
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
53104
53046
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
53105
|
-
var
|
|
53047
|
+
var _a2, _b, _c, _d, _e;
|
|
53106
53048
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
53107
53049
|
const isPrivate = !!(modifierFlags & 8 /* Private */);
|
|
53108
53050
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
@@ -53113,7 +53055,7 @@ ${lanes.join("\n")}
|
|
|
53113
53055
|
}
|
|
53114
53056
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
53115
53057
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
53116
|
-
const firstPropertyLikeDecl = (
|
|
53058
|
+
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
53117
53059
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
53118
53060
|
const result = [];
|
|
53119
53061
|
if (p.flags & 65536 /* SetAccessor */) {
|
|
@@ -53359,7 +53301,7 @@ ${lanes.join("\n")}
|
|
|
53359
53301
|
}
|
|
53360
53302
|
}
|
|
53361
53303
|
function getUnusedName(input, symbol) {
|
|
53362
|
-
var
|
|
53304
|
+
var _a2, _b;
|
|
53363
53305
|
const id = symbol ? getSymbolId(symbol) : void 0;
|
|
53364
53306
|
if (id) {
|
|
53365
53307
|
if (context.remappedSymbolNames.has(id)) {
|
|
@@ -53371,7 +53313,7 @@ ${lanes.join("\n")}
|
|
|
53371
53313
|
}
|
|
53372
53314
|
let i = 0;
|
|
53373
53315
|
const original = input;
|
|
53374
|
-
while ((
|
|
53316
|
+
while ((_a2 = context.usedSymbolNames) == null ? void 0 : _a2.has(input)) {
|
|
53375
53317
|
i++;
|
|
53376
53318
|
input = `${original}_${i}`;
|
|
53377
53319
|
}
|
|
@@ -53499,6 +53441,10 @@ ${lanes.join("\n")}
|
|
|
53499
53441
|
}
|
|
53500
53442
|
}
|
|
53501
53443
|
function getNameOfSymbolAsWritten(symbol, context) {
|
|
53444
|
+
var _a;
|
|
53445
|
+
if ((_a = context == null ? void 0 : context.remappedSymbolReferences) == null ? void 0 : _a.has(getSymbolId(symbol))) {
|
|
53446
|
+
symbol = context.remappedSymbolReferences.get(getSymbolId(symbol));
|
|
53447
|
+
}
|
|
53502
53448
|
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`
|
|
53503
53449
|
(!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
|
|
53504
53450
|
!symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
|
|
@@ -55551,7 +55497,7 @@ ${lanes.join("\n")}
|
|
|
55551
55497
|
if (!lateSymbol)
|
|
55552
55498
|
lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */));
|
|
55553
55499
|
const earlySymbol = earlySymbols && earlySymbols.get(memberName);
|
|
55554
|
-
if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
|
|
55500
|
+
if (!(parent2.flags & 32 /* Class */) && (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol)) {
|
|
55555
55501
|
const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
55556
55502
|
const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
|
|
55557
55503
|
forEach(declarations, (declaration) => error2(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name));
|
|
@@ -55662,7 +55608,13 @@ ${lanes.join("\n")}
|
|
|
55662
55608
|
const baseTypes = getBaseTypes(source);
|
|
55663
55609
|
if (baseTypes.length) {
|
|
55664
55610
|
if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
|
|
55665
|
-
|
|
55611
|
+
const symbolTable = createSymbolTable();
|
|
55612
|
+
for (const symbol of members.values()) {
|
|
55613
|
+
if (!(symbol.flags & 262144 /* TypeParameter */)) {
|
|
55614
|
+
symbolTable.set(symbol.escapedName, symbol);
|
|
55615
|
+
}
|
|
55616
|
+
}
|
|
55617
|
+
members = symbolTable;
|
|
55666
55618
|
}
|
|
55667
55619
|
setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
|
|
55668
55620
|
const thisArgument = lastOrUndefined(typeArguments);
|
|
@@ -63694,9 +63646,6 @@ ${lanes.join("\n")}
|
|
|
63694
63646
|
}
|
|
63695
63647
|
instantiateType(source2, reportUnreliableMapper);
|
|
63696
63648
|
}
|
|
63697
|
-
if (isTemplateLiteralTypeWithSinglePlaceholderAndNoExtraTexts(target2) && isTypeAssignableTo(source2, stringType) && isTypeAssignableTo(target2.types[0], stringType)) {
|
|
63698
|
-
return isRelatedTo(source2, target2.types[0], 3 /* Both */, reportErrors2);
|
|
63699
|
-
}
|
|
63700
63649
|
if (isTypeMatchedByTemplateLiteralType(source2, target2)) {
|
|
63701
63650
|
return -1 /* True */;
|
|
63702
63651
|
}
|
|
@@ -63747,9 +63696,6 @@ ${lanes.join("\n")}
|
|
|
63747
63696
|
}
|
|
63748
63697
|
} else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
|
|
63749
63698
|
if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
|
|
63750
|
-
if (isTemplateLiteralTypeWithSinglePlaceholderAndNoExtraTexts(source2) && isTypeAssignableTo(source2.types[0], stringType) && isTypeAssignableTo(target2, stringType)) {
|
|
63751
|
-
return isRelatedTo(source2.types[0], target2, 3 /* Both */, reportErrors2);
|
|
63752
|
-
}
|
|
63753
63699
|
const constraint = getBaseConstraintOfType(source2);
|
|
63754
63700
|
if (constraint && constraint !== source2 && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) {
|
|
63755
63701
|
return result2;
|
|
@@ -65067,6 +65013,9 @@ ${lanes.join("\n")}
|
|
|
65067
65013
|
function isArrayLikeType(type) {
|
|
65068
65014
|
return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);
|
|
65069
65015
|
}
|
|
65016
|
+
function isMutableArrayLikeType(type) {
|
|
65017
|
+
return isMutableArrayOrTuple(type) || !(type.flags & (1 /* Any */ | 98304 /* Nullable */)) && isTypeAssignableTo(type, anyArrayType);
|
|
65018
|
+
}
|
|
65070
65019
|
function getSingleBaseForNonAugmentingSubtype(type) {
|
|
65071
65020
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
65072
65021
|
return void 0;
|
|
@@ -65484,7 +65433,7 @@ ${lanes.join("\n")}
|
|
|
65484
65433
|
const param = declaration;
|
|
65485
65434
|
if (isIdentifier(param.name)) {
|
|
65486
65435
|
const originalKeywordKind = identifierToKeywordKind(param.name);
|
|
65487
|
-
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.
|
|
65436
|
+
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
|
|
65488
65437
|
param,
|
|
65489
65438
|
param.name.escapedText,
|
|
65490
65439
|
788968 /* Type */,
|
|
@@ -65570,7 +65519,12 @@ ${lanes.join("\n")}
|
|
|
65570
65519
|
callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
|
|
65571
65520
|
}
|
|
65572
65521
|
if (targetRestType) {
|
|
65573
|
-
callback(getRestTypeAtPosition(
|
|
65522
|
+
callback(getRestTypeAtPosition(
|
|
65523
|
+
source,
|
|
65524
|
+
paramCount,
|
|
65525
|
+
/*readonly*/
|
|
65526
|
+
isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType)
|
|
65527
|
+
), targetRestType);
|
|
65574
65528
|
}
|
|
65575
65529
|
}
|
|
65576
65530
|
function applyToReturnTypes(source, target, callback) {
|
|
@@ -65874,13 +65828,6 @@ ${lanes.join("\n")}
|
|
|
65874
65828
|
}
|
|
65875
65829
|
return false;
|
|
65876
65830
|
}
|
|
65877
|
-
function isTemplateLiteralTypeWithSinglePlaceholderAndNoExtraTexts(type) {
|
|
65878
|
-
if (!(type.flags & 134217728 /* TemplateLiteral */)) {
|
|
65879
|
-
return false;
|
|
65880
|
-
}
|
|
65881
|
-
const texts = type.texts;
|
|
65882
|
-
return texts.length === 2 && texts[0] === "" && texts[1] === "";
|
|
65883
|
-
}
|
|
65884
65831
|
function isValidTypeForTemplateLiteralPlaceholder(source, target) {
|
|
65885
65832
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
65886
65833
|
return true;
|
|
@@ -65900,8 +65847,9 @@ ${lanes.join("\n")}
|
|
|
65900
65847
|
false
|
|
65901
65848
|
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
65902
65849
|
}
|
|
65903
|
-
if (
|
|
65904
|
-
|
|
65850
|
+
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
65851
|
+
const texts = source.texts;
|
|
65852
|
+
return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target);
|
|
65905
65853
|
}
|
|
65906
65854
|
return isTypeAssignableTo(source, target);
|
|
65907
65855
|
}
|
|
@@ -66617,7 +66565,7 @@ ${lanes.join("\n")}
|
|
|
66617
66565
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
66618
66566
|
if (constraint) {
|
|
66619
66567
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
66620
|
-
if (!inferredType || inferredType ===
|
|
66568
|
+
if (!inferredType || inferredType === blockedStringType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
66621
66569
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
66622
66570
|
}
|
|
66623
66571
|
}
|
|
@@ -70562,7 +70510,7 @@ ${lanes.join("\n")}
|
|
|
70562
70510
|
elementTypes,
|
|
70563
70511
|
elementFlags,
|
|
70564
70512
|
/*readonly*/
|
|
70565
|
-
inConstContext
|
|
70513
|
+
inConstContext && !(contextualType && someType(contextualType, isMutableArrayLikeType))
|
|
70566
70514
|
));
|
|
70567
70515
|
}
|
|
70568
70516
|
return createArrayLiteralType(createArrayType(
|
|
@@ -70878,7 +70826,7 @@ ${lanes.join("\n")}
|
|
|
70878
70826
|
return getJsxElementTypeAt(node) || anyType;
|
|
70879
70827
|
}
|
|
70880
70828
|
function isHyphenatedJsxName(name) {
|
|
70881
|
-
return
|
|
70829
|
+
return name.includes("-");
|
|
70882
70830
|
}
|
|
70883
70831
|
function isJsxIntrinsicTagName(tagName) {
|
|
70884
70832
|
return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
|
|
@@ -71800,7 +71748,7 @@ ${lanes.join("\n")}
|
|
|
71800
71748
|
apparentType,
|
|
71801
71749
|
right.escapedText,
|
|
71802
71750
|
/*skipObjectFunctionPropertyAugment*/
|
|
71803
|
-
|
|
71751
|
+
isConstEnumObjectType(apparentType),
|
|
71804
71752
|
/*includeTypeOnlyMembers*/
|
|
71805
71753
|
node.kind === 166 /* QualifiedName */
|
|
71806
71754
|
);
|
|
@@ -72583,7 +72531,7 @@ ${lanes.join("\n")}
|
|
|
72583
72531
|
names.push(arg.tupleNameSource);
|
|
72584
72532
|
}
|
|
72585
72533
|
}
|
|
72586
|
-
return createTupleType(types, flags, inConstContext, length(names) === length(types) ? names : void 0);
|
|
72534
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), length(names) === length(types) ? names : void 0);
|
|
72587
72535
|
}
|
|
72588
72536
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
72589
72537
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -74664,7 +74612,7 @@ ${lanes.join("\n")}
|
|
|
74664
74612
|
}
|
|
74665
74613
|
return void 0;
|
|
74666
74614
|
}
|
|
74667
|
-
function getRestTypeAtPosition(source, pos) {
|
|
74615
|
+
function getRestTypeAtPosition(source, pos, readonly) {
|
|
74668
74616
|
const parameterCount = getParameterCount(source);
|
|
74669
74617
|
const minArgumentCount = getMinArgumentCount(source);
|
|
74670
74618
|
const restType = getEffectiveRestType(source);
|
|
@@ -74687,13 +74635,7 @@ ${lanes.join("\n")}
|
|
|
74687
74635
|
names.push(name);
|
|
74688
74636
|
}
|
|
74689
74637
|
}
|
|
74690
|
-
return createTupleType(
|
|
74691
|
-
types,
|
|
74692
|
-
flags,
|
|
74693
|
-
/*readonly*/
|
|
74694
|
-
false,
|
|
74695
|
-
length(names) === length(types) ? names : void 0
|
|
74696
|
-
);
|
|
74638
|
+
return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
|
|
74697
74639
|
}
|
|
74698
74640
|
function getParameterCount(signature) {
|
|
74699
74641
|
const length2 = signature.parameters.length;
|
|
@@ -74773,18 +74715,16 @@ ${lanes.join("\n")}
|
|
|
74773
74715
|
const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
74774
74716
|
for (let i = 0; i < len; i++) {
|
|
74775
74717
|
const declaration = signature.parameters[i].valueDeclaration;
|
|
74776
|
-
|
|
74777
|
-
|
|
74778
|
-
|
|
74779
|
-
|
|
74780
|
-
|
|
74781
|
-
|
|
74782
|
-
|
|
74783
|
-
|
|
74784
|
-
|
|
74785
|
-
|
|
74786
|
-
inferTypes(inferenceContext.inferences, source, target);
|
|
74787
|
-
}
|
|
74718
|
+
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
74719
|
+
if (typeNode) {
|
|
74720
|
+
const source = addOptionality(
|
|
74721
|
+
getTypeFromTypeNode(typeNode),
|
|
74722
|
+
/*isProperty*/
|
|
74723
|
+
false,
|
|
74724
|
+
isOptionalDeclaration(declaration)
|
|
74725
|
+
);
|
|
74726
|
+
const target = getTypeAtPosition(context, i);
|
|
74727
|
+
inferTypes(inferenceContext.inferences, source, target);
|
|
74788
74728
|
}
|
|
74789
74729
|
}
|
|
74790
74730
|
}
|
|
@@ -77216,7 +77156,7 @@ ${lanes.join("\n")}
|
|
|
77216
77156
|
return nullWideningType;
|
|
77217
77157
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
77218
77158
|
case 11 /* StringLiteral */:
|
|
77219
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
77159
|
+
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
77220
77160
|
case 9 /* NumericLiteral */: {
|
|
77221
77161
|
checkGrammarNumericLiteral(node);
|
|
77222
77162
|
const value = +node.text;
|
|
@@ -77565,7 +77505,7 @@ ${lanes.join("\n")}
|
|
|
77565
77505
|
const isPrivate = isPrivateIdentifier(name);
|
|
77566
77506
|
const privateStaticFlags = isPrivate && isStaticMember ? 16 /* PrivateStatic */ : 0;
|
|
77567
77507
|
const names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames;
|
|
77568
|
-
const memberName = name &&
|
|
77508
|
+
const memberName = name && getEffectivePropertyNameForPropertyNameNode(name);
|
|
77569
77509
|
if (memberName) {
|
|
77570
77510
|
switch (member.kind) {
|
|
77571
77511
|
case 177 /* GetAccessor */:
|
|
@@ -77612,7 +77552,7 @@ ${lanes.join("\n")}
|
|
|
77612
77552
|
const memberNameNode = member.name;
|
|
77613
77553
|
const isStaticMember = isStatic(member);
|
|
77614
77554
|
if (isStaticMember && memberNameNode) {
|
|
77615
|
-
const memberName =
|
|
77555
|
+
const memberName = getEffectivePropertyNameForPropertyNameNode(memberNameNode);
|
|
77616
77556
|
switch (memberName) {
|
|
77617
77557
|
case "name":
|
|
77618
77558
|
case "length":
|
|
@@ -86041,7 +85981,7 @@ ${lanes.join("\n")}
|
|
|
86041
85981
|
return false;
|
|
86042
85982
|
}
|
|
86043
85983
|
function checkGrammarNumericLiteral(node) {
|
|
86044
|
-
const isFractional = getTextOfNode(node).
|
|
85984
|
+
const isFractional = getTextOfNode(node).includes(".");
|
|
86045
85985
|
const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
|
|
86046
85986
|
if (isFractional || isScientific) {
|
|
86047
85987
|
return;
|
|
@@ -88101,7 +88041,7 @@ ${lanes.join("\n")}
|
|
|
88101
88041
|
const line = lineInfo.getLineText(index);
|
|
88102
88042
|
const comment = sourceMapCommentRegExp.exec(line);
|
|
88103
88043
|
if (comment) {
|
|
88104
|
-
return
|
|
88044
|
+
return comment[1].trimEnd();
|
|
88105
88045
|
} else if (!line.match(whitespaceOrMapCommentRegExp)) {
|
|
88106
88046
|
break;
|
|
88107
88047
|
}
|
|
@@ -109498,7 +109438,7 @@ ${lanes.join("\n")}
|
|
|
109498
109438
|
}
|
|
109499
109439
|
function hasInternalAnnotation(range, currentSourceFile) {
|
|
109500
109440
|
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
109501
|
-
return
|
|
109441
|
+
return comment.includes("@internal");
|
|
109502
109442
|
}
|
|
109503
109443
|
function isInternalDeclaration(node, currentSourceFile) {
|
|
109504
109444
|
const parseTreeNode = getParseTreeNode(node);
|
|
@@ -109951,6 +109891,9 @@ ${lanes.join("\n")}
|
|
|
109951
109891
|
if (elem.kind === 232 /* OmittedExpression */) {
|
|
109952
109892
|
return elem;
|
|
109953
109893
|
}
|
|
109894
|
+
if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
|
|
109895
|
+
checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
|
|
109896
|
+
}
|
|
109954
109897
|
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
|
109955
109898
|
return factory2.updateBindingElement(
|
|
109956
109899
|
elem,
|
|
@@ -113955,7 +113898,7 @@ ${lanes.join("\n")}
|
|
|
113955
113898
|
/*jsxAttributeEscape*/
|
|
113956
113899
|
false
|
|
113957
113900
|
);
|
|
113958
|
-
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !
|
|
113901
|
+
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
|
|
113959
113902
|
} else if (isAccessExpression(expression)) {
|
|
113960
113903
|
const constantValue = getConstantValue(expression);
|
|
113961
113904
|
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
@@ -117944,17 +117887,17 @@ ${lanes.join("\n")}
|
|
|
117944
117887
|
for (let i = firstLine; i <= lastLine; i++) {
|
|
117945
117888
|
context += host.getNewLine();
|
|
117946
117889
|
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
|
|
117947
|
-
context += indent3 + formatColorAndReset(
|
|
117890
|
+
context += indent3 + formatColorAndReset(ellipsis.padStart(gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
|
|
117948
117891
|
i = lastLine - 1;
|
|
117949
117892
|
}
|
|
117950
117893
|
const lineStart = getPositionOfLineAndCharacter(file, i, 0);
|
|
117951
117894
|
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
117952
117895
|
let lineContent = file.text.slice(lineStart, lineEnd);
|
|
117953
|
-
lineContent =
|
|
117896
|
+
lineContent = lineContent.trimEnd();
|
|
117954
117897
|
lineContent = lineContent.replace(/\t/g, " ");
|
|
117955
|
-
context += indent3 + formatColorAndReset(
|
|
117898
|
+
context += indent3 + formatColorAndReset((i + 1 + "").padStart(gutterWidth), gutterStyleSequence) + gutterSeparator;
|
|
117956
117899
|
context += lineContent + host.getNewLine();
|
|
117957
|
-
context += indent3 + formatColorAndReset(
|
|
117900
|
+
context += indent3 + formatColorAndReset("".padStart(gutterWidth), gutterStyleSequence) + gutterSeparator;
|
|
117958
117901
|
context += squiggleColor;
|
|
117959
117902
|
if (i === firstLine) {
|
|
117960
117903
|
const lastCharForLine = i === lastLine ? lastLineChar : void 0;
|
|
@@ -118783,7 +118726,7 @@ ${lanes.join("\n")}
|
|
|
118783
118726
|
const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
118784
118727
|
if (resultFromDts)
|
|
118785
118728
|
return resultFromDts;
|
|
118786
|
-
if (!host.realpath || !options.preserveSymlinks || !
|
|
118729
|
+
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
|
|
118787
118730
|
return void 0;
|
|
118788
118731
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
|
118789
118732
|
return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
|
|
@@ -120041,7 +119984,7 @@ ${lanes.join("\n")}
|
|
|
120041
119984
|
const path = toPath3(fileName);
|
|
120042
119985
|
if (useSourceOfProjectReferenceRedirect) {
|
|
120043
119986
|
let source = getSourceOfProjectReferenceRedirect(path);
|
|
120044
|
-
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) &&
|
|
119987
|
+
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
|
120045
119988
|
const realPath2 = toPath3(host.realpath(fileName));
|
|
120046
119989
|
if (realPath2 !== path)
|
|
120047
119990
|
source = getSourceOfProjectReferenceRedirect(realPath2);
|
|
@@ -121401,7 +121344,7 @@ ${lanes.join("\n")}
|
|
|
121401
121344
|
var _a;
|
|
121402
121345
|
if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
|
|
121403
121346
|
return;
|
|
121404
|
-
if (!originalRealpath || !
|
|
121347
|
+
if (!originalRealpath || !directory.includes(nodeModulesPathPart))
|
|
121405
121348
|
return;
|
|
121406
121349
|
const symlinkCache = host.getSymlinkCache();
|
|
121407
121350
|
const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
|
|
@@ -121429,7 +121372,7 @@ ${lanes.join("\n")}
|
|
|
121429
121372
|
if (!symlinkedDirectories)
|
|
121430
121373
|
return false;
|
|
121431
121374
|
const fileOrDirectoryPath = host.toPath(fileOrDirectory);
|
|
121432
|
-
if (!
|
|
121375
|
+
if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
|
|
121433
121376
|
return false;
|
|
121434
121377
|
if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
|
|
121435
121378
|
return true;
|
|
@@ -123477,7 +123420,7 @@ ${lanes.join("\n")}
|
|
|
123477
123420
|
if (endsWith(path, "/node_modules/.staging")) {
|
|
123478
123421
|
return removeSuffix(path, "/.staging");
|
|
123479
123422
|
}
|
|
123480
|
-
return some(ignoredPaths, (searchPath) =>
|
|
123423
|
+
return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
|
|
123481
123424
|
}
|
|
123482
123425
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
123483
123426
|
if (length2 <= 1)
|
|
@@ -128326,7 +128269,7 @@ ${lanes.join("\n")}
|
|
|
128326
128269
|
|
|
128327
128270
|
// src/jsTyping/shared.ts
|
|
128328
128271
|
function hasArgument(argumentName) {
|
|
128329
|
-
return sys.args.
|
|
128272
|
+
return sys.args.includes(argumentName);
|
|
128330
128273
|
}
|
|
128331
128274
|
function findArgument(argumentName) {
|
|
128332
128275
|
const index = sys.args.indexOf(argumentName);
|
|
@@ -128334,7 +128277,7 @@ ${lanes.join("\n")}
|
|
|
128334
128277
|
}
|
|
128335
128278
|
function nowString() {
|
|
128336
128279
|
const d = /* @__PURE__ */ new Date();
|
|
128337
|
-
return `${
|
|
128280
|
+
return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
|
|
128338
128281
|
}
|
|
128339
128282
|
var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, ActionWatchTypingLocations, Arguments;
|
|
128340
128283
|
var init_shared = __esm({
|
|
@@ -131154,7 +131097,7 @@ ${lanes.join("\n")}
|
|
|
131154
131097
|
return false;
|
|
131155
131098
|
}
|
|
131156
131099
|
function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) {
|
|
131157
|
-
if (!
|
|
131100
|
+
if (!importedFileName.includes("node_modules")) {
|
|
131158
131101
|
return void 0;
|
|
131159
131102
|
}
|
|
131160
131103
|
const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName(
|
|
@@ -131771,7 +131714,7 @@ ${lanes.join("\n")}
|
|
|
131771
131714
|
var _a;
|
|
131772
131715
|
const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName)));
|
|
131773
131716
|
for (const ambient of checker.getAmbientModules()) {
|
|
131774
|
-
if (!
|
|
131717
|
+
if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
|
|
131775
131718
|
cb(
|
|
131776
131719
|
ambient,
|
|
131777
131720
|
/*sourceFile*/
|
|
@@ -140805,7 +140748,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
140805
140748
|
return symbolId;
|
|
140806
140749
|
}
|
|
140807
140750
|
function checkForUsedDeclarations(node) {
|
|
140808
|
-
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.
|
|
140751
|
+
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) {
|
|
140809
140752
|
return;
|
|
140810
140753
|
}
|
|
140811
140754
|
const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node);
|
|
@@ -142671,7 +142614,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142671
142614
|
return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */;
|
|
142672
142615
|
}
|
|
142673
142616
|
function isNodeModulesFile(path) {
|
|
142674
|
-
return
|
|
142617
|
+
return path.includes("/node_modules/");
|
|
142675
142618
|
}
|
|
142676
142619
|
}
|
|
142677
142620
|
function getRenameInfo2(fileName, position, preferences) {
|
|
@@ -152512,7 +152455,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
152512
152455
|
}
|
|
152513
152456
|
}
|
|
152514
152457
|
function isCallbackLike(checker, sourceFile, name) {
|
|
152515
|
-
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.
|
|
152458
|
+
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference));
|
|
152516
152459
|
}
|
|
152517
152460
|
function isLastParameter(func, parameter, isFixAll) {
|
|
152518
152461
|
const parameters = func.parameters;
|
|
@@ -160364,7 +160307,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160364
160307
|
function addReplacementSpans(text, textStart, names) {
|
|
160365
160308
|
const span = getDirectoryFragmentTextSpan(text, textStart);
|
|
160366
160309
|
const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length);
|
|
160367
|
-
return names.map(({ name, kind, extension }) =>
|
|
160310
|
+
return names.map(({ name, kind, extension }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
|
|
160368
160311
|
}
|
|
160369
160312
|
function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
|
|
160370
160313
|
return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences));
|
|
@@ -160690,7 +160633,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160690
160633
|
}
|
|
160691
160634
|
if (target && typeof target === "object" && !isArray(target)) {
|
|
160692
160635
|
for (const condition in target) {
|
|
160693
|
-
if (condition === "default" || conditions.
|
|
160636
|
+
if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) {
|
|
160694
160637
|
const pattern = target[condition];
|
|
160695
160638
|
return getPatternFromFirstMatchingCondition(pattern, conditions);
|
|
160696
160639
|
}
|
|
@@ -160702,7 +160645,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160702
160645
|
}
|
|
160703
160646
|
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
|
|
160704
160647
|
if (!endsWith(path, "*")) {
|
|
160705
|
-
return !
|
|
160648
|
+
return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
|
|
160706
160649
|
}
|
|
160707
160650
|
const pathPrefix = path.slice(0, path.length - 1);
|
|
160708
160651
|
const remainingFragment = tryRemovePrefix(fragment, pathPrefix);
|
|
@@ -160772,7 +160715,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160772
160715
|
}
|
|
160773
160716
|
function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
160774
160717
|
const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
|
|
160775
|
-
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.
|
|
160718
|
+
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && !moduleName.includes("*"));
|
|
160776
160719
|
if (fragmentDirectory !== void 0) {
|
|
160777
160720
|
const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory);
|
|
160778
160721
|
return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator));
|
|
@@ -160886,7 +160829,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160886
160829
|
return false;
|
|
160887
160830
|
}
|
|
160888
160831
|
function containsSlash(fragment) {
|
|
160889
|
-
return
|
|
160832
|
+
return fragment.includes(directorySeparator);
|
|
160890
160833
|
}
|
|
160891
160834
|
function isRequireCallArgument(node) {
|
|
160892
160835
|
return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require";
|
|
@@ -165465,11 +165408,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165465
165408
|
}
|
|
165466
165409
|
}
|
|
165467
165410
|
function isRegionDelimiter(lineText) {
|
|
165468
|
-
lineText =
|
|
165411
|
+
lineText = lineText.trimStart();
|
|
165469
165412
|
if (!startsWith(lineText, "//")) {
|
|
165470
165413
|
return null;
|
|
165471
165414
|
}
|
|
165472
|
-
lineText =
|
|
165415
|
+
lineText = lineText.slice(2).trim();
|
|
165473
165416
|
return regionDelimiterRegExp.exec(lineText);
|
|
165474
165417
|
}
|
|
165475
165418
|
function addOutliningForLeadingCommentsForPos(pos, sourceFile, cancellationToken, out) {
|
|
@@ -169779,7 +169722,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169779
169722
|
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
|
|
169780
169723
|
}
|
|
169781
169724
|
function isNotPropertyAccessOnIntegerLiteral(context) {
|
|
169782
|
-
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().
|
|
169725
|
+
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().includes(".");
|
|
169783
169726
|
}
|
|
169784
169727
|
var init_rules = __esm({
|
|
169785
169728
|
"src/services/formatting/rules.ts"() {
|
|
@@ -170975,7 +170918,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
170975
170918
|
}
|
|
170976
170919
|
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
|
|
170977
170920
|
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
|
|
170978
|
-
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].
|
|
170921
|
+
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind);
|
|
170979
170922
|
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
|
|
170980
170923
|
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
|
|
170981
170924
|
}
|
|
@@ -172566,7 +172509,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
172566
172509
|
|
|
172567
172510
|
// src/server/scriptInfo.ts
|
|
172568
172511
|
function isDynamicFileName(fileName) {
|
|
172569
|
-
return fileName[0] === "^" || (
|
|
172512
|
+
return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator);
|
|
172570
172513
|
}
|
|
172571
172514
|
function ensurePrimaryProjectKind(project) {
|
|
172572
172515
|
if (!project || project.projectKind === 3 /* AutoImportProvider */ || project.projectKind === 4 /* Auxiliary */) {
|
|
@@ -174216,7 +174159,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174216
174159
|
}
|
|
174217
174160
|
removeExistingTypings(include) {
|
|
174218
174161
|
const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
|
|
174219
|
-
return include.filter((i) => existing.
|
|
174162
|
+
return include.filter((i) => !existing.includes(i));
|
|
174220
174163
|
}
|
|
174221
174164
|
updateGraphWorker() {
|
|
174222
174165
|
var _a, _b;
|
|
@@ -178413,7 +178356,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178413
178356
|
this.logger.info(`Excluding files based on rule ${name} matching file '${root}'`);
|
|
178414
178357
|
if (rule2.types) {
|
|
178415
178358
|
for (const type of rule2.types) {
|
|
178416
|
-
if (typeAcqInclude.
|
|
178359
|
+
if (!typeAcqInclude.includes(type)) {
|
|
178417
178360
|
typeAcqInclude.push(type);
|
|
178418
178361
|
}
|
|
178419
178362
|
}
|
|
@@ -178432,13 +178375,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178432
178375
|
return groupNumberOrString;
|
|
178433
178376
|
}).join("");
|
|
178434
178377
|
});
|
|
178435
|
-
if (excludeRules.
|
|
178378
|
+
if (!excludeRules.includes(processedRule)) {
|
|
178436
178379
|
excludeRules.push(processedRule);
|
|
178437
178380
|
}
|
|
178438
178381
|
}
|
|
178439
178382
|
} else {
|
|
178440
178383
|
const escaped = _ProjectService.escapeFilenameForRegex(root);
|
|
178441
|
-
if (excludeRules.
|
|
178384
|
+
if (!excludeRules.includes(escaped)) {
|
|
178442
178385
|
excludeRules.push(escaped);
|
|
178443
178386
|
}
|
|
178444
178387
|
}
|
|
@@ -178462,7 +178405,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178462
178405
|
this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`);
|
|
178463
178406
|
excludedFiles.push(normalizedNames[i]);
|
|
178464
178407
|
exclude = true;
|
|
178465
|
-
if (typeAcqInclude.
|
|
178408
|
+
if (!typeAcqInclude.includes(typeName)) {
|
|
178466
178409
|
typeAcqInclude.push(typeName);
|
|
178467
178410
|
}
|
|
178468
178411
|
}
|
|
@@ -182002,7 +181945,7 @@ ${e.message}`;
|
|
|
182002
181945
|
if (languageServiceDisabled) {
|
|
182003
181946
|
return;
|
|
182004
181947
|
}
|
|
182005
|
-
const fileNamesInProject = fileNames.filter((value) => !
|
|
181948
|
+
const fileNamesInProject = fileNames.filter((value) => !value.includes("lib.d.ts"));
|
|
182006
181949
|
if (fileNamesInProject.length === 0) {
|
|
182007
181950
|
return;
|
|
182008
181951
|
}
|
|
@@ -185056,8 +184999,6 @@ ${e.message}`;
|
|
|
185056
184999
|
outFile: () => outFile,
|
|
185057
185000
|
packageIdToPackageName: () => packageIdToPackageName,
|
|
185058
185001
|
packageIdToString: () => packageIdToString,
|
|
185059
|
-
padLeft: () => padLeft,
|
|
185060
|
-
padRight: () => padRight,
|
|
185061
185002
|
paramHelper: () => paramHelper,
|
|
185062
185003
|
parameterIsThisKeyword: () => parameterIsThisKeyword,
|
|
185063
185004
|
parameterNamePart: () => parameterNamePart,
|
|
@@ -185264,7 +185205,6 @@ ${e.message}`;
|
|
|
185264
185205
|
startsWithDirectory: () => startsWithDirectory,
|
|
185265
185206
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
185266
185207
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
185267
|
-
stringContains: () => stringContains,
|
|
185268
185208
|
stringContainsAt: () => stringContainsAt,
|
|
185269
185209
|
stringToToken: () => stringToToken,
|
|
185270
185210
|
stripQuotes: () => stripQuotes,
|
|
@@ -185351,9 +185291,6 @@ ${e.message}`;
|
|
|
185351
185291
|
transpile: () => transpile,
|
|
185352
185292
|
transpileModule: () => transpileModule,
|
|
185353
185293
|
transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions,
|
|
185354
|
-
trimString: () => trimString,
|
|
185355
|
-
trimStringEnd: () => trimStringEnd,
|
|
185356
|
-
trimStringStart: () => trimStringStart,
|
|
185357
185294
|
tryAddToSet: () => tryAddToSet,
|
|
185358
185295
|
tryAndIgnoreErrors: () => tryAndIgnoreErrors,
|
|
185359
185296
|
tryCast: () => tryCast,
|
|
@@ -187465,8 +187402,6 @@ ${e.message}`;
|
|
|
187465
187402
|
outFile: () => outFile,
|
|
187466
187403
|
packageIdToPackageName: () => packageIdToPackageName,
|
|
187467
187404
|
packageIdToString: () => packageIdToString,
|
|
187468
|
-
padLeft: () => padLeft,
|
|
187469
|
-
padRight: () => padRight,
|
|
187470
187405
|
paramHelper: () => paramHelper,
|
|
187471
187406
|
parameterIsThisKeyword: () => parameterIsThisKeyword,
|
|
187472
187407
|
parameterNamePart: () => parameterNamePart,
|
|
@@ -187673,7 +187608,6 @@ ${e.message}`;
|
|
|
187673
187608
|
startsWithDirectory: () => startsWithDirectory,
|
|
187674
187609
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
187675
187610
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
187676
|
-
stringContains: () => stringContains,
|
|
187677
187611
|
stringContainsAt: () => stringContainsAt,
|
|
187678
187612
|
stringToToken: () => stringToToken,
|
|
187679
187613
|
stripQuotes: () => stripQuotes,
|
|
@@ -187760,9 +187694,6 @@ ${e.message}`;
|
|
|
187760
187694
|
transpile: () => transpile,
|
|
187761
187695
|
transpileModule: () => transpileModule,
|
|
187762
187696
|
transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions,
|
|
187763
|
-
trimString: () => trimString,
|
|
187764
|
-
trimStringEnd: () => trimStringEnd,
|
|
187765
|
-
trimStringStart: () => trimStringStart,
|
|
187766
187697
|
tryAddToSet: () => tryAddToSet,
|
|
187767
187698
|
tryAndIgnoreErrors: () => tryAndIgnoreErrors,
|
|
187768
187699
|
tryCast: () => tryCast,
|