@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/tsserver.js
CHANGED
|
@@ -1949,8 +1949,6 @@ __export(server_exports, {
|
|
|
1949
1949
|
outFile: () => outFile,
|
|
1950
1950
|
packageIdToPackageName: () => packageIdToPackageName,
|
|
1951
1951
|
packageIdToString: () => packageIdToString,
|
|
1952
|
-
padLeft: () => padLeft,
|
|
1953
|
-
padRight: () => padRight,
|
|
1954
1952
|
paramHelper: () => paramHelper,
|
|
1955
1953
|
parameterIsThisKeyword: () => parameterIsThisKeyword,
|
|
1956
1954
|
parameterNamePart: () => parameterNamePart,
|
|
@@ -2157,7 +2155,6 @@ __export(server_exports, {
|
|
|
2157
2155
|
startsWithDirectory: () => startsWithDirectory,
|
|
2158
2156
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
2159
2157
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
2160
|
-
stringContains: () => stringContains,
|
|
2161
2158
|
stringContainsAt: () => stringContainsAt,
|
|
2162
2159
|
stringToToken: () => stringToToken,
|
|
2163
2160
|
stripQuotes: () => stripQuotes,
|
|
@@ -2244,9 +2241,6 @@ __export(server_exports, {
|
|
|
2244
2241
|
transpile: () => transpile,
|
|
2245
2242
|
transpileModule: () => transpileModule,
|
|
2246
2243
|
transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions,
|
|
2247
|
-
trimString: () => trimString,
|
|
2248
|
-
trimStringEnd: () => trimStringEnd,
|
|
2249
|
-
trimStringStart: () => trimStringStart,
|
|
2250
2244
|
tryAddToSet: () => tryAddToSet,
|
|
2251
2245
|
tryAndIgnoreErrors: () => tryAndIgnoreErrors,
|
|
2252
2246
|
tryCast: () => tryCast,
|
|
@@ -2333,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2333
2327
|
|
|
2334
2328
|
// src/compiler/corePublic.ts
|
|
2335
2329
|
var versionMajorMinor = "5.3";
|
|
2336
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2330
|
+
var version = `${versionMajorMinor}.0-insiders.20230829`;
|
|
2337
2331
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2338
2332
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2339
2333
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3628,10 +3622,7 @@ function getStringComparer(ignoreCase) {
|
|
|
3628
3622
|
return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
|
|
3629
3623
|
}
|
|
3630
3624
|
var createUIStringComparer = (() => {
|
|
3631
|
-
|
|
3632
|
-
let enUSComparer;
|
|
3633
|
-
const stringComparerFactory = getStringComparerFactory();
|
|
3634
|
-
return createStringComparer;
|
|
3625
|
+
return createIntlCollatorStringComparer;
|
|
3635
3626
|
function compareWithCallback(a, b, comparer) {
|
|
3636
3627
|
if (a === b)
|
|
3637
3628
|
return 0 /* EqualTo */;
|
|
@@ -3646,41 +3637,6 @@ var createUIStringComparer = (() => {
|
|
|
3646
3637
|
const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
|
|
3647
3638
|
return (a, b) => compareWithCallback(a, b, comparer);
|
|
3648
3639
|
}
|
|
3649
|
-
function createLocaleCompareStringComparer(locale) {
|
|
3650
|
-
if (locale !== void 0)
|
|
3651
|
-
return createFallbackStringComparer();
|
|
3652
|
-
return (a, b) => compareWithCallback(a, b, compareStrings);
|
|
3653
|
-
function compareStrings(a, b) {
|
|
3654
|
-
return a.localeCompare(b);
|
|
3655
|
-
}
|
|
3656
|
-
}
|
|
3657
|
-
function createFallbackStringComparer() {
|
|
3658
|
-
return (a, b) => compareWithCallback(a, b, compareDictionaryOrder);
|
|
3659
|
-
function compareDictionaryOrder(a, b) {
|
|
3660
|
-
return compareStrings(a.toUpperCase(), b.toUpperCase()) || compareStrings(a, b);
|
|
3661
|
-
}
|
|
3662
|
-
function compareStrings(a, b) {
|
|
3663
|
-
return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */;
|
|
3664
|
-
}
|
|
3665
|
-
}
|
|
3666
|
-
function getStringComparerFactory() {
|
|
3667
|
-
if (typeof Intl === "object" && typeof Intl.Collator === "function") {
|
|
3668
|
-
return createIntlCollatorStringComparer;
|
|
3669
|
-
}
|
|
3670
|
-
if (typeof String.prototype.localeCompare === "function" && typeof String.prototype.toLocaleUpperCase === "function" && "a".localeCompare("B") < 0) {
|
|
3671
|
-
return createLocaleCompareStringComparer;
|
|
3672
|
-
}
|
|
3673
|
-
return createFallbackStringComparer;
|
|
3674
|
-
}
|
|
3675
|
-
function createStringComparer(locale) {
|
|
3676
|
-
if (locale === void 0) {
|
|
3677
|
-
return defaultComparer || (defaultComparer = stringComparerFactory(locale));
|
|
3678
|
-
} else if (locale === "en-US") {
|
|
3679
|
-
return enUSComparer || (enUSComparer = stringComparerFactory(locale));
|
|
3680
|
-
} else {
|
|
3681
|
-
return stringComparerFactory(locale);
|
|
3682
|
-
}
|
|
3683
|
-
}
|
|
3684
3640
|
})();
|
|
3685
3641
|
var uiComparerCaseSensitive;
|
|
3686
3642
|
var uiLocale;
|
|
@@ -3779,9 +3735,6 @@ function removeSuffix(str, suffix) {
|
|
|
3779
3735
|
function tryRemoveSuffix(str, suffix) {
|
|
3780
3736
|
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0;
|
|
3781
3737
|
}
|
|
3782
|
-
function stringContains(str, substring) {
|
|
3783
|
-
return str.indexOf(substring) !== -1;
|
|
3784
|
-
}
|
|
3785
3738
|
function removeMinAndVersionNumbers(fileName) {
|
|
3786
3739
|
let end = fileName.length;
|
|
3787
3740
|
for (let pos = end - 1; pos > 0; pos--) {
|
|
@@ -3964,12 +3917,6 @@ function cartesianProductWorker(arrays, result, outer, index) {
|
|
|
3964
3917
|
}
|
|
3965
3918
|
}
|
|
3966
3919
|
}
|
|
3967
|
-
function padLeft(s, length2, padString = " ") {
|
|
3968
|
-
return length2 <= s.length ? s : padString.repeat(length2 - s.length) + s;
|
|
3969
|
-
}
|
|
3970
|
-
function padRight(s, length2, padString = " ") {
|
|
3971
|
-
return length2 <= s.length ? s : s + padString.repeat(length2 - s.length);
|
|
3972
|
-
}
|
|
3973
3920
|
function takeWhile(array, predicate) {
|
|
3974
3921
|
if (array) {
|
|
3975
3922
|
const len = array.length;
|
|
@@ -3990,18 +3937,6 @@ function skipWhile(array, predicate) {
|
|
|
3990
3937
|
return array.slice(index);
|
|
3991
3938
|
}
|
|
3992
3939
|
}
|
|
3993
|
-
var trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s));
|
|
3994
|
-
var trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl;
|
|
3995
|
-
var trimStringStart = !!String.prototype.trimStart ? (s) => s.trimStart() : (s) => s.replace(/^\s+/g, "");
|
|
3996
|
-
function trimEndImpl(s) {
|
|
3997
|
-
let end = s.length - 1;
|
|
3998
|
-
while (end >= 0) {
|
|
3999
|
-
if (!isWhiteSpaceLike(s.charCodeAt(end)))
|
|
4000
|
-
break;
|
|
4001
|
-
end--;
|
|
4002
|
-
}
|
|
4003
|
-
return s.slice(0, end + 1);
|
|
4004
|
-
}
|
|
4005
3940
|
function isNodeLikeSystem() {
|
|
4006
3941
|
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
4007
3942
|
}
|
|
@@ -5197,18 +5132,18 @@ var hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i;
|
|
|
5197
5132
|
var rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;
|
|
5198
5133
|
function parseRange(text) {
|
|
5199
5134
|
const alternatives = [];
|
|
5200
|
-
for (let range of
|
|
5135
|
+
for (let range of text.trim().split(logicalOrRegExp)) {
|
|
5201
5136
|
if (!range)
|
|
5202
5137
|
continue;
|
|
5203
5138
|
const comparators = [];
|
|
5204
|
-
range =
|
|
5139
|
+
range = range.trim();
|
|
5205
5140
|
const match = hyphenRegExp.exec(range);
|
|
5206
5141
|
if (match) {
|
|
5207
5142
|
if (!parseHyphen(match[1], match[2], comparators))
|
|
5208
5143
|
return void 0;
|
|
5209
5144
|
} else {
|
|
5210
5145
|
for (const simple of range.split(whitespaceRegExp)) {
|
|
5211
|
-
const match2 = rangeRegExp.exec(
|
|
5146
|
+
const match2 = rangeRegExp.exec(simple.trim());
|
|
5212
5147
|
if (!match2 || !parseComparator(match2[1], match2[2], comparators))
|
|
5213
5148
|
return void 0;
|
|
5214
5149
|
}
|
|
@@ -8025,11 +7960,11 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
8025
7960
|
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
8026
7961
|
}
|
|
8027
7962
|
function isInPath(path, searchPath) {
|
|
8028
|
-
if (
|
|
7963
|
+
if (path.includes(searchPath))
|
|
8029
7964
|
return true;
|
|
8030
7965
|
if (useCaseSensitiveFileNames2)
|
|
8031
7966
|
return false;
|
|
8032
|
-
return
|
|
7967
|
+
return toCanonicalFilePath(path).includes(searchPath);
|
|
8033
7968
|
}
|
|
8034
7969
|
}
|
|
8035
7970
|
var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => {
|
|
@@ -8877,7 +8812,7 @@ function pathIsBareSpecifier(path) {
|
|
|
8877
8812
|
return !pathIsAbsolute(path) && !pathIsRelative(path);
|
|
8878
8813
|
}
|
|
8879
8814
|
function hasExtension(fileName) {
|
|
8880
|
-
return
|
|
8815
|
+
return getBaseFileName(fileName).includes(".");
|
|
8881
8816
|
}
|
|
8882
8817
|
function fileExtensionIs(path, extension) {
|
|
8883
8818
|
return path.length > extension.length && endsWith(path, extension);
|
|
@@ -9022,7 +8957,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
|
|
|
9022
8957
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
9023
8958
|
}
|
|
9024
8959
|
function normalizeSlashes(path) {
|
|
9025
|
-
return path.
|
|
8960
|
+
return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
|
|
9026
8961
|
}
|
|
9027
8962
|
function reducePathComponents(components) {
|
|
9028
8963
|
if (!some(components))
|
|
@@ -12407,7 +12342,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12407
12342
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12408
12343
|
if (shouldEmitInvalidEscapeError) {
|
|
12409
12344
|
const code = parseInt(text.substring(start3 + 1, pos), 8);
|
|
12410
|
-
error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start3, pos - start3, "\\x" +
|
|
12345
|
+
error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start3, pos - start3, "\\x" + code.toString(16).padStart(2, "0"));
|
|
12411
12346
|
return String.fromCharCode(code);
|
|
12412
12347
|
}
|
|
12413
12348
|
return text.substring(start3, pos);
|
|
@@ -13210,7 +13145,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13210
13145
|
return token;
|
|
13211
13146
|
}
|
|
13212
13147
|
function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
|
|
13213
|
-
const type = getDirectiveFromComment(
|
|
13148
|
+
const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
|
|
13214
13149
|
if (type === void 0) {
|
|
13215
13150
|
return commentDirectives2;
|
|
13216
13151
|
}
|
|
@@ -13544,20 +13479,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13544
13479
|
inJSDocType += inType ? 1 : -1;
|
|
13545
13480
|
}
|
|
13546
13481
|
}
|
|
13547
|
-
|
|
13548
|
-
|
|
13549
|
-
|
|
13550
|
-
return void 0;
|
|
13551
|
-
}
|
|
13552
|
-
const first2 = str.charCodeAt(i);
|
|
13553
|
-
if (first2 >= 55296 && first2 <= 56319 && size > i + 1) {
|
|
13554
|
-
const second = str.charCodeAt(i + 1);
|
|
13555
|
-
if (second >= 56320 && second <= 57343) {
|
|
13556
|
-
return (first2 - 55296) * 1024 + second - 56320 + 65536;
|
|
13557
|
-
}
|
|
13558
|
-
}
|
|
13559
|
-
return first2;
|
|
13560
|
-
};
|
|
13482
|
+
function codePointAt(s, i) {
|
|
13483
|
+
return s.codePointAt(i);
|
|
13484
|
+
}
|
|
13561
13485
|
function charSize(ch) {
|
|
13562
13486
|
if (ch >= 65536) {
|
|
13563
13487
|
return 2;
|
|
@@ -15244,7 +15168,7 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
15244
15168
|
void 0,
|
|
15245
15169
|
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,
|
|
15246
15170
|
node10Result,
|
|
15247
|
-
node10Result.
|
|
15171
|
+
node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
|
|
15248
15172
|
) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
|
|
15249
15173
|
/*details*/
|
|
15250
15174
|
void 0,
|
|
@@ -15520,7 +15444,7 @@ function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) {
|
|
|
15520
15444
|
}
|
|
15521
15445
|
let text = sourceText.substring(includeTrivia ? node.pos : skipTrivia(sourceText, node.pos), node.end);
|
|
15522
15446
|
if (isJSDocTypeExpressionOrChild(node)) {
|
|
15523
|
-
text = text.split(/\r\n|\n|\r/).map((line) =>
|
|
15447
|
+
text = text.split(/\r\n|\n|\r/).map((line) => line.replace(/^\s*\*/, "").trimStart()).join("\n");
|
|
15524
15448
|
}
|
|
15525
15449
|
return text;
|
|
15526
15450
|
}
|
|
@@ -18753,7 +18677,7 @@ function isQuoteOrBacktick(charCode) {
|
|
|
18753
18677
|
}
|
|
18754
18678
|
function isIntrinsicJsxName(name) {
|
|
18755
18679
|
const ch = name.charCodeAt(0);
|
|
18756
|
-
return ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
18680
|
+
return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
|
|
18757
18681
|
}
|
|
18758
18682
|
var indentStrings = ["", " "];
|
|
18759
18683
|
function getIndentString(level) {
|
|
@@ -18767,7 +18691,7 @@ function getIndentSize() {
|
|
|
18767
18691
|
return indentStrings[1].length;
|
|
18768
18692
|
}
|
|
18769
18693
|
function isNightly() {
|
|
18770
|
-
return
|
|
18694
|
+
return version.includes("-dev") || version.includes("-insiders");
|
|
18771
18695
|
}
|
|
18772
18696
|
function createTextWriter(newLine) {
|
|
18773
18697
|
var output;
|
|
@@ -18957,7 +18881,7 @@ function getExternalModuleNameFromDeclaration(host, resolver, declaration) {
|
|
|
18957
18881
|
return void 0;
|
|
18958
18882
|
}
|
|
18959
18883
|
const specifier = getExternalModuleName(declaration);
|
|
18960
|
-
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).
|
|
18884
|
+
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
|
|
18961
18885
|
return void 0;
|
|
18962
18886
|
}
|
|
18963
18887
|
return getResolvedExternalModuleName(host, file);
|
|
@@ -19309,7 +19233,7 @@ function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLin
|
|
|
19309
19233
|
}
|
|
19310
19234
|
function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) {
|
|
19311
19235
|
const end = Math.min(commentEnd, nextLineStart - 1);
|
|
19312
|
-
const currentLineText =
|
|
19236
|
+
const currentLineText = text.substring(pos, end).trim();
|
|
19313
19237
|
if (currentLineText) {
|
|
19314
19238
|
writer.writeComment(currentLineText);
|
|
19315
19239
|
if (end !== commentEnd) {
|
|
@@ -20962,7 +20886,7 @@ function getSupportedExtensions(options, extraFileExtensions) {
|
|
|
20962
20886
|
const flatBuiltins = flatten(builtins);
|
|
20963
20887
|
const extensions = [
|
|
20964
20888
|
...builtins,
|
|
20965
|
-
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.
|
|
20889
|
+
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
|
|
20966
20890
|
];
|
|
20967
20891
|
return extensions;
|
|
20968
20892
|
}
|
|
@@ -21424,7 +21348,7 @@ function expressionResultIsUnused(node) {
|
|
|
21424
21348
|
}
|
|
21425
21349
|
}
|
|
21426
21350
|
function containsIgnoredPath(path) {
|
|
21427
|
-
return some(ignoredPaths, (p) =>
|
|
21351
|
+
return some(ignoredPaths, (p) => path.includes(p));
|
|
21428
21352
|
}
|
|
21429
21353
|
function getContainingNodeArray(node) {
|
|
21430
21354
|
if (!node.parent)
|
|
@@ -36152,7 +36076,7 @@ var Parser;
|
|
|
36152
36076
|
}
|
|
36153
36077
|
function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) {
|
|
36154
36078
|
const namespaceFlag = flags & 32 /* Namespace */;
|
|
36155
|
-
const name = parseIdentifier();
|
|
36079
|
+
const name = flags & 8 /* NestedNamespace */ ? parseIdentifierName() : parseIdentifier();
|
|
36156
36080
|
const body = parseOptional(25 /* DotToken */) ? parseModuleOrNamespaceDeclaration(
|
|
36157
36081
|
getNodePos(),
|
|
36158
36082
|
/*hasJSDoc*/
|
|
@@ -36622,8 +36546,6 @@ var Parser;
|
|
|
36622
36546
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
36623
36547
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
36624
36548
|
function parseJSDocCommentWorker(start2 = 0, length2) {
|
|
36625
|
-
const saveParsingContext = parsingContext;
|
|
36626
|
-
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
36627
36549
|
const content = sourceText;
|
|
36628
36550
|
const end = length2 === void 0 ? content.length : start2 + length2;
|
|
36629
36551
|
length2 = end - start2;
|
|
@@ -36640,6 +36562,8 @@ var Parser;
|
|
|
36640
36562
|
let commentsPos;
|
|
36641
36563
|
let comments = [];
|
|
36642
36564
|
const parts = [];
|
|
36565
|
+
const saveParsingContext = parsingContext;
|
|
36566
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
36643
36567
|
const result = scanner2.scanRange(start2 + 3, length2 - 5, doJSDocScan);
|
|
36644
36568
|
parsingContext = saveParsingContext;
|
|
36645
36569
|
return result;
|
|
@@ -36731,7 +36655,7 @@ var Parser;
|
|
|
36731
36655
|
nextTokenJSDoc();
|
|
36732
36656
|
}
|
|
36733
36657
|
}
|
|
36734
|
-
const trimmedComments =
|
|
36658
|
+
const trimmedComments = comments.join("").trimEnd();
|
|
36735
36659
|
if (parts.length && trimmedComments.length) {
|
|
36736
36660
|
parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start2, commentsPos));
|
|
36737
36661
|
}
|
|
@@ -36747,7 +36671,7 @@ var Parser;
|
|
|
36747
36671
|
}
|
|
36748
36672
|
function removeTrailingWhitespace(comments2) {
|
|
36749
36673
|
while (comments2.length) {
|
|
36750
|
-
const trimmed =
|
|
36674
|
+
const trimmed = comments2[comments2.length - 1].trimEnd();
|
|
36751
36675
|
if (trimmed === "") {
|
|
36752
36676
|
comments2.pop();
|
|
36753
36677
|
} else if (trimmed.length < comments2[comments2.length - 1].length) {
|
|
@@ -36987,7 +36911,7 @@ var Parser;
|
|
|
36987
36911
|
}
|
|
36988
36912
|
}
|
|
36989
36913
|
removeLeadingNewlines(comments2);
|
|
36990
|
-
const trimmedComments =
|
|
36914
|
+
const trimmedComments = comments2.join("").trimEnd();
|
|
36991
36915
|
if (parts2.length) {
|
|
36992
36916
|
if (trimmedComments.length) {
|
|
36993
36917
|
parts2.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd2 ?? commentsPos2));
|
|
@@ -37885,7 +37809,7 @@ var IncrementalParser;
|
|
|
37885
37809
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
37886
37810
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
37887
37811
|
function isDeclarationFileName(fileName) {
|
|
37888
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) &&
|
|
37812
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
|
|
37889
37813
|
}
|
|
37890
37814
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
37891
37815
|
if (!mode) {
|
|
@@ -38071,7 +37995,7 @@ function getNamedPragmaArguments(pragma, text) {
|
|
|
38071
37995
|
return {};
|
|
38072
37996
|
if (!pragma.args)
|
|
38073
37997
|
return {};
|
|
38074
|
-
const args =
|
|
37998
|
+
const args = text.trim().split(/\s+/);
|
|
38075
37999
|
const argMap = {};
|
|
38076
38000
|
for (let i = 0; i < pragma.args.length; i++) {
|
|
38077
38001
|
const argument = pragma.args[i];
|
|
@@ -39596,14 +39520,14 @@ function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
|
39596
39520
|
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
39597
39521
|
}
|
|
39598
39522
|
function parseCustomTypeOption(opt, value, errors) {
|
|
39599
|
-
return convertJsonOptionOfCustomType(opt,
|
|
39523
|
+
return convertJsonOptionOfCustomType(opt, (value ?? "").trim(), errors);
|
|
39600
39524
|
}
|
|
39601
39525
|
function parseListTypeOption(opt, value = "", errors) {
|
|
39602
|
-
value =
|
|
39526
|
+
value = value.trim();
|
|
39603
39527
|
if (startsWith(value, "-")) {
|
|
39604
39528
|
return void 0;
|
|
39605
39529
|
}
|
|
39606
|
-
if (opt.type === "listOrElement" && !
|
|
39530
|
+
if (opt.type === "listOrElement" && !value.includes(",")) {
|
|
39607
39531
|
return validateJsonOptionValue(opt, value, errors);
|
|
39608
39532
|
}
|
|
39609
39533
|
if (value === "") {
|
|
@@ -40649,7 +40573,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
|
|
|
40649
40573
|
var _a;
|
|
40650
40574
|
basePath = normalizeSlashes(basePath);
|
|
40651
40575
|
const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
|
|
40652
|
-
if (resolutionStack.
|
|
40576
|
+
if (resolutionStack.includes(resolvedPath)) {
|
|
40653
40577
|
errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
|
|
40654
40578
|
return { raw: json || convertToObject(sourceFile, errors) };
|
|
40655
40579
|
}
|
|
@@ -42481,7 +42405,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42481
42405
|
result = tryResolve(extensions, state);
|
|
42482
42406
|
}
|
|
42483
42407
|
let legacyResult;
|
|
42484
|
-
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.
|
|
42408
|
+
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")) {
|
|
42485
42409
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
42486
42410
|
const diagnosticState = {
|
|
42487
42411
|
...state,
|
|
@@ -42525,7 +42449,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42525
42449
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
42526
42450
|
}
|
|
42527
42451
|
if (!resolved2) {
|
|
42528
|
-
if (moduleName.
|
|
42452
|
+
if (moduleName.includes(":")) {
|
|
42529
42453
|
if (traceEnabled) {
|
|
42530
42454
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
42531
42455
|
}
|
|
@@ -42615,7 +42539,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
42615
42539
|
}
|
|
42616
42540
|
var nodeModulesPathPart = "/node_modules/";
|
|
42617
42541
|
function pathContainsNodeModules(path) {
|
|
42618
|
-
return
|
|
42542
|
+
return path.includes(nodeModulesPathPart);
|
|
42619
42543
|
}
|
|
42620
42544
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
42621
42545
|
const path = normalizePath(resolved);
|
|
@@ -42651,7 +42575,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
42651
42575
|
}
|
|
42652
42576
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
42653
42577
|
const filename = getBaseFileName(candidate);
|
|
42654
|
-
if (filename.
|
|
42578
|
+
if (!filename.includes(".")) {
|
|
42655
42579
|
return void 0;
|
|
42656
42580
|
}
|
|
42657
42581
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -42808,7 +42732,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42808
42732
|
function loadEntrypointsFromTargetExports(target) {
|
|
42809
42733
|
var _a, _b;
|
|
42810
42734
|
if (typeof target === "string" && startsWith(target, "./")) {
|
|
42811
|
-
if (target.
|
|
42735
|
+
if (target.includes("*") && state.host.readDirectory) {
|
|
42812
42736
|
if (target.indexOf("*") !== target.lastIndexOf("*")) {
|
|
42813
42737
|
return false;
|
|
42814
42738
|
}
|
|
@@ -42827,7 +42751,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42827
42751
|
});
|
|
42828
42752
|
} else {
|
|
42829
42753
|
const partsAfterFirst = getPathComponents(target).slice(2);
|
|
42830
|
-
if (partsAfterFirst.
|
|
42754
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
42831
42755
|
return false;
|
|
42832
42756
|
}
|
|
42833
42757
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
@@ -43195,7 +43119,7 @@ function comparePatternKeys(a, b) {
|
|
|
43195
43119
|
}
|
|
43196
43120
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
43197
43121
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
43198
|
-
if (!endsWith(moduleName, directorySeparator) && moduleName.
|
|
43122
|
+
if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
|
|
43199
43123
|
const target = lookupTable[moduleName];
|
|
43200
43124
|
return loadModuleFromTargetImportOrExport(
|
|
43201
43125
|
target,
|
|
@@ -43206,7 +43130,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
43206
43130
|
moduleName
|
|
43207
43131
|
);
|
|
43208
43132
|
}
|
|
43209
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
43133
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
|
|
43210
43134
|
for (const potentialTarget of expandingKeys) {
|
|
43211
43135
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
43212
43136
|
const target = lookupTable[potentialTarget];
|
|
@@ -43300,7 +43224,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43300
43224
|
}
|
|
43301
43225
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
43302
43226
|
const partsAfterFirst = parts.slice(1);
|
|
43303
|
-
if (partsAfterFirst.
|
|
43227
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
43304
43228
|
if (state.traceEnabled) {
|
|
43305
43229
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
43306
43230
|
}
|
|
@@ -43311,7 +43235,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43311
43235
|
}
|
|
43312
43236
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
43313
43237
|
const subpathParts = getPathComponents(subpath);
|
|
43314
|
-
if (subpathParts.
|
|
43238
|
+
if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
|
|
43315
43239
|
if (state.traceEnabled) {
|
|
43316
43240
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
43317
43241
|
}
|
|
@@ -43338,7 +43262,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43338
43262
|
if (!Array.isArray(target)) {
|
|
43339
43263
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
43340
43264
|
for (const condition of getOwnKeys(target)) {
|
|
43341
|
-
if (condition === "default" || state.conditions.
|
|
43265
|
+
if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
43342
43266
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
43343
43267
|
const subTarget = target[condition];
|
|
43344
43268
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -43399,7 +43323,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43399
43323
|
}
|
|
43400
43324
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
43401
43325
|
var _a, _b, _c, _d;
|
|
43402
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.
|
|
43326
|
+
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)) {
|
|
43403
43327
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
43404
43328
|
const commonSourceDirGuesses = [];
|
|
43405
43329
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -43473,7 +43397,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43473
43397
|
}
|
|
43474
43398
|
}
|
|
43475
43399
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
43476
|
-
if (conditions.
|
|
43400
|
+
if (!conditions.includes("types"))
|
|
43477
43401
|
return false;
|
|
43478
43402
|
if (!startsWith(key, "types@"))
|
|
43479
43403
|
return false;
|
|
@@ -43678,7 +43602,7 @@ function getPackageNameFromTypesPackageName(mangledName) {
|
|
|
43678
43602
|
return mangledName;
|
|
43679
43603
|
}
|
|
43680
43604
|
function unmangleScopedPackageName(typesPackageName) {
|
|
43681
|
-
return
|
|
43605
|
+
return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
43682
43606
|
}
|
|
43683
43607
|
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
43684
43608
|
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
@@ -47371,12 +47295,12 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
47371
47295
|
/*currentDirectory*/
|
|
47372
47296
|
void 0
|
|
47373
47297
|
);
|
|
47374
|
-
const mode2 = endsWith(k, "/") ? 1 /* Directory */ :
|
|
47298
|
+
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
47375
47299
|
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
|
|
47376
47300
|
});
|
|
47377
47301
|
} else {
|
|
47378
47302
|
for (const key of getOwnKeys(exports)) {
|
|
47379
|
-
if (key === "default" || conditions.
|
|
47303
|
+
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
47380
47304
|
const subTarget = exports[key];
|
|
47381
47305
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
47382
47306
|
if (result) {
|
|
@@ -47542,7 +47466,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
47542
47466
|
return fileName;
|
|
47543
47467
|
} else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
|
|
47544
47468
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
47545
|
-
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) &&
|
|
47469
|
+
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
|
|
47546
47470
|
return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
|
|
47547
47471
|
}
|
|
47548
47472
|
switch (allowedEndings[0]) {
|
|
@@ -47568,7 +47492,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
47568
47492
|
}
|
|
47569
47493
|
function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
|
|
47570
47494
|
const baseName = getBaseFileName(fileName);
|
|
47571
|
-
if (!endsWith(fileName, ".ts" /* Ts */) || !
|
|
47495
|
+
if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
|
|
47572
47496
|
return void 0;
|
|
47573
47497
|
const noExtension = removeExtension(fileName, ".ts" /* Ts */);
|
|
47574
47498
|
const ext = noExtension.substring(noExtension.lastIndexOf("."));
|
|
@@ -48287,6 +48211,7 @@ function createTypeChecker(host) {
|
|
|
48287
48211
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
48288
48212
|
var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */);
|
|
48289
48213
|
var wildcardType = createIntrinsicType(1 /* Any */, "any");
|
|
48214
|
+
var blockedStringType = createIntrinsicType(1 /* Any */, "any");
|
|
48290
48215
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
48291
48216
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
48292
48217
|
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */);
|
|
@@ -49973,7 +49898,7 @@ function createTypeChecker(host) {
|
|
|
49973
49898
|
}
|
|
49974
49899
|
}
|
|
49975
49900
|
function isSameScopeDescendentOf(initial, parent2, stopAt) {
|
|
49976
|
-
return !!parent2 && !!findAncestor(initial, (n) => n === parent2 || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) ||
|
|
49901
|
+
return !!parent2 && !!findAncestor(initial, (n) => n === parent2 || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) || getFunctionFlags(n) & 3 /* AsyncGenerator */) ? "quit" : false));
|
|
49977
49902
|
}
|
|
49978
49903
|
function getAnyImportSyntax(node) {
|
|
49979
49904
|
switch (node.kind) {
|
|
@@ -53629,12 +53554,12 @@ function createTypeChecker(host) {
|
|
|
53629
53554
|
if (!specifier) {
|
|
53630
53555
|
specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
53631
53556
|
}
|
|
53632
|
-
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.
|
|
53557
|
+
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
|
|
53633
53558
|
const oldSpecifier = specifier;
|
|
53634
53559
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
53635
53560
|
const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
53636
53561
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
53637
|
-
if (specifier.
|
|
53562
|
+
if (specifier.includes("/node_modules/")) {
|
|
53638
53563
|
specifier = oldSpecifier;
|
|
53639
53564
|
} else {
|
|
53640
53565
|
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
@@ -54197,6 +54122,7 @@ function createTypeChecker(host) {
|
|
|
54197
54122
|
}
|
|
54198
54123
|
}
|
|
54199
54124
|
function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
|
|
54125
|
+
var _a;
|
|
54200
54126
|
const serializePropertySymbolForClass = makeSerializePropertySymbol(
|
|
54201
54127
|
factory.createPropertyDeclaration,
|
|
54202
54128
|
174 /* MethodDeclaration */,
|
|
@@ -54218,12 +54144,15 @@ function createTypeChecker(host) {
|
|
|
54218
54144
|
...oldcontext,
|
|
54219
54145
|
usedSymbolNames: new Set(oldcontext.usedSymbolNames),
|
|
54220
54146
|
remappedSymbolNames: /* @__PURE__ */ new Map(),
|
|
54147
|
+
remappedSymbolReferences: new Map((_a = oldcontext.remappedSymbolReferences) == null ? void 0 : _a.entries()),
|
|
54221
54148
|
tracker: void 0
|
|
54222
54149
|
};
|
|
54223
54150
|
const tracker = {
|
|
54224
54151
|
...oldcontext.tracker.inner,
|
|
54225
54152
|
trackSymbol: (sym, decl, meaning) => {
|
|
54226
|
-
var
|
|
54153
|
+
var _a2, _b;
|
|
54154
|
+
if ((_a2 = context.remappedSymbolNames) == null ? void 0 : _a2.has(getSymbolId(sym)))
|
|
54155
|
+
return false;
|
|
54227
54156
|
const accessibleResult = isSymbolAccessible(
|
|
54228
54157
|
sym,
|
|
54229
54158
|
decl,
|
|
@@ -54240,7 +54169,7 @@ function createTypeChecker(host) {
|
|
|
54240
54169
|
includePrivateSymbol(root);
|
|
54241
54170
|
}
|
|
54242
54171
|
}
|
|
54243
|
-
} else if ((
|
|
54172
|
+
} else if ((_b = oldcontext.tracker.inner) == null ? void 0 : _b.trackSymbol) {
|
|
54244
54173
|
return oldcontext.tracker.inner.trackSymbol(sym, decl, meaning);
|
|
54245
54174
|
}
|
|
54246
54175
|
return false;
|
|
@@ -54340,7 +54269,7 @@ function createTypeChecker(host) {
|
|
|
54340
54269
|
for (const group2 of groups) {
|
|
54341
54270
|
if (group2.length > 1) {
|
|
54342
54271
|
statements = [
|
|
54343
|
-
...filter(statements, (s) => group2.
|
|
54272
|
+
...filter(statements, (s) => !group2.includes(s)),
|
|
54344
54273
|
factory.createExportDeclaration(
|
|
54345
54274
|
/*modifiers*/
|
|
54346
54275
|
void 0,
|
|
@@ -54449,10 +54378,10 @@ function createTypeChecker(host) {
|
|
|
54449
54378
|
context = oldContext;
|
|
54450
54379
|
}
|
|
54451
54380
|
}
|
|
54452
|
-
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
|
|
54453
|
-
var
|
|
54454
|
-
const symbolName2 = unescapeLeadingUnderscores(
|
|
54455
|
-
const isDefault =
|
|
54381
|
+
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) {
|
|
54382
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
54383
|
+
const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName);
|
|
54384
|
+
const isDefault = escapedSymbolName === "default" /* Default */;
|
|
54456
54385
|
if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) {
|
|
54457
54386
|
context.encounteredError = true;
|
|
54458
54387
|
return;
|
|
@@ -54463,7 +54392,7 @@ function createTypeChecker(host) {
|
|
|
54463
54392
|
isPrivate = true;
|
|
54464
54393
|
}
|
|
54465
54394
|
const modifierFlags = (!isPrivate ? 1 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 1024 /* Default */ : 0);
|
|
54466
|
-
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) &&
|
|
54395
|
+
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */;
|
|
54467
54396
|
const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);
|
|
54468
54397
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
54469
54398
|
serializeAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags);
|
|
@@ -54471,7 +54400,7 @@ function createTypeChecker(host) {
|
|
|
54471
54400
|
if (symbol.flags & 524288 /* TypeAlias */) {
|
|
54472
54401
|
serializeTypeAlias(symbol, symbolName2, modifierFlags);
|
|
54473
54402
|
}
|
|
54474
|
-
if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) &&
|
|
54403
|
+
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) {
|
|
54475
54404
|
if (propertyAsAlias) {
|
|
54476
54405
|
const createdExport = serializeMaybeAliasAssignment(symbol);
|
|
54477
54406
|
if (createdExport) {
|
|
@@ -54481,17 +54410,24 @@ function createTypeChecker(host) {
|
|
|
54481
54410
|
} else {
|
|
54482
54411
|
const type = getTypeOfSymbol(symbol);
|
|
54483
54412
|
const localName = getInternalSymbolName(symbol, symbolName2);
|
|
54484
|
-
if (
|
|
54413
|
+
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))) {
|
|
54414
|
+
if (!context.remappedSymbolReferences) {
|
|
54415
|
+
context.remappedSymbolReferences = /* @__PURE__ */ new Map();
|
|
54416
|
+
}
|
|
54417
|
+
context.remappedSymbolReferences.set(getSymbolId(type.symbol), symbol);
|
|
54418
|
+
serializeSymbolWorker(type.symbol, isPrivate, propertyAsAlias, escapedSymbolName);
|
|
54419
|
+
context.remappedSymbolReferences.delete(getSymbolId(type.symbol));
|
|
54420
|
+
} else if (!(symbol.flags & 16 /* Function */) && isTypeRepresentableAsFunctionNamespaceMerge(type, symbol)) {
|
|
54485
54421
|
serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags);
|
|
54486
54422
|
} else {
|
|
54487
|
-
const flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? ((
|
|
54423
|
+
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 */;
|
|
54488
54424
|
const name = needsPostExportDefault || !(symbol.flags & 4 /* Property */) ? localName : getUnusedName(localName, symbol);
|
|
54489
54425
|
let textRange = symbol.declarations && find(symbol.declarations, (d) => isVariableDeclaration(d));
|
|
54490
54426
|
if (textRange && isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
|
|
54491
54427
|
textRange = textRange.parent.parent;
|
|
54492
54428
|
}
|
|
54493
|
-
const propertyAccessRequire = (
|
|
54494
|
-
if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((
|
|
54429
|
+
const propertyAccessRequire = (_e = symbol.declarations) == null ? void 0 : _e.find(isPropertyAccessExpression);
|
|
54430
|
+
if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_f = type.symbol) == null ? void 0 : _f.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) {
|
|
54495
54431
|
const alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right;
|
|
54496
54432
|
addResult(
|
|
54497
54433
|
factory.createExportDeclaration(
|
|
@@ -54646,11 +54582,11 @@ function createTypeChecker(host) {
|
|
|
54646
54582
|
results.push(node);
|
|
54647
54583
|
}
|
|
54648
54584
|
function serializeTypeAlias(symbol, symbolName2, modifierFlags) {
|
|
54649
|
-
var
|
|
54585
|
+
var _a2;
|
|
54650
54586
|
const aliasType = getDeclaredTypeOfTypeAlias(symbol);
|
|
54651
54587
|
const typeParams = getSymbolLinks(symbol).typeParameters;
|
|
54652
54588
|
const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
54653
|
-
const jsdocAliasDecl = (
|
|
54589
|
+
const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias);
|
|
54654
54590
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
54655
54591
|
const oldFlags = context.flags;
|
|
54656
54592
|
context.flags |= 8388608 /* InTypeAlias */;
|
|
@@ -54721,12 +54657,12 @@ function createTypeChecker(host) {
|
|
|
54721
54657
|
/*isTypeOnly*/
|
|
54722
54658
|
false,
|
|
54723
54659
|
factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => {
|
|
54724
|
-
var
|
|
54660
|
+
var _a2, _b;
|
|
54725
54661
|
const name = unescapeLeadingUnderscores(s.escapedName);
|
|
54726
54662
|
const localName2 = getInternalSymbolName(s, name);
|
|
54727
54663
|
const aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
|
|
54728
54664
|
if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some(s.declarations, (d) => getSourceFileOfNode(d) === containingFile))) {
|
|
54729
|
-
(_b = (
|
|
54665
|
+
(_b = (_a2 = context.tracker) == null ? void 0 : _a2.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a2, containingFile, symbol, s);
|
|
54730
54666
|
return void 0;
|
|
54731
54667
|
}
|
|
54732
54668
|
const target = aliasDecl && getTargetOfAliasDeclaration(
|
|
@@ -54892,8 +54828,8 @@ function createTypeChecker(host) {
|
|
|
54892
54828
|
return void 0;
|
|
54893
54829
|
}
|
|
54894
54830
|
function serializeAsClass(symbol, localName, modifierFlags) {
|
|
54895
|
-
var
|
|
54896
|
-
const originalDecl = (
|
|
54831
|
+
var _a2, _b;
|
|
54832
|
+
const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike);
|
|
54897
54833
|
const oldEnclosing = context.enclosingDeclaration;
|
|
54898
54834
|
context.enclosingDeclaration = originalDecl || oldEnclosing;
|
|
54899
54835
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
|
|
@@ -54989,7 +54925,7 @@ function createTypeChecker(host) {
|
|
|
54989
54925
|
});
|
|
54990
54926
|
}
|
|
54991
54927
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
54992
|
-
var
|
|
54928
|
+
var _a2, _b, _c, _d, _e;
|
|
54993
54929
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
54994
54930
|
if (!node)
|
|
54995
54931
|
return Debug.fail();
|
|
@@ -55009,7 +54945,7 @@ function createTypeChecker(host) {
|
|
|
55009
54945
|
includePrivateSymbol(target);
|
|
55010
54946
|
switch (node.kind) {
|
|
55011
54947
|
case 208 /* BindingElement */:
|
|
55012
|
-
if (((_b = (
|
|
54948
|
+
if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
|
|
55013
54949
|
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
55014
54950
|
const { propertyName } = node;
|
|
55015
54951
|
addResult(
|
|
@@ -55228,7 +55164,7 @@ function createTypeChecker(host) {
|
|
|
55228
55164
|
);
|
|
55229
55165
|
}
|
|
55230
55166
|
function serializeMaybeAliasAssignment(symbol) {
|
|
55231
|
-
var
|
|
55167
|
+
var _a2;
|
|
55232
55168
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
55233
55169
|
return false;
|
|
55234
55170
|
}
|
|
@@ -55311,7 +55247,7 @@ function createTypeChecker(host) {
|
|
|
55311
55247
|
void 0,
|
|
55312
55248
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
55313
55249
|
)
|
|
55314
|
-
], ((
|
|
55250
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
55315
55251
|
);
|
|
55316
55252
|
addResult(
|
|
55317
55253
|
statement,
|
|
@@ -55341,7 +55277,7 @@ function createTypeChecker(host) {
|
|
|
55341
55277
|
}
|
|
55342
55278
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
55343
55279
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
55344
|
-
var
|
|
55280
|
+
var _a2, _b, _c, _d, _e;
|
|
55345
55281
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
55346
55282
|
const isPrivate = !!(modifierFlags & 8 /* Private */);
|
|
55347
55283
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
@@ -55352,7 +55288,7 @@ function createTypeChecker(host) {
|
|
|
55352
55288
|
}
|
|
55353
55289
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
55354
55290
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
55355
|
-
const firstPropertyLikeDecl = (
|
|
55291
|
+
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
55356
55292
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
55357
55293
|
const result = [];
|
|
55358
55294
|
if (p.flags & 65536 /* SetAccessor */) {
|
|
@@ -55598,7 +55534,7 @@ function createTypeChecker(host) {
|
|
|
55598
55534
|
}
|
|
55599
55535
|
}
|
|
55600
55536
|
function getUnusedName(input, symbol) {
|
|
55601
|
-
var
|
|
55537
|
+
var _a2, _b;
|
|
55602
55538
|
const id = symbol ? getSymbolId(symbol) : void 0;
|
|
55603
55539
|
if (id) {
|
|
55604
55540
|
if (context.remappedSymbolNames.has(id)) {
|
|
@@ -55610,7 +55546,7 @@ function createTypeChecker(host) {
|
|
|
55610
55546
|
}
|
|
55611
55547
|
let i = 0;
|
|
55612
55548
|
const original = input;
|
|
55613
|
-
while ((
|
|
55549
|
+
while ((_a2 = context.usedSymbolNames) == null ? void 0 : _a2.has(input)) {
|
|
55614
55550
|
i++;
|
|
55615
55551
|
input = `${original}_${i}`;
|
|
55616
55552
|
}
|
|
@@ -55738,6 +55674,10 @@ function createTypeChecker(host) {
|
|
|
55738
55674
|
}
|
|
55739
55675
|
}
|
|
55740
55676
|
function getNameOfSymbolAsWritten(symbol, context) {
|
|
55677
|
+
var _a;
|
|
55678
|
+
if ((_a = context == null ? void 0 : context.remappedSymbolReferences) == null ? void 0 : _a.has(getSymbolId(symbol))) {
|
|
55679
|
+
symbol = context.remappedSymbolReferences.get(getSymbolId(symbol));
|
|
55680
|
+
}
|
|
55741
55681
|
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`
|
|
55742
55682
|
(!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
|
|
55743
55683
|
!symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
|
|
@@ -57790,7 +57730,7 @@ function createTypeChecker(host) {
|
|
|
57790
57730
|
if (!lateSymbol)
|
|
57791
57731
|
lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */));
|
|
57792
57732
|
const earlySymbol = earlySymbols && earlySymbols.get(memberName);
|
|
57793
|
-
if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
|
|
57733
|
+
if (!(parent2.flags & 32 /* Class */) && (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol)) {
|
|
57794
57734
|
const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
57795
57735
|
const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
|
|
57796
57736
|
forEach(declarations, (declaration) => error2(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name));
|
|
@@ -57901,7 +57841,13 @@ function createTypeChecker(host) {
|
|
|
57901
57841
|
const baseTypes = getBaseTypes(source);
|
|
57902
57842
|
if (baseTypes.length) {
|
|
57903
57843
|
if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
|
|
57904
|
-
|
|
57844
|
+
const symbolTable = createSymbolTable();
|
|
57845
|
+
for (const symbol of members.values()) {
|
|
57846
|
+
if (!(symbol.flags & 262144 /* TypeParameter */)) {
|
|
57847
|
+
symbolTable.set(symbol.escapedName, symbol);
|
|
57848
|
+
}
|
|
57849
|
+
}
|
|
57850
|
+
members = symbolTable;
|
|
57905
57851
|
}
|
|
57906
57852
|
setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
|
|
57907
57853
|
const thisArgument = lastOrUndefined(typeArguments);
|
|
@@ -65933,9 +65879,6 @@ function createTypeChecker(host) {
|
|
|
65933
65879
|
}
|
|
65934
65880
|
instantiateType(source2, reportUnreliableMapper);
|
|
65935
65881
|
}
|
|
65936
|
-
if (isTemplateLiteralTypeWithSinglePlaceholderAndNoExtraTexts(target2) && isTypeAssignableTo(source2, stringType) && isTypeAssignableTo(target2.types[0], stringType)) {
|
|
65937
|
-
return isRelatedTo(source2, target2.types[0], 3 /* Both */, reportErrors2);
|
|
65938
|
-
}
|
|
65939
65882
|
if (isTypeMatchedByTemplateLiteralType(source2, target2)) {
|
|
65940
65883
|
return -1 /* True */;
|
|
65941
65884
|
}
|
|
@@ -65986,9 +65929,6 @@ function createTypeChecker(host) {
|
|
|
65986
65929
|
}
|
|
65987
65930
|
} else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
|
|
65988
65931
|
if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
|
|
65989
|
-
if (isTemplateLiteralTypeWithSinglePlaceholderAndNoExtraTexts(source2) && isTypeAssignableTo(source2.types[0], stringType) && isTypeAssignableTo(target2, stringType)) {
|
|
65990
|
-
return isRelatedTo(source2.types[0], target2, 3 /* Both */, reportErrors2);
|
|
65991
|
-
}
|
|
65992
65932
|
const constraint = getBaseConstraintOfType(source2);
|
|
65993
65933
|
if (constraint && constraint !== source2 && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) {
|
|
65994
65934
|
return result2;
|
|
@@ -67306,6 +67246,9 @@ function createTypeChecker(host) {
|
|
|
67306
67246
|
function isArrayLikeType(type) {
|
|
67307
67247
|
return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);
|
|
67308
67248
|
}
|
|
67249
|
+
function isMutableArrayLikeType(type) {
|
|
67250
|
+
return isMutableArrayOrTuple(type) || !(type.flags & (1 /* Any */ | 98304 /* Nullable */)) && isTypeAssignableTo(type, anyArrayType);
|
|
67251
|
+
}
|
|
67309
67252
|
function getSingleBaseForNonAugmentingSubtype(type) {
|
|
67310
67253
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
67311
67254
|
return void 0;
|
|
@@ -67723,7 +67666,7 @@ function createTypeChecker(host) {
|
|
|
67723
67666
|
const param = declaration;
|
|
67724
67667
|
if (isIdentifier(param.name)) {
|
|
67725
67668
|
const originalKeywordKind = identifierToKeywordKind(param.name);
|
|
67726
|
-
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.
|
|
67669
|
+
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
|
|
67727
67670
|
param,
|
|
67728
67671
|
param.name.escapedText,
|
|
67729
67672
|
788968 /* Type */,
|
|
@@ -67809,7 +67752,12 @@ function createTypeChecker(host) {
|
|
|
67809
67752
|
callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
|
|
67810
67753
|
}
|
|
67811
67754
|
if (targetRestType) {
|
|
67812
|
-
callback(getRestTypeAtPosition(
|
|
67755
|
+
callback(getRestTypeAtPosition(
|
|
67756
|
+
source,
|
|
67757
|
+
paramCount,
|
|
67758
|
+
/*readonly*/
|
|
67759
|
+
isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType)
|
|
67760
|
+
), targetRestType);
|
|
67813
67761
|
}
|
|
67814
67762
|
}
|
|
67815
67763
|
function applyToReturnTypes(source, target, callback) {
|
|
@@ -68113,13 +68061,6 @@ function createTypeChecker(host) {
|
|
|
68113
68061
|
}
|
|
68114
68062
|
return false;
|
|
68115
68063
|
}
|
|
68116
|
-
function isTemplateLiteralTypeWithSinglePlaceholderAndNoExtraTexts(type) {
|
|
68117
|
-
if (!(type.flags & 134217728 /* TemplateLiteral */)) {
|
|
68118
|
-
return false;
|
|
68119
|
-
}
|
|
68120
|
-
const texts = type.texts;
|
|
68121
|
-
return texts.length === 2 && texts[0] === "" && texts[1] === "";
|
|
68122
|
-
}
|
|
68123
68064
|
function isValidTypeForTemplateLiteralPlaceholder(source, target) {
|
|
68124
68065
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
68125
68066
|
return true;
|
|
@@ -68139,8 +68080,9 @@ function createTypeChecker(host) {
|
|
|
68139
68080
|
false
|
|
68140
68081
|
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
68141
68082
|
}
|
|
68142
|
-
if (
|
|
68143
|
-
|
|
68083
|
+
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
68084
|
+
const texts = source.texts;
|
|
68085
|
+
return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target);
|
|
68144
68086
|
}
|
|
68145
68087
|
return isTypeAssignableTo(source, target);
|
|
68146
68088
|
}
|
|
@@ -68856,7 +68798,7 @@ function createTypeChecker(host) {
|
|
|
68856
68798
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
68857
68799
|
if (constraint) {
|
|
68858
68800
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
68859
|
-
if (!inferredType || inferredType ===
|
|
68801
|
+
if (!inferredType || inferredType === blockedStringType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
68860
68802
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
68861
68803
|
}
|
|
68862
68804
|
}
|
|
@@ -72801,7 +72743,7 @@ function createTypeChecker(host) {
|
|
|
72801
72743
|
elementTypes,
|
|
72802
72744
|
elementFlags,
|
|
72803
72745
|
/*readonly*/
|
|
72804
|
-
inConstContext
|
|
72746
|
+
inConstContext && !(contextualType && someType(contextualType, isMutableArrayLikeType))
|
|
72805
72747
|
));
|
|
72806
72748
|
}
|
|
72807
72749
|
return createArrayLiteralType(createArrayType(
|
|
@@ -73117,7 +73059,7 @@ function createTypeChecker(host) {
|
|
|
73117
73059
|
return getJsxElementTypeAt(node) || anyType;
|
|
73118
73060
|
}
|
|
73119
73061
|
function isHyphenatedJsxName(name) {
|
|
73120
|
-
return
|
|
73062
|
+
return name.includes("-");
|
|
73121
73063
|
}
|
|
73122
73064
|
function isJsxIntrinsicTagName(tagName) {
|
|
73123
73065
|
return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
|
|
@@ -74039,7 +73981,7 @@ function createTypeChecker(host) {
|
|
|
74039
73981
|
apparentType,
|
|
74040
73982
|
right.escapedText,
|
|
74041
73983
|
/*skipObjectFunctionPropertyAugment*/
|
|
74042
|
-
|
|
73984
|
+
isConstEnumObjectType(apparentType),
|
|
74043
73985
|
/*includeTypeOnlyMembers*/
|
|
74044
73986
|
node.kind === 166 /* QualifiedName */
|
|
74045
73987
|
);
|
|
@@ -74822,7 +74764,7 @@ function createTypeChecker(host) {
|
|
|
74822
74764
|
names.push(arg.tupleNameSource);
|
|
74823
74765
|
}
|
|
74824
74766
|
}
|
|
74825
|
-
return createTupleType(types, flags, inConstContext, length(names) === length(types) ? names : void 0);
|
|
74767
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), length(names) === length(types) ? names : void 0);
|
|
74826
74768
|
}
|
|
74827
74769
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
74828
74770
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -76903,7 +76845,7 @@ function createTypeChecker(host) {
|
|
|
76903
76845
|
}
|
|
76904
76846
|
return void 0;
|
|
76905
76847
|
}
|
|
76906
|
-
function getRestTypeAtPosition(source, pos) {
|
|
76848
|
+
function getRestTypeAtPosition(source, pos, readonly) {
|
|
76907
76849
|
const parameterCount = getParameterCount(source);
|
|
76908
76850
|
const minArgumentCount = getMinArgumentCount(source);
|
|
76909
76851
|
const restType = getEffectiveRestType(source);
|
|
@@ -76926,13 +76868,7 @@ function createTypeChecker(host) {
|
|
|
76926
76868
|
names.push(name);
|
|
76927
76869
|
}
|
|
76928
76870
|
}
|
|
76929
|
-
return createTupleType(
|
|
76930
|
-
types,
|
|
76931
|
-
flags,
|
|
76932
|
-
/*readonly*/
|
|
76933
|
-
false,
|
|
76934
|
-
length(names) === length(types) ? names : void 0
|
|
76935
|
-
);
|
|
76871
|
+
return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
|
|
76936
76872
|
}
|
|
76937
76873
|
function getParameterCount(signature) {
|
|
76938
76874
|
const length2 = signature.parameters.length;
|
|
@@ -77012,18 +76948,16 @@ function createTypeChecker(host) {
|
|
|
77012
76948
|
const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
77013
76949
|
for (let i = 0; i < len; i++) {
|
|
77014
76950
|
const declaration = signature.parameters[i].valueDeclaration;
|
|
77015
|
-
|
|
77016
|
-
|
|
77017
|
-
|
|
77018
|
-
|
|
77019
|
-
|
|
77020
|
-
|
|
77021
|
-
|
|
77022
|
-
|
|
77023
|
-
|
|
77024
|
-
|
|
77025
|
-
inferTypes(inferenceContext.inferences, source, target);
|
|
77026
|
-
}
|
|
76951
|
+
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
76952
|
+
if (typeNode) {
|
|
76953
|
+
const source = addOptionality(
|
|
76954
|
+
getTypeFromTypeNode(typeNode),
|
|
76955
|
+
/*isProperty*/
|
|
76956
|
+
false,
|
|
76957
|
+
isOptionalDeclaration(declaration)
|
|
76958
|
+
);
|
|
76959
|
+
const target = getTypeAtPosition(context, i);
|
|
76960
|
+
inferTypes(inferenceContext.inferences, source, target);
|
|
77027
76961
|
}
|
|
77028
76962
|
}
|
|
77029
76963
|
}
|
|
@@ -79455,7 +79389,7 @@ function createTypeChecker(host) {
|
|
|
79455
79389
|
return nullWideningType;
|
|
79456
79390
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
79457
79391
|
case 11 /* StringLiteral */:
|
|
79458
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
79392
|
+
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
79459
79393
|
case 9 /* NumericLiteral */: {
|
|
79460
79394
|
checkGrammarNumericLiteral(node);
|
|
79461
79395
|
const value = +node.text;
|
|
@@ -79804,7 +79738,7 @@ function createTypeChecker(host) {
|
|
|
79804
79738
|
const isPrivate = isPrivateIdentifier(name);
|
|
79805
79739
|
const privateStaticFlags = isPrivate && isStaticMember ? 16 /* PrivateStatic */ : 0;
|
|
79806
79740
|
const names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames;
|
|
79807
|
-
const memberName = name &&
|
|
79741
|
+
const memberName = name && getEffectivePropertyNameForPropertyNameNode(name);
|
|
79808
79742
|
if (memberName) {
|
|
79809
79743
|
switch (member.kind) {
|
|
79810
79744
|
case 177 /* GetAccessor */:
|
|
@@ -79851,7 +79785,7 @@ function createTypeChecker(host) {
|
|
|
79851
79785
|
const memberNameNode = member.name;
|
|
79852
79786
|
const isStaticMember = isStatic(member);
|
|
79853
79787
|
if (isStaticMember && memberNameNode) {
|
|
79854
|
-
const memberName =
|
|
79788
|
+
const memberName = getEffectivePropertyNameForPropertyNameNode(memberNameNode);
|
|
79855
79789
|
switch (memberName) {
|
|
79856
79790
|
case "name":
|
|
79857
79791
|
case "length":
|
|
@@ -88280,7 +88214,7 @@ function createTypeChecker(host) {
|
|
|
88280
88214
|
return false;
|
|
88281
88215
|
}
|
|
88282
88216
|
function checkGrammarNumericLiteral(node) {
|
|
88283
|
-
const isFractional = getTextOfNode(node).
|
|
88217
|
+
const isFractional = getTextOfNode(node).includes(".");
|
|
88284
88218
|
const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
|
|
88285
88219
|
if (isFractional || isScientific) {
|
|
88286
88220
|
return;
|
|
@@ -90202,7 +90136,7 @@ function tryGetSourceMappingURL(lineInfo) {
|
|
|
90202
90136
|
const line = lineInfo.getLineText(index);
|
|
90203
90137
|
const comment = sourceMapCommentRegExp.exec(line);
|
|
90204
90138
|
if (comment) {
|
|
90205
|
-
return
|
|
90139
|
+
return comment[1].trimEnd();
|
|
90206
90140
|
} else if (!line.match(whitespaceOrMapCommentRegExp)) {
|
|
90207
90141
|
break;
|
|
90208
90142
|
}
|
|
@@ -111426,7 +111360,7 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
111426
111360
|
}
|
|
111427
111361
|
function hasInternalAnnotation(range, currentSourceFile) {
|
|
111428
111362
|
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
111429
|
-
return
|
|
111363
|
+
return comment.includes("@internal");
|
|
111430
111364
|
}
|
|
111431
111365
|
function isInternalDeclaration(node, currentSourceFile) {
|
|
111432
111366
|
const parseTreeNode = getParseTreeNode(node);
|
|
@@ -111880,6 +111814,9 @@ function transformDeclarations(context) {
|
|
|
111880
111814
|
if (elem.kind === 232 /* OmittedExpression */) {
|
|
111881
111815
|
return elem;
|
|
111882
111816
|
}
|
|
111817
|
+
if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
|
|
111818
|
+
checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
|
|
111819
|
+
}
|
|
111883
111820
|
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
|
111884
111821
|
return factory2.updateBindingElement(
|
|
111885
111822
|
elem,
|
|
@@ -115916,7 +115853,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115916
115853
|
/*jsxAttributeEscape*/
|
|
115917
115854
|
false
|
|
115918
115855
|
);
|
|
115919
|
-
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !
|
|
115856
|
+
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
|
|
115920
115857
|
} else if (isAccessExpression(expression)) {
|
|
115921
115858
|
const constantValue = getConstantValue(expression);
|
|
115922
115859
|
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
@@ -119854,17 +119791,17 @@ function formatCodeSpan(file, start2, length2, indent3, squiggleColor, host) {
|
|
|
119854
119791
|
for (let i = firstLine; i <= lastLine; i++) {
|
|
119855
119792
|
context += host.getNewLine();
|
|
119856
119793
|
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
|
|
119857
|
-
context += indent3 + formatColorAndReset(
|
|
119794
|
+
context += indent3 + formatColorAndReset(ellipsis.padStart(gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
|
|
119858
119795
|
i = lastLine - 1;
|
|
119859
119796
|
}
|
|
119860
119797
|
const lineStart = getPositionOfLineAndCharacter(file, i, 0);
|
|
119861
119798
|
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
119862
119799
|
let lineContent = file.text.slice(lineStart, lineEnd);
|
|
119863
|
-
lineContent =
|
|
119800
|
+
lineContent = lineContent.trimEnd();
|
|
119864
119801
|
lineContent = lineContent.replace(/\t/g, " ");
|
|
119865
|
-
context += indent3 + formatColorAndReset(
|
|
119802
|
+
context += indent3 + formatColorAndReset((i + 1 + "").padStart(gutterWidth), gutterStyleSequence) + gutterSeparator;
|
|
119866
119803
|
context += lineContent + host.getNewLine();
|
|
119867
|
-
context += indent3 + formatColorAndReset(
|
|
119804
|
+
context += indent3 + formatColorAndReset("".padStart(gutterWidth), gutterStyleSequence) + gutterSeparator;
|
|
119868
119805
|
context += squiggleColor;
|
|
119869
119806
|
if (i === firstLine) {
|
|
119870
119807
|
const lastCharForLine = i === lastLine ? lastLineChar : void 0;
|
|
@@ -120803,7 +120740,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120803
120740
|
const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
120804
120741
|
if (resultFromDts)
|
|
120805
120742
|
return resultFromDts;
|
|
120806
|
-
if (!host.realpath || !options.preserveSymlinks || !
|
|
120743
|
+
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
|
|
120807
120744
|
return void 0;
|
|
120808
120745
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
|
120809
120746
|
return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
|
|
@@ -122061,7 +121998,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122061
121998
|
const path = toPath3(fileName);
|
|
122062
121999
|
if (useSourceOfProjectReferenceRedirect) {
|
|
122063
122000
|
let source = getSourceOfProjectReferenceRedirect(path);
|
|
122064
|
-
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) &&
|
|
122001
|
+
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
|
122065
122002
|
const realPath2 = toPath3(host.realpath(fileName));
|
|
122066
122003
|
if (realPath2 !== path)
|
|
122067
122004
|
source = getSourceOfProjectReferenceRedirect(realPath2);
|
|
@@ -123421,7 +123358,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
123421
123358
|
var _a;
|
|
123422
123359
|
if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
|
|
123423
123360
|
return;
|
|
123424
|
-
if (!originalRealpath || !
|
|
123361
|
+
if (!originalRealpath || !directory.includes(nodeModulesPathPart))
|
|
123425
123362
|
return;
|
|
123426
123363
|
const symlinkCache = host.getSymlinkCache();
|
|
123427
123364
|
const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
|
|
@@ -123449,7 +123386,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
123449
123386
|
if (!symlinkedDirectories)
|
|
123450
123387
|
return false;
|
|
123451
123388
|
const fileOrDirectoryPath = host.toPath(fileOrDirectory);
|
|
123452
|
-
if (!
|
|
123389
|
+
if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
|
|
123453
123390
|
return false;
|
|
123454
123391
|
if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
|
|
123455
123392
|
return true;
|
|
@@ -125339,7 +125276,7 @@ function removeIgnoredPath(path) {
|
|
|
125339
125276
|
if (endsWith(path, "/node_modules/.staging")) {
|
|
125340
125277
|
return removeSuffix(path, "/.staging");
|
|
125341
125278
|
}
|
|
125342
|
-
return some(ignoredPaths, (searchPath) =>
|
|
125279
|
+
return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
|
|
125343
125280
|
}
|
|
125344
125281
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
125345
125282
|
if (length2 <= 1)
|
|
@@ -130079,7 +130016,7 @@ var Arguments;
|
|
|
130079
130016
|
Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
|
|
130080
130017
|
})(Arguments || (Arguments = {}));
|
|
130081
130018
|
function hasArgument(argumentName) {
|
|
130082
|
-
return sys.args.
|
|
130019
|
+
return sys.args.includes(argumentName);
|
|
130083
130020
|
}
|
|
130084
130021
|
function findArgument(argumentName) {
|
|
130085
130022
|
const index = sys.args.indexOf(argumentName);
|
|
@@ -130087,7 +130024,7 @@ function findArgument(argumentName) {
|
|
|
130087
130024
|
}
|
|
130088
130025
|
function nowString() {
|
|
130089
130026
|
const d = /* @__PURE__ */ new Date();
|
|
130090
|
-
return `${
|
|
130027
|
+
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")}`;
|
|
130091
130028
|
}
|
|
130092
130029
|
|
|
130093
130030
|
// src/services/types.ts
|
|
@@ -132902,7 +132839,7 @@ function createPackageJsonImportFilter(fromFile, preferences, host) {
|
|
|
132902
132839
|
return false;
|
|
132903
132840
|
}
|
|
132904
132841
|
function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) {
|
|
132905
|
-
if (!
|
|
132842
|
+
if (!importedFileName.includes("node_modules")) {
|
|
132906
132843
|
return void 0;
|
|
132907
132844
|
}
|
|
132908
132845
|
const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName(
|
|
@@ -133476,7 +133413,7 @@ function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) {
|
|
|
133476
133413
|
var _a;
|
|
133477
133414
|
const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName)));
|
|
133478
133415
|
for (const ambient of checker.getAmbientModules()) {
|
|
133479
|
-
if (!
|
|
133416
|
+
if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
|
|
133480
133417
|
cb(
|
|
133481
133418
|
ambient,
|
|
133482
133419
|
/*sourceFile*/
|
|
@@ -142374,7 +142311,7 @@ function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFi
|
|
|
142374
142311
|
return symbolId;
|
|
142375
142312
|
}
|
|
142376
142313
|
function checkForUsedDeclarations(node) {
|
|
142377
|
-
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.
|
|
142314
|
+
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) {
|
|
142378
142315
|
return;
|
|
142379
142316
|
}
|
|
142380
142317
|
const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node);
|
|
@@ -144732,7 +144669,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
144732
144669
|
return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */;
|
|
144733
144670
|
}
|
|
144734
144671
|
function isNodeModulesFile(path) {
|
|
144735
|
-
return
|
|
144672
|
+
return path.includes("/node_modules/");
|
|
144736
144673
|
}
|
|
144737
144674
|
}
|
|
144738
144675
|
function getRenameInfo2(fileName, position, preferences) {
|
|
@@ -153713,7 +153650,7 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program
|
|
|
153713
153650
|
}
|
|
153714
153651
|
}
|
|
153715
153652
|
function isCallbackLike(checker, sourceFile, name) {
|
|
153716
|
-
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.
|
|
153653
|
+
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference));
|
|
153717
153654
|
}
|
|
153718
153655
|
function isLastParameter(func, parameter, isFixAll) {
|
|
153719
153656
|
const parameters = func.parameters;
|
|
@@ -161094,7 +161031,7 @@ function directoryResult(name) {
|
|
|
161094
161031
|
function addReplacementSpans(text, textStart, names) {
|
|
161095
161032
|
const span = getDirectoryFragmentTextSpan(text, textStart);
|
|
161096
161033
|
const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length);
|
|
161097
|
-
return names.map(({ name, kind, extension }) =>
|
|
161034
|
+
return names.map(({ name, kind, extension }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
|
|
161098
161035
|
}
|
|
161099
161036
|
function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
|
|
161100
161037
|
return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences));
|
|
@@ -161420,7 +161357,7 @@ function getPatternFromFirstMatchingCondition(target, conditions) {
|
|
|
161420
161357
|
}
|
|
161421
161358
|
if (target && typeof target === "object" && !isArray(target)) {
|
|
161422
161359
|
for (const condition in target) {
|
|
161423
|
-
if (condition === "default" || conditions.
|
|
161360
|
+
if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) {
|
|
161424
161361
|
const pattern = target[condition];
|
|
161425
161362
|
return getPatternFromFirstMatchingCondition(pattern, conditions);
|
|
161426
161363
|
}
|
|
@@ -161432,7 +161369,7 @@ function getFragmentDirectory(fragment) {
|
|
|
161432
161369
|
}
|
|
161433
161370
|
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
|
|
161434
161371
|
if (!endsWith(path, "*")) {
|
|
161435
|
-
return !
|
|
161372
|
+
return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
|
|
161436
161373
|
}
|
|
161437
161374
|
const pathPrefix = path.slice(0, path.length - 1);
|
|
161438
161375
|
const remainingFragment = tryRemovePrefix(fragment, pathPrefix);
|
|
@@ -161502,7 +161439,7 @@ function removeLeadingDirectorySeparator(path) {
|
|
|
161502
161439
|
}
|
|
161503
161440
|
function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
161504
161441
|
const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
|
|
161505
|
-
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.
|
|
161442
|
+
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && !moduleName.includes("*"));
|
|
161506
161443
|
if (fragmentDirectory !== void 0) {
|
|
161507
161444
|
const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory);
|
|
161508
161445
|
return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator));
|
|
@@ -161618,7 +161555,7 @@ function isPathRelativeToScript(path) {
|
|
|
161618
161555
|
var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/;
|
|
161619
161556
|
var nodeModulesDependencyKeys = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
161620
161557
|
function containsSlash(fragment) {
|
|
161621
|
-
return
|
|
161558
|
+
return fragment.includes(directorySeparator);
|
|
161622
161559
|
}
|
|
161623
161560
|
function isRequireCallArgument(node) {
|
|
161624
161561
|
return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require";
|
|
@@ -166079,11 +166016,11 @@ function addRegionOutliningSpans(sourceFile, out) {
|
|
|
166079
166016
|
}
|
|
166080
166017
|
var regionDelimiterRegExp = /^#(end)?region(?:\s+(.*))?(?:\r)?$/;
|
|
166081
166018
|
function isRegionDelimiter(lineText) {
|
|
166082
|
-
lineText =
|
|
166019
|
+
lineText = lineText.trimStart();
|
|
166083
166020
|
if (!startsWith(lineText, "//")) {
|
|
166084
166021
|
return null;
|
|
166085
166022
|
}
|
|
166086
|
-
lineText =
|
|
166023
|
+
lineText = lineText.slice(2).trim();
|
|
166087
166024
|
return regionDelimiterRegExp.exec(lineText);
|
|
166088
166025
|
}
|
|
166089
166026
|
function addOutliningForLeadingCommentsForPos(pos, sourceFile, cancellationToken, out) {
|
|
@@ -170313,7 +170250,7 @@ function isSemicolonInsertionContext(context) {
|
|
|
170313
170250
|
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
|
|
170314
170251
|
}
|
|
170315
170252
|
function isNotPropertyAccessOnIntegerLiteral(context) {
|
|
170316
|
-
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().
|
|
170253
|
+
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().includes(".");
|
|
170317
170254
|
}
|
|
170318
170255
|
|
|
170319
170256
|
// src/services/formatting/rulesMap.ts
|
|
@@ -171485,7 +171422,7 @@ var SmartIndenter;
|
|
|
171485
171422
|
}
|
|
171486
171423
|
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
|
|
171487
171424
|
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
|
|
171488
|
-
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].
|
|
171425
|
+
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind);
|
|
171489
171426
|
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
|
|
171490
171427
|
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
|
|
171491
171428
|
}
|
|
@@ -173878,8 +173815,6 @@ __export(ts_exports2, {
|
|
|
173878
173815
|
outFile: () => outFile,
|
|
173879
173816
|
packageIdToPackageName: () => packageIdToPackageName,
|
|
173880
173817
|
packageIdToString: () => packageIdToString,
|
|
173881
|
-
padLeft: () => padLeft,
|
|
173882
|
-
padRight: () => padRight,
|
|
173883
173818
|
paramHelper: () => paramHelper,
|
|
173884
173819
|
parameterIsThisKeyword: () => parameterIsThisKeyword,
|
|
173885
173820
|
parameterNamePart: () => parameterNamePart,
|
|
@@ -174086,7 +174021,6 @@ __export(ts_exports2, {
|
|
|
174086
174021
|
startsWithDirectory: () => startsWithDirectory,
|
|
174087
174022
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
174088
174023
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
174089
|
-
stringContains: () => stringContains,
|
|
174090
174024
|
stringContainsAt: () => stringContainsAt,
|
|
174091
174025
|
stringToToken: () => stringToToken,
|
|
174092
174026
|
stripQuotes: () => stripQuotes,
|
|
@@ -174173,9 +174107,6 @@ __export(ts_exports2, {
|
|
|
174173
174107
|
transpile: () => transpile,
|
|
174174
174108
|
transpileModule: () => transpileModule,
|
|
174175
174109
|
transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions,
|
|
174176
|
-
trimString: () => trimString,
|
|
174177
|
-
trimStringEnd: () => trimStringEnd,
|
|
174178
|
-
trimStringStart: () => trimStringStart,
|
|
174179
174110
|
tryAddToSet: () => tryAddToSet,
|
|
174180
174111
|
tryAndIgnoreErrors: () => tryAndIgnoreErrors,
|
|
174181
174112
|
tryCast: () => tryCast,
|
|
@@ -175494,7 +175425,7 @@ var TextStorage = class {
|
|
|
175494
175425
|
}
|
|
175495
175426
|
};
|
|
175496
175427
|
function isDynamicFileName(fileName) {
|
|
175497
|
-
return fileName[0] === "^" || (
|
|
175428
|
+
return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator);
|
|
175498
175429
|
}
|
|
175499
175430
|
var ScriptInfo = class {
|
|
175500
175431
|
constructor(host, fileName, scriptKind, hasMixedContent, path, initialVersion) {
|
|
@@ -176886,7 +176817,7 @@ var Project3 = class _Project {
|
|
|
176886
176817
|
}
|
|
176887
176818
|
removeExistingTypings(include) {
|
|
176888
176819
|
const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
|
|
176889
|
-
return include.filter((i) => existing.
|
|
176820
|
+
return include.filter((i) => !existing.includes(i));
|
|
176890
176821
|
}
|
|
176891
176822
|
updateGraphWorker() {
|
|
176892
176823
|
var _a, _b;
|
|
@@ -181079,7 +181010,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181079
181010
|
this.logger.info(`Excluding files based on rule ${name} matching file '${root}'`);
|
|
181080
181011
|
if (rule2.types) {
|
|
181081
181012
|
for (const type of rule2.types) {
|
|
181082
|
-
if (typeAcqInclude.
|
|
181013
|
+
if (!typeAcqInclude.includes(type)) {
|
|
181083
181014
|
typeAcqInclude.push(type);
|
|
181084
181015
|
}
|
|
181085
181016
|
}
|
|
@@ -181098,13 +181029,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181098
181029
|
return groupNumberOrString;
|
|
181099
181030
|
}).join("");
|
|
181100
181031
|
});
|
|
181101
|
-
if (excludeRules.
|
|
181032
|
+
if (!excludeRules.includes(processedRule)) {
|
|
181102
181033
|
excludeRules.push(processedRule);
|
|
181103
181034
|
}
|
|
181104
181035
|
}
|
|
181105
181036
|
} else {
|
|
181106
181037
|
const escaped = _ProjectService.escapeFilenameForRegex(root);
|
|
181107
|
-
if (excludeRules.
|
|
181038
|
+
if (!excludeRules.includes(escaped)) {
|
|
181108
181039
|
excludeRules.push(escaped);
|
|
181109
181040
|
}
|
|
181110
181041
|
}
|
|
@@ -181128,7 +181059,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181128
181059
|
this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`);
|
|
181129
181060
|
excludedFiles.push(normalizedNames[i]);
|
|
181130
181061
|
exclude = true;
|
|
181131
|
-
if (typeAcqInclude.
|
|
181062
|
+
if (!typeAcqInclude.includes(typeName)) {
|
|
181132
181063
|
typeAcqInclude.push(typeName);
|
|
181133
181064
|
}
|
|
181134
181065
|
}
|
|
@@ -184599,7 +184530,7 @@ ${e.message}`;
|
|
|
184599
184530
|
if (languageServiceDisabled) {
|
|
184600
184531
|
return;
|
|
184601
184532
|
}
|
|
184602
|
-
const fileNamesInProject = fileNames.filter((value) => !
|
|
184533
|
+
const fileNamesInProject = fileNames.filter((value) => !value.includes("lib.d.ts"));
|
|
184603
184534
|
if (fileNamesInProject.length === 0) {
|
|
184604
184535
|
return;
|
|
184605
184536
|
}
|
|
@@ -188441,8 +188372,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188441
188372
|
outFile,
|
|
188442
188373
|
packageIdToPackageName,
|
|
188443
188374
|
packageIdToString,
|
|
188444
|
-
padLeft,
|
|
188445
|
-
padRight,
|
|
188446
188375
|
paramHelper,
|
|
188447
188376
|
parameterIsThisKeyword,
|
|
188448
188377
|
parameterNamePart,
|
|
@@ -188649,7 +188578,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188649
188578
|
startsWithDirectory,
|
|
188650
188579
|
startsWithUnderscore,
|
|
188651
188580
|
startsWithUseStrict,
|
|
188652
|
-
stringContains,
|
|
188653
188581
|
stringContainsAt,
|
|
188654
188582
|
stringToToken,
|
|
188655
188583
|
stripQuotes,
|
|
@@ -188736,9 +188664,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188736
188664
|
transpile,
|
|
188737
188665
|
transpileModule,
|
|
188738
188666
|
transpileOptionValueCompilerOptions,
|
|
188739
|
-
trimString,
|
|
188740
|
-
trimStringEnd,
|
|
188741
|
-
trimStringStart,
|
|
188742
188667
|
tryAddToSet,
|
|
188743
188668
|
tryAndIgnoreErrors,
|
|
188744
188669
|
tryCast,
|