typescript 5.3.0-dev.20230824 → 5.3.0-dev.20230826
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cancellationToken.js +1 -1
- package/lib/tsc.js +93 -83
- package/lib/tsserver.js +114 -107
- package/lib/typescript.js +114 -106
- package/lib/typingsInstaller.js +22 -23
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -2157,7 +2157,6 @@ __export(server_exports, {
|
|
|
2157
2157
|
startsWithDirectory: () => startsWithDirectory,
|
|
2158
2158
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
2159
2159
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
2160
|
-
stringContains: () => stringContains,
|
|
2161
2160
|
stringContainsAt: () => stringContainsAt,
|
|
2162
2161
|
stringToToken: () => stringToToken,
|
|
2163
2162
|
stripQuotes: () => stripQuotes,
|
|
@@ -2333,7 +2332,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2333
2332
|
|
|
2334
2333
|
// src/compiler/corePublic.ts
|
|
2335
2334
|
var versionMajorMinor = "5.3";
|
|
2336
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2335
|
+
var version = `${versionMajorMinor}.0-dev.20230826`;
|
|
2337
2336
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2338
2337
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2339
2338
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3779,9 +3778,6 @@ function removeSuffix(str, suffix) {
|
|
|
3779
3778
|
function tryRemoveSuffix(str, suffix) {
|
|
3780
3779
|
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0;
|
|
3781
3780
|
}
|
|
3782
|
-
function stringContains(str, substring) {
|
|
3783
|
-
return str.indexOf(substring) !== -1;
|
|
3784
|
-
}
|
|
3785
3781
|
function removeMinAndVersionNumbers(fileName) {
|
|
3786
3782
|
let end = fileName.length;
|
|
3787
3783
|
for (let pos = end - 1; pos > 0; pos--) {
|
|
@@ -8025,11 +8021,11 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
8025
8021
|
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
8026
8022
|
}
|
|
8027
8023
|
function isInPath(path, searchPath) {
|
|
8028
|
-
if (
|
|
8024
|
+
if (path.includes(searchPath))
|
|
8029
8025
|
return true;
|
|
8030
8026
|
if (useCaseSensitiveFileNames2)
|
|
8031
8027
|
return false;
|
|
8032
|
-
return
|
|
8028
|
+
return toCanonicalFilePath(path).includes(searchPath);
|
|
8033
8029
|
}
|
|
8034
8030
|
}
|
|
8035
8031
|
var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => {
|
|
@@ -8877,7 +8873,7 @@ function pathIsBareSpecifier(path) {
|
|
|
8877
8873
|
return !pathIsAbsolute(path) && !pathIsRelative(path);
|
|
8878
8874
|
}
|
|
8879
8875
|
function hasExtension(fileName) {
|
|
8880
|
-
return
|
|
8876
|
+
return getBaseFileName(fileName).includes(".");
|
|
8881
8877
|
}
|
|
8882
8878
|
function fileExtensionIs(path, extension) {
|
|
8883
8879
|
return path.length > extension.length && endsWith(path, extension);
|
|
@@ -9022,7 +9018,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
|
|
|
9022
9018
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
9023
9019
|
}
|
|
9024
9020
|
function normalizeSlashes(path) {
|
|
9025
|
-
return path.
|
|
9021
|
+
return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
|
|
9026
9022
|
}
|
|
9027
9023
|
function reducePathComponents(components) {
|
|
9028
9024
|
if (!some(components))
|
|
@@ -15244,7 +15240,7 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
15244
15240
|
void 0,
|
|
15245
15241
|
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
15242
|
node10Result,
|
|
15247
|
-
node10Result.
|
|
15243
|
+
node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
|
|
15248
15244
|
) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
|
|
15249
15245
|
/*details*/
|
|
15250
15246
|
void 0,
|
|
@@ -18753,7 +18749,7 @@ function isQuoteOrBacktick(charCode) {
|
|
|
18753
18749
|
}
|
|
18754
18750
|
function isIntrinsicJsxName(name) {
|
|
18755
18751
|
const ch = name.charCodeAt(0);
|
|
18756
|
-
return ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
18752
|
+
return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
|
|
18757
18753
|
}
|
|
18758
18754
|
var indentStrings = ["", " "];
|
|
18759
18755
|
function getIndentString(level) {
|
|
@@ -18767,7 +18763,7 @@ function getIndentSize() {
|
|
|
18767
18763
|
return indentStrings[1].length;
|
|
18768
18764
|
}
|
|
18769
18765
|
function isNightly() {
|
|
18770
|
-
return
|
|
18766
|
+
return version.includes("-dev") || version.includes("-insiders");
|
|
18771
18767
|
}
|
|
18772
18768
|
function createTextWriter(newLine) {
|
|
18773
18769
|
var output;
|
|
@@ -18957,7 +18953,7 @@ function getExternalModuleNameFromDeclaration(host, resolver, declaration) {
|
|
|
18957
18953
|
return void 0;
|
|
18958
18954
|
}
|
|
18959
18955
|
const specifier = getExternalModuleName(declaration);
|
|
18960
|
-
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).
|
|
18956
|
+
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
|
|
18961
18957
|
return void 0;
|
|
18962
18958
|
}
|
|
18963
18959
|
return getResolvedExternalModuleName(host, file);
|
|
@@ -20962,7 +20958,7 @@ function getSupportedExtensions(options, extraFileExtensions) {
|
|
|
20962
20958
|
const flatBuiltins = flatten(builtins);
|
|
20963
20959
|
const extensions = [
|
|
20964
20960
|
...builtins,
|
|
20965
|
-
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.
|
|
20961
|
+
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
|
|
20966
20962
|
];
|
|
20967
20963
|
return extensions;
|
|
20968
20964
|
}
|
|
@@ -21424,7 +21420,7 @@ function expressionResultIsUnused(node) {
|
|
|
21424
21420
|
}
|
|
21425
21421
|
}
|
|
21426
21422
|
function containsIgnoredPath(path) {
|
|
21427
|
-
return some(ignoredPaths, (p) =>
|
|
21423
|
+
return some(ignoredPaths, (p) => path.includes(p));
|
|
21428
21424
|
}
|
|
21429
21425
|
function getContainingNodeArray(node) {
|
|
21430
21426
|
if (!node.parent)
|
|
@@ -34369,7 +34365,9 @@ var Parser;
|
|
|
34369
34365
|
let dotDotDotToken;
|
|
34370
34366
|
let expression;
|
|
34371
34367
|
if (token() !== 20 /* CloseBraceToken */) {
|
|
34372
|
-
|
|
34368
|
+
if (!inExpressionContext) {
|
|
34369
|
+
dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
|
|
34370
|
+
}
|
|
34373
34371
|
expression = parseExpression();
|
|
34374
34372
|
}
|
|
34375
34373
|
if (inExpressionContext) {
|
|
@@ -37883,7 +37881,7 @@ var IncrementalParser;
|
|
|
37883
37881
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
37884
37882
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
37885
37883
|
function isDeclarationFileName(fileName) {
|
|
37886
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) &&
|
|
37884
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
|
|
37887
37885
|
}
|
|
37888
37886
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
37889
37887
|
if (!mode) {
|
|
@@ -39601,7 +39599,7 @@ function parseListTypeOption(opt, value = "", errors) {
|
|
|
39601
39599
|
if (startsWith(value, "-")) {
|
|
39602
39600
|
return void 0;
|
|
39603
39601
|
}
|
|
39604
|
-
if (opt.type === "listOrElement" && !
|
|
39602
|
+
if (opt.type === "listOrElement" && !value.includes(",")) {
|
|
39605
39603
|
return validateJsonOptionValue(opt, value, errors);
|
|
39606
39604
|
}
|
|
39607
39605
|
if (value === "") {
|
|
@@ -40647,7 +40645,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
|
|
|
40647
40645
|
var _a;
|
|
40648
40646
|
basePath = normalizeSlashes(basePath);
|
|
40649
40647
|
const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
|
|
40650
|
-
if (resolutionStack.
|
|
40648
|
+
if (resolutionStack.includes(resolvedPath)) {
|
|
40651
40649
|
errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
|
|
40652
40650
|
return { raw: json || convertToObject(sourceFile, errors) };
|
|
40653
40651
|
}
|
|
@@ -42479,7 +42477,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42479
42477
|
result = tryResolve(extensions, state);
|
|
42480
42478
|
}
|
|
42481
42479
|
let legacyResult;
|
|
42482
|
-
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.
|
|
42480
|
+
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")) {
|
|
42483
42481
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
42484
42482
|
const diagnosticState = {
|
|
42485
42483
|
...state,
|
|
@@ -42523,7 +42521,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42523
42521
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
42524
42522
|
}
|
|
42525
42523
|
if (!resolved2) {
|
|
42526
|
-
if (moduleName.
|
|
42524
|
+
if (moduleName.includes(":")) {
|
|
42527
42525
|
if (traceEnabled) {
|
|
42528
42526
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
42529
42527
|
}
|
|
@@ -42613,7 +42611,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
42613
42611
|
}
|
|
42614
42612
|
var nodeModulesPathPart = "/node_modules/";
|
|
42615
42613
|
function pathContainsNodeModules(path) {
|
|
42616
|
-
return
|
|
42614
|
+
return path.includes(nodeModulesPathPart);
|
|
42617
42615
|
}
|
|
42618
42616
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
42619
42617
|
const path = normalizePath(resolved);
|
|
@@ -42649,7 +42647,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
42649
42647
|
}
|
|
42650
42648
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
42651
42649
|
const filename = getBaseFileName(candidate);
|
|
42652
|
-
if (filename.
|
|
42650
|
+
if (!filename.includes(".")) {
|
|
42653
42651
|
return void 0;
|
|
42654
42652
|
}
|
|
42655
42653
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -42806,7 +42804,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42806
42804
|
function loadEntrypointsFromTargetExports(target) {
|
|
42807
42805
|
var _a, _b;
|
|
42808
42806
|
if (typeof target === "string" && startsWith(target, "./")) {
|
|
42809
|
-
if (target.
|
|
42807
|
+
if (target.includes("*") && state.host.readDirectory) {
|
|
42810
42808
|
if (target.indexOf("*") !== target.lastIndexOf("*")) {
|
|
42811
42809
|
return false;
|
|
42812
42810
|
}
|
|
@@ -42825,7 +42823,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42825
42823
|
});
|
|
42826
42824
|
} else {
|
|
42827
42825
|
const partsAfterFirst = getPathComponents(target).slice(2);
|
|
42828
|
-
if (partsAfterFirst.
|
|
42826
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
42829
42827
|
return false;
|
|
42830
42828
|
}
|
|
42831
42829
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
@@ -43193,7 +43191,7 @@ function comparePatternKeys(a, b) {
|
|
|
43193
43191
|
}
|
|
43194
43192
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
43195
43193
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
43196
|
-
if (!endsWith(moduleName, directorySeparator) && moduleName.
|
|
43194
|
+
if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
|
|
43197
43195
|
const target = lookupTable[moduleName];
|
|
43198
43196
|
return loadModuleFromTargetImportOrExport(
|
|
43199
43197
|
target,
|
|
@@ -43204,7 +43202,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
43204
43202
|
moduleName
|
|
43205
43203
|
);
|
|
43206
43204
|
}
|
|
43207
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
43205
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
|
|
43208
43206
|
for (const potentialTarget of expandingKeys) {
|
|
43209
43207
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
43210
43208
|
const target = lookupTable[potentialTarget];
|
|
@@ -43298,7 +43296,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43298
43296
|
}
|
|
43299
43297
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
43300
43298
|
const partsAfterFirst = parts.slice(1);
|
|
43301
|
-
if (partsAfterFirst.
|
|
43299
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
43302
43300
|
if (state.traceEnabled) {
|
|
43303
43301
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
43304
43302
|
}
|
|
@@ -43309,7 +43307,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43309
43307
|
}
|
|
43310
43308
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
43311
43309
|
const subpathParts = getPathComponents(subpath);
|
|
43312
|
-
if (subpathParts.
|
|
43310
|
+
if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
|
|
43313
43311
|
if (state.traceEnabled) {
|
|
43314
43312
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
43315
43313
|
}
|
|
@@ -43336,7 +43334,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43336
43334
|
if (!Array.isArray(target)) {
|
|
43337
43335
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
43338
43336
|
for (const condition of getOwnKeys(target)) {
|
|
43339
|
-
if (condition === "default" || state.conditions.
|
|
43337
|
+
if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
43340
43338
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
43341
43339
|
const subTarget = target[condition];
|
|
43342
43340
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -43397,7 +43395,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43397
43395
|
}
|
|
43398
43396
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
43399
43397
|
var _a, _b, _c, _d;
|
|
43400
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.
|
|
43398
|
+
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)) {
|
|
43401
43399
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
43402
43400
|
const commonSourceDirGuesses = [];
|
|
43403
43401
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -43471,7 +43469,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43471
43469
|
}
|
|
43472
43470
|
}
|
|
43473
43471
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
43474
|
-
if (conditions.
|
|
43472
|
+
if (!conditions.includes("types"))
|
|
43475
43473
|
return false;
|
|
43476
43474
|
if (!startsWith(key, "types@"))
|
|
43477
43475
|
return false;
|
|
@@ -43676,7 +43674,7 @@ function getPackageNameFromTypesPackageName(mangledName) {
|
|
|
43676
43674
|
return mangledName;
|
|
43677
43675
|
}
|
|
43678
43676
|
function unmangleScopedPackageName(typesPackageName) {
|
|
43679
|
-
return
|
|
43677
|
+
return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
43680
43678
|
}
|
|
43681
43679
|
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
43682
43680
|
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
@@ -47369,12 +47367,12 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
47369
47367
|
/*currentDirectory*/
|
|
47370
47368
|
void 0
|
|
47371
47369
|
);
|
|
47372
|
-
const mode2 = endsWith(k, "/") ? 1 /* Directory */ :
|
|
47370
|
+
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
47373
47371
|
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
|
|
47374
47372
|
});
|
|
47375
47373
|
} else {
|
|
47376
47374
|
for (const key of getOwnKeys(exports)) {
|
|
47377
|
-
if (key === "default" || conditions.
|
|
47375
|
+
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
47378
47376
|
const subTarget = exports[key];
|
|
47379
47377
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
47380
47378
|
if (result) {
|
|
@@ -47540,7 +47538,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
47540
47538
|
return fileName;
|
|
47541
47539
|
} else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
|
|
47542
47540
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
47543
|
-
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) &&
|
|
47541
|
+
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
|
|
47544
47542
|
return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
|
|
47545
47543
|
}
|
|
47546
47544
|
switch (allowedEndings[0]) {
|
|
@@ -47566,7 +47564,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
47566
47564
|
}
|
|
47567
47565
|
function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
|
|
47568
47566
|
const baseName = getBaseFileName(fileName);
|
|
47569
|
-
if (!endsWith(fileName, ".ts" /* Ts */) || !
|
|
47567
|
+
if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
|
|
47570
47568
|
return void 0;
|
|
47571
47569
|
const noExtension = removeExtension(fileName, ".ts" /* Ts */);
|
|
47572
47570
|
const ext = noExtension.substring(noExtension.lastIndexOf("."));
|
|
@@ -49126,6 +49124,9 @@ function createTypeChecker(host) {
|
|
|
49126
49124
|
const sourceFiles = host.getSourceFiles();
|
|
49127
49125
|
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
|
|
49128
49126
|
}
|
|
49127
|
+
if (!!(usage.flags & 16777216 /* JSDoc */) || isInTypeQuery(usage) || isInAmbientOrTypeNode(usage)) {
|
|
49128
|
+
return true;
|
|
49129
|
+
}
|
|
49129
49130
|
if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
|
|
49130
49131
|
if (declaration.kind === 208 /* BindingElement */) {
|
|
49131
49132
|
const errorBindingElement = getAncestor(usage, 208 /* BindingElement */);
|
|
@@ -49155,9 +49156,6 @@ function createTypeChecker(host) {
|
|
|
49155
49156
|
if (usage.kind === 277 /* ExportAssignment */ && usage.isExportEquals) {
|
|
49156
49157
|
return true;
|
|
49157
49158
|
}
|
|
49158
|
-
if (!!(usage.flags & 16777216 /* JSDoc */) || isInTypeQuery(usage) || isInAmbientOrTypeNode(usage)) {
|
|
49159
|
-
return true;
|
|
49160
|
-
}
|
|
49161
49159
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
49162
49160
|
if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
|
|
49163
49161
|
return !isPropertyImmediatelyReferencedWithinDeclaration(
|
|
@@ -53627,12 +53625,12 @@ function createTypeChecker(host) {
|
|
|
53627
53625
|
if (!specifier) {
|
|
53628
53626
|
specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
53629
53627
|
}
|
|
53630
|
-
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.
|
|
53628
|
+
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
|
|
53631
53629
|
const oldSpecifier = specifier;
|
|
53632
53630
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
53633
53631
|
const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
53634
53632
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
53635
|
-
if (specifier.
|
|
53633
|
+
if (specifier.includes("/node_modules/")) {
|
|
53636
53634
|
specifier = oldSpecifier;
|
|
53637
53635
|
} else {
|
|
53638
53636
|
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
@@ -54338,7 +54336,7 @@ function createTypeChecker(host) {
|
|
|
54338
54336
|
for (const group2 of groups) {
|
|
54339
54337
|
if (group2.length > 1) {
|
|
54340
54338
|
statements = [
|
|
54341
|
-
...filter(statements, (s) => group2.
|
|
54339
|
+
...filter(statements, (s) => !group2.includes(s)),
|
|
54342
54340
|
factory.createExportDeclaration(
|
|
54343
54341
|
/*modifiers*/
|
|
54344
54342
|
void 0,
|
|
@@ -55367,8 +55365,8 @@ function createTypeChecker(host) {
|
|
|
55367
55365
|
});
|
|
55368
55366
|
}
|
|
55369
55367
|
});
|
|
55370
|
-
Debug.assert(setter
|
|
55371
|
-
const paramSymbol = getSignatureFromDeclaration(setter).parameters[0];
|
|
55368
|
+
Debug.assert(!!setter);
|
|
55369
|
+
const paramSymbol = isFunctionLikeDeclaration(setter) ? getSignatureFromDeclaration(setter).parameters[0] : void 0;
|
|
55372
55370
|
result.push(setTextRange(
|
|
55373
55371
|
factory.createSetAccessorDeclaration(
|
|
55374
55372
|
factory.createModifiersFromModifierFlags(flag),
|
|
@@ -56144,7 +56142,7 @@ function createTypeChecker(host) {
|
|
|
56144
56142
|
const pattern = declaration.parent;
|
|
56145
56143
|
if (strictNullChecks && declaration.flags & 33554432 /* Ambient */ && isParameterDeclaration(declaration)) {
|
|
56146
56144
|
parentType = getNonNullableType(parentType);
|
|
56147
|
-
} else if (strictNullChecks && pattern.parent.initializer && !(
|
|
56145
|
+
} else if (strictNullChecks && pattern.parent.initializer && !hasTypeFacts(getTypeOfInitializer(pattern.parent.initializer), 65536 /* EQUndefined */)) {
|
|
56148
56146
|
parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);
|
|
56149
56147
|
}
|
|
56150
56148
|
let type;
|
|
@@ -56187,7 +56185,7 @@ function createTypeChecker(host) {
|
|
|
56187
56185
|
return type;
|
|
56188
56186
|
}
|
|
56189
56187
|
if (getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration))) {
|
|
56190
|
-
return strictNullChecks && !(
|
|
56188
|
+
return strictNullChecks && !hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
|
|
56191
56189
|
}
|
|
56192
56190
|
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
|
|
56193
56191
|
}
|
|
@@ -64295,7 +64293,7 @@ function createTypeChecker(host) {
|
|
|
64295
64293
|
if (sourceType && targetType) {
|
|
64296
64294
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
64297
64295
|
const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
64298
|
-
const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
|
|
64296
|
+
const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts(sourceType, 50331648 /* IsUndefinedOrNull */) === getTypeFacts(targetType, 50331648 /* IsUndefinedOrNull */);
|
|
64299
64297
|
let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 /* StrictArity */ | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(
|
|
64300
64298
|
sourceType,
|
|
64301
64299
|
targetType,
|
|
@@ -67452,7 +67450,7 @@ function createTypeChecker(host) {
|
|
|
67452
67450
|
return value.base10Value === "0";
|
|
67453
67451
|
}
|
|
67454
67452
|
function removeDefinitelyFalsyTypes(type) {
|
|
67455
|
-
return filterType(type, (t) =>
|
|
67453
|
+
return filterType(type, (t) => hasTypeFacts(t, 4194304 /* Truthy */));
|
|
67456
67454
|
}
|
|
67457
67455
|
function extractDefinitelyFalsyTypes(type) {
|
|
67458
67456
|
return mapType(type, getDefinitelyFalsyPartOfType);
|
|
@@ -67715,7 +67713,7 @@ function createTypeChecker(host) {
|
|
|
67715
67713
|
const param = declaration;
|
|
67716
67714
|
if (isIdentifier(param.name)) {
|
|
67717
67715
|
const originalKeywordKind = identifierToKeywordKind(param.name);
|
|
67718
|
-
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.
|
|
67716
|
+
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
|
|
67719
67717
|
param,
|
|
67720
67718
|
param.name.escapedText,
|
|
67721
67719
|
788968 /* Type */,
|
|
@@ -69197,7 +69195,13 @@ function createTypeChecker(host) {
|
|
|
69197
69195
|
const resolved = resolveStructuredTypeMembers(type);
|
|
69198
69196
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
69199
69197
|
}
|
|
69200
|
-
function getTypeFacts(type) {
|
|
69198
|
+
function getTypeFacts(type, mask2) {
|
|
69199
|
+
return getTypeFactsWorker(type, mask2) & mask2;
|
|
69200
|
+
}
|
|
69201
|
+
function hasTypeFacts(type, mask2) {
|
|
69202
|
+
return getTypeFacts(type, mask2) !== 0;
|
|
69203
|
+
}
|
|
69204
|
+
function getTypeFactsWorker(type, callerOnlyNeeds) {
|
|
69201
69205
|
if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
|
|
69202
69206
|
type = getBaseConstraintOfType(type) || unknownType;
|
|
69203
69207
|
}
|
|
@@ -69230,6 +69234,10 @@ function createTypeChecker(host) {
|
|
|
69230
69234
|
return strictNullChecks ? type === falseType || type === regularFalseType ? 12121864 /* FalseStrictFacts */ : 7927560 /* TrueStrictFacts */ : type === falseType || type === regularFalseType ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
|
|
69231
69235
|
}
|
|
69232
69236
|
if (flags & 524288 /* Object */) {
|
|
69237
|
+
const possibleFacts = strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ | 7880640 /* FunctionStrictFacts */ | 7888800 /* ObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ | 16728e3 /* FunctionFacts */ | 16736160 /* ObjectFacts */;
|
|
69238
|
+
if ((callerOnlyNeeds & possibleFacts) === 0) {
|
|
69239
|
+
return 0;
|
|
69240
|
+
}
|
|
69233
69241
|
return getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ? strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ : isFunctionObjectType(type) ? strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728e3 /* FunctionFacts */ : strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
|
|
69234
69242
|
}
|
|
69235
69243
|
if (flags & 16384 /* Void */) {
|
|
@@ -69251,20 +69259,20 @@ function createTypeChecker(host) {
|
|
|
69251
69259
|
return 0 /* None */;
|
|
69252
69260
|
}
|
|
69253
69261
|
if (flags & 1048576 /* Union */) {
|
|
69254
|
-
return reduceLeft(type.types, (facts, t) => facts |
|
|
69262
|
+
return reduceLeft(type.types, (facts, t) => facts | getTypeFactsWorker(t, callerOnlyNeeds), 0 /* None */);
|
|
69255
69263
|
}
|
|
69256
69264
|
if (flags & 2097152 /* Intersection */) {
|
|
69257
|
-
return getIntersectionTypeFacts(type);
|
|
69265
|
+
return getIntersectionTypeFacts(type, callerOnlyNeeds);
|
|
69258
69266
|
}
|
|
69259
69267
|
return 83886079 /* UnknownFacts */;
|
|
69260
69268
|
}
|
|
69261
|
-
function getIntersectionTypeFacts(type) {
|
|
69269
|
+
function getIntersectionTypeFacts(type, callerOnlyNeeds) {
|
|
69262
69270
|
const ignoreObjects = maybeTypeOfKind(type, 402784252 /* Primitive */);
|
|
69263
69271
|
let oredFacts = 0 /* None */;
|
|
69264
69272
|
let andedFacts = 134217727 /* All */;
|
|
69265
69273
|
for (const t of type.types) {
|
|
69266
69274
|
if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
|
|
69267
|
-
const f =
|
|
69275
|
+
const f = getTypeFactsWorker(t, callerOnlyNeeds);
|
|
69268
69276
|
oredFacts |= f;
|
|
69269
69277
|
andedFacts &= f;
|
|
69270
69278
|
}
|
|
@@ -69272,19 +69280,19 @@ function createTypeChecker(host) {
|
|
|
69272
69280
|
return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
|
|
69273
69281
|
}
|
|
69274
69282
|
function getTypeWithFacts(type, include) {
|
|
69275
|
-
return filterType(type, (t) => (
|
|
69283
|
+
return filterType(type, (t) => hasTypeFacts(t, include));
|
|
69276
69284
|
}
|
|
69277
69285
|
function getAdjustedTypeWithFacts(type, facts) {
|
|
69278
69286
|
const reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
|
|
69279
69287
|
if (strictNullChecks) {
|
|
69280
69288
|
switch (facts) {
|
|
69281
69289
|
case 524288 /* NEUndefined */:
|
|
69282
|
-
return mapType(reduced, (t) =>
|
|
69290
|
+
return mapType(reduced, (t) => hasTypeFacts(t, 65536 /* EQUndefined */) ? getIntersectionType([t, hasTypeFacts(t, 131072 /* EQNull */) && !maybeTypeOfKind(reduced, 65536 /* Null */) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t);
|
|
69283
69291
|
case 1048576 /* NENull */:
|
|
69284
|
-
return mapType(reduced, (t) =>
|
|
69292
|
+
return mapType(reduced, (t) => hasTypeFacts(t, 131072 /* EQNull */) ? getIntersectionType([t, hasTypeFacts(t, 65536 /* EQUndefined */) && !maybeTypeOfKind(reduced, 32768 /* Undefined */) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t);
|
|
69285
69293
|
case 2097152 /* NEUndefinedOrNull */:
|
|
69286
69294
|
case 4194304 /* Truthy */:
|
|
69287
|
-
return mapType(reduced, (t) =>
|
|
69295
|
+
return mapType(reduced, (t) => hasTypeFacts(t, 262144 /* EQUndefinedOrNull */) ? getGlobalNonNullableTypeInstantiation(t) : t);
|
|
69288
69296
|
}
|
|
69289
69297
|
}
|
|
69290
69298
|
return reduced;
|
|
@@ -70621,14 +70629,14 @@ function createTypeChecker(host) {
|
|
|
70621
70629
|
// the constituent based on its type facts. We use the strict subtype relation because it treats `object`
|
|
70622
70630
|
// as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
|
|
70623
70631
|
// but are classified as "function" according to `typeof`.
|
|
70624
|
-
isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ?
|
|
70632
|
+
isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? hasTypeFacts(t, facts) ? t : neverType : (
|
|
70625
70633
|
// We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
|
|
70626
70634
|
// type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
|
|
70627
70635
|
isTypeSubtypeOf(impliedType, t) ? impliedType : (
|
|
70628
70636
|
// Neither the constituent nor the implied type is a subtype of the other, however their domains may still
|
|
70629
70637
|
// overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
|
|
70630
70638
|
// possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
|
|
70631
|
-
|
|
70639
|
+
hasTypeFacts(t, facts) ? getIntersectionType([t, impliedType]) : neverType
|
|
70632
70640
|
)
|
|
70633
70641
|
)
|
|
70634
70642
|
));
|
|
@@ -70642,7 +70650,7 @@ function createTypeChecker(host) {
|
|
|
70642
70650
|
const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
|
|
70643
70651
|
if (hasDefaultClause) {
|
|
70644
70652
|
const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses);
|
|
70645
|
-
return filterType(type, (t) =>
|
|
70653
|
+
return filterType(type, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
|
|
70646
70654
|
}
|
|
70647
70655
|
const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
|
|
70648
70656
|
return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
|
|
@@ -70780,7 +70788,7 @@ function createTypeChecker(host) {
|
|
|
70780
70788
|
false
|
|
70781
70789
|
);
|
|
70782
70790
|
}
|
|
70783
|
-
if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) && !(
|
|
70791
|
+
if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) && !hasTypeFacts(predicate.type, 65536 /* EQUndefined */)) {
|
|
70784
70792
|
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
70785
70793
|
}
|
|
70786
70794
|
const access = getDiscriminantPropertyAccess(predicateArgument, type);
|
|
@@ -70914,7 +70922,7 @@ function createTypeChecker(host) {
|
|
|
70914
70922
|
reportCircularityError(declaration.symbol);
|
|
70915
70923
|
return true;
|
|
70916
70924
|
}
|
|
70917
|
-
const containsUndefined = !!(
|
|
70925
|
+
const containsUndefined = !!hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */);
|
|
70918
70926
|
if (!popTypeResolution()) {
|
|
70919
70927
|
reportCircularityError(declaration.symbol);
|
|
70920
70928
|
return true;
|
|
@@ -70924,7 +70932,7 @@ function createTypeChecker(host) {
|
|
|
70924
70932
|
return links.parameterInitializerContainsUndefined;
|
|
70925
70933
|
}
|
|
70926
70934
|
function removeOptionalityFromDeclaredType(declaredType, declaration) {
|
|
70927
|
-
const removeUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer &&
|
|
70935
|
+
const removeUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && hasTypeFacts(declaredType, 16777216 /* IsUndefined */) && !parameterInitializerContainsUndefined(declaration);
|
|
70928
70936
|
return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
|
|
70929
70937
|
}
|
|
70930
70938
|
function isConstraintPosition(type, node) {
|
|
@@ -73093,7 +73101,7 @@ function createTypeChecker(host) {
|
|
|
73093
73101
|
return getJsxElementTypeAt(node) || anyType;
|
|
73094
73102
|
}
|
|
73095
73103
|
function isHyphenatedJsxName(name) {
|
|
73096
|
-
return
|
|
73104
|
+
return name.includes("-");
|
|
73097
73105
|
}
|
|
73098
73106
|
function isJsxIntrinsicTagName(tagName) {
|
|
73099
73107
|
return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
|
|
@@ -73754,7 +73762,7 @@ function createTypeChecker(host) {
|
|
|
73754
73762
|
return checkNonNullType(checkExpression(node), node);
|
|
73755
73763
|
}
|
|
73756
73764
|
function isNullableType(type) {
|
|
73757
|
-
return
|
|
73765
|
+
return hasTypeFacts(type, 50331648 /* IsUndefinedOrNull */);
|
|
73758
73766
|
}
|
|
73759
73767
|
function getNonNullableTypeIfNeeded(type) {
|
|
73760
73768
|
return isNullableType(type) ? getNonNullableType(type) : type;
|
|
@@ -73800,7 +73808,7 @@ function createTypeChecker(host) {
|
|
|
73800
73808
|
error2(node, Diagnostics.Object_is_of_type_unknown);
|
|
73801
73809
|
return errorType;
|
|
73802
73810
|
}
|
|
73803
|
-
const facts = getTypeFacts(type);
|
|
73811
|
+
const facts = getTypeFacts(type, 50331648 /* IsUndefinedOrNull */);
|
|
73804
73812
|
if (facts & 50331648 /* IsUndefinedOrNull */) {
|
|
73805
73813
|
reportError(node, facts);
|
|
73806
73814
|
const t = getNonNullableType(type);
|
|
@@ -77580,7 +77588,7 @@ function createTypeChecker(host) {
|
|
|
77580
77588
|
if (operandConstraint.flags & 3 /* AnyOrUnknown */) {
|
|
77581
77589
|
return (556800 /* AllTypeofNE */ & notEqualFacts) === 556800 /* AllTypeofNE */;
|
|
77582
77590
|
}
|
|
77583
|
-
return !someType(operandConstraint, (t) =>
|
|
77591
|
+
return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
|
|
77584
77592
|
}
|
|
77585
77593
|
const type = checkExpressionCached(node.expression);
|
|
77586
77594
|
if (!isLiteralType(type)) {
|
|
@@ -77898,14 +77906,15 @@ function createTypeChecker(host) {
|
|
|
77898
77906
|
if (symbol) {
|
|
77899
77907
|
if (isReadonlySymbol(symbol)) {
|
|
77900
77908
|
error2(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property);
|
|
77909
|
+
} else {
|
|
77910
|
+
checkDeleteExpressionMustBeOptional(expr, symbol);
|
|
77901
77911
|
}
|
|
77902
|
-
checkDeleteExpressionMustBeOptional(expr, symbol);
|
|
77903
77912
|
}
|
|
77904
77913
|
return booleanType;
|
|
77905
77914
|
}
|
|
77906
77915
|
function checkDeleteExpressionMustBeOptional(expr, symbol) {
|
|
77907
77916
|
const type = getTypeOfSymbol(symbol);
|
|
77908
|
-
if (strictNullChecks && !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ :
|
|
77917
|
+
if (strictNullChecks && !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : hasTypeFacts(type, 16777216 /* IsUndefined */))) {
|
|
77909
77918
|
error2(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
|
|
77910
77919
|
}
|
|
77911
77920
|
}
|
|
@@ -78040,7 +78049,7 @@ function createTypeChecker(host) {
|
|
|
78040
78049
|
return getUnaryResultType(operandType);
|
|
78041
78050
|
case 54 /* ExclamationToken */:
|
|
78042
78051
|
checkTruthinessOfType(operandType, node.operand);
|
|
78043
|
-
const facts = getTypeFacts(operandType
|
|
78052
|
+
const facts = getTypeFacts(operandType, 4194304 /* Truthy */ | 8388608 /* Falsy */);
|
|
78044
78053
|
return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType;
|
|
78045
78054
|
case 46 /* PlusPlusToken */:
|
|
78046
78055
|
case 47 /* MinusMinusToken */:
|
|
@@ -78271,7 +78280,7 @@ function createTypeChecker(host) {
|
|
|
78271
78280
|
if (exprOrAssignment.kind === 304 /* ShorthandPropertyAssignment */) {
|
|
78272
78281
|
const prop = exprOrAssignment;
|
|
78273
78282
|
if (prop.objectAssignmentInitializer) {
|
|
78274
|
-
if (strictNullChecks && !(
|
|
78283
|
+
if (strictNullChecks && !hasTypeFacts(checkExpression(prop.objectAssignmentInitializer), 16777216 /* IsUndefined */)) {
|
|
78275
78284
|
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
|
|
78276
78285
|
}
|
|
78277
78286
|
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
|
|
@@ -78683,7 +78692,7 @@ function createTypeChecker(host) {
|
|
|
78683
78692
|
return checkInExpression(left, right, leftType, rightType);
|
|
78684
78693
|
case 56 /* AmpersandAmpersandToken */:
|
|
78685
78694
|
case 77 /* AmpersandAmpersandEqualsToken */: {
|
|
78686
|
-
const resultType2 =
|
|
78695
|
+
const resultType2 = hasTypeFacts(leftType, 4194304 /* Truthy */) ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType;
|
|
78687
78696
|
if (operator === 77 /* AmpersandAmpersandEqualsToken */) {
|
|
78688
78697
|
checkAssignmentOperator(rightType);
|
|
78689
78698
|
}
|
|
@@ -78691,7 +78700,7 @@ function createTypeChecker(host) {
|
|
|
78691
78700
|
}
|
|
78692
78701
|
case 57 /* BarBarToken */:
|
|
78693
78702
|
case 76 /* BarBarEqualsToken */: {
|
|
78694
|
-
const resultType2 =
|
|
78703
|
+
const resultType2 = hasTypeFacts(leftType, 8388608 /* Falsy */) ? getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) : leftType;
|
|
78695
78704
|
if (operator === 76 /* BarBarEqualsToken */) {
|
|
78696
78705
|
checkAssignmentOperator(rightType);
|
|
78697
78706
|
}
|
|
@@ -78699,7 +78708,7 @@ function createTypeChecker(host) {
|
|
|
78699
78708
|
}
|
|
78700
78709
|
case 61 /* QuestionQuestionToken */:
|
|
78701
78710
|
case 78 /* QuestionQuestionEqualsToken */: {
|
|
78702
|
-
const resultType2 =
|
|
78711
|
+
const resultType2 = hasTypeFacts(leftType, 262144 /* EQUndefinedOrNull */) ? getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) : leftType;
|
|
78703
78712
|
if (operator === 78 /* QuestionQuestionEqualsToken */) {
|
|
78704
78713
|
checkAssignmentOperator(rightType);
|
|
78705
78714
|
}
|
|
@@ -82016,7 +82025,7 @@ function createTypeChecker(host) {
|
|
|
82016
82025
|
}
|
|
82017
82026
|
const type = location === condExpr2 ? condType : checkTruthinessExpression(location);
|
|
82018
82027
|
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
82019
|
-
if (!(
|
|
82028
|
+
if (!hasTypeFacts(type, 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
82020
82029
|
return;
|
|
82021
82030
|
const callSignatures = getSignaturesOfType(type, 0 /* Call */);
|
|
82022
82031
|
const isPromise = !!getAwaitedTypeOfPromise(type);
|
|
@@ -88255,7 +88264,7 @@ function createTypeChecker(host) {
|
|
|
88255
88264
|
return false;
|
|
88256
88265
|
}
|
|
88257
88266
|
function checkGrammarNumericLiteral(node) {
|
|
88258
|
-
const isFractional = getTextOfNode(node).
|
|
88267
|
+
const isFractional = getTextOfNode(node).includes(".");
|
|
88259
88268
|
const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
|
|
88260
88269
|
if (isFractional || isScientific) {
|
|
88261
88270
|
return;
|
|
@@ -111401,7 +111410,7 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
111401
111410
|
}
|
|
111402
111411
|
function hasInternalAnnotation(range, currentSourceFile) {
|
|
111403
111412
|
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
111404
|
-
return
|
|
111413
|
+
return comment.includes("@internal");
|
|
111405
111414
|
}
|
|
111406
111415
|
function isInternalDeclaration(node, currentSourceFile) {
|
|
111407
111416
|
const parseTreeNode = getParseTreeNode(node);
|
|
@@ -115891,7 +115900,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115891
115900
|
/*jsxAttributeEscape*/
|
|
115892
115901
|
false
|
|
115893
115902
|
);
|
|
115894
|
-
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !
|
|
115903
|
+
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
|
|
115895
115904
|
} else if (isAccessExpression(expression)) {
|
|
115896
115905
|
const constantValue = getConstantValue(expression);
|
|
115897
115906
|
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
@@ -120778,7 +120787,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120778
120787
|
const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
120779
120788
|
if (resultFromDts)
|
|
120780
120789
|
return resultFromDts;
|
|
120781
|
-
if (!host.realpath || !options.preserveSymlinks || !
|
|
120790
|
+
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
|
|
120782
120791
|
return void 0;
|
|
120783
120792
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
|
120784
120793
|
return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
|
|
@@ -122036,7 +122045,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122036
122045
|
const path = toPath3(fileName);
|
|
122037
122046
|
if (useSourceOfProjectReferenceRedirect) {
|
|
122038
122047
|
let source = getSourceOfProjectReferenceRedirect(path);
|
|
122039
|
-
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) &&
|
|
122048
|
+
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
|
122040
122049
|
const realPath2 = toPath3(host.realpath(fileName));
|
|
122041
122050
|
if (realPath2 !== path)
|
|
122042
122051
|
source = getSourceOfProjectReferenceRedirect(realPath2);
|
|
@@ -123396,7 +123405,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
123396
123405
|
var _a;
|
|
123397
123406
|
if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
|
|
123398
123407
|
return;
|
|
123399
|
-
if (!originalRealpath || !
|
|
123408
|
+
if (!originalRealpath || !directory.includes(nodeModulesPathPart))
|
|
123400
123409
|
return;
|
|
123401
123410
|
const symlinkCache = host.getSymlinkCache();
|
|
123402
123411
|
const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
|
|
@@ -123424,7 +123433,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
123424
123433
|
if (!symlinkedDirectories)
|
|
123425
123434
|
return false;
|
|
123426
123435
|
const fileOrDirectoryPath = host.toPath(fileOrDirectory);
|
|
123427
|
-
if (!
|
|
123436
|
+
if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
|
|
123428
123437
|
return false;
|
|
123429
123438
|
if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
|
|
123430
123439
|
return true;
|
|
@@ -125314,7 +125323,7 @@ function removeIgnoredPath(path) {
|
|
|
125314
125323
|
if (endsWith(path, "/node_modules/.staging")) {
|
|
125315
125324
|
return removeSuffix(path, "/.staging");
|
|
125316
125325
|
}
|
|
125317
|
-
return some(ignoredPaths, (searchPath) =>
|
|
125326
|
+
return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
|
|
125318
125327
|
}
|
|
125319
125328
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
125320
125329
|
if (length2 <= 1)
|
|
@@ -130054,7 +130063,7 @@ var Arguments;
|
|
|
130054
130063
|
Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
|
|
130055
130064
|
})(Arguments || (Arguments = {}));
|
|
130056
130065
|
function hasArgument(argumentName) {
|
|
130057
|
-
return sys.args.
|
|
130066
|
+
return sys.args.includes(argumentName);
|
|
130058
130067
|
}
|
|
130059
130068
|
function findArgument(argumentName) {
|
|
130060
130069
|
const index = sys.args.indexOf(argumentName);
|
|
@@ -132877,7 +132886,7 @@ function createPackageJsonImportFilter(fromFile, preferences, host) {
|
|
|
132877
132886
|
return false;
|
|
132878
132887
|
}
|
|
132879
132888
|
function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) {
|
|
132880
|
-
if (!
|
|
132889
|
+
if (!importedFileName.includes("node_modules")) {
|
|
132881
132890
|
return void 0;
|
|
132882
132891
|
}
|
|
132883
132892
|
const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName(
|
|
@@ -133451,7 +133460,7 @@ function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) {
|
|
|
133451
133460
|
var _a;
|
|
133452
133461
|
const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName)));
|
|
133453
133462
|
for (const ambient of checker.getAmbientModules()) {
|
|
133454
|
-
if (!
|
|
133463
|
+
if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
|
|
133455
133464
|
cb(
|
|
133456
133465
|
ambient,
|
|
133457
133466
|
/*sourceFile*/
|
|
@@ -142349,7 +142358,7 @@ function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFi
|
|
|
142349
142358
|
return symbolId;
|
|
142350
142359
|
}
|
|
142351
142360
|
function checkForUsedDeclarations(node) {
|
|
142352
|
-
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.
|
|
142361
|
+
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) {
|
|
142353
142362
|
return;
|
|
142354
142363
|
}
|
|
142355
142364
|
const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node);
|
|
@@ -144707,7 +144716,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
144707
144716
|
return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */;
|
|
144708
144717
|
}
|
|
144709
144718
|
function isNodeModulesFile(path) {
|
|
144710
|
-
return
|
|
144719
|
+
return path.includes("/node_modules/");
|
|
144711
144720
|
}
|
|
144712
144721
|
}
|
|
144713
144722
|
function getRenameInfo2(fileName, position, preferences) {
|
|
@@ -153688,7 +153697,7 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program
|
|
|
153688
153697
|
}
|
|
153689
153698
|
}
|
|
153690
153699
|
function isCallbackLike(checker, sourceFile, name) {
|
|
153691
|
-
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.
|
|
153700
|
+
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference));
|
|
153692
153701
|
}
|
|
153693
153702
|
function isLastParameter(func, parameter, isFixAll) {
|
|
153694
153703
|
const parameters = func.parameters;
|
|
@@ -161069,7 +161078,7 @@ function directoryResult(name) {
|
|
|
161069
161078
|
function addReplacementSpans(text, textStart, names) {
|
|
161070
161079
|
const span = getDirectoryFragmentTextSpan(text, textStart);
|
|
161071
161080
|
const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length);
|
|
161072
|
-
return names.map(({ name, kind, extension }) =>
|
|
161081
|
+
return names.map(({ name, kind, extension }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
|
|
161073
161082
|
}
|
|
161074
161083
|
function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
|
|
161075
161084
|
return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences));
|
|
@@ -161395,7 +161404,7 @@ function getPatternFromFirstMatchingCondition(target, conditions) {
|
|
|
161395
161404
|
}
|
|
161396
161405
|
if (target && typeof target === "object" && !isArray(target)) {
|
|
161397
161406
|
for (const condition in target) {
|
|
161398
|
-
if (condition === "default" || conditions.
|
|
161407
|
+
if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) {
|
|
161399
161408
|
const pattern = target[condition];
|
|
161400
161409
|
return getPatternFromFirstMatchingCondition(pattern, conditions);
|
|
161401
161410
|
}
|
|
@@ -161407,7 +161416,7 @@ function getFragmentDirectory(fragment) {
|
|
|
161407
161416
|
}
|
|
161408
161417
|
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
|
|
161409
161418
|
if (!endsWith(path, "*")) {
|
|
161410
|
-
return !
|
|
161419
|
+
return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
|
|
161411
161420
|
}
|
|
161412
161421
|
const pathPrefix = path.slice(0, path.length - 1);
|
|
161413
161422
|
const remainingFragment = tryRemovePrefix(fragment, pathPrefix);
|
|
@@ -161477,7 +161486,7 @@ function removeLeadingDirectorySeparator(path) {
|
|
|
161477
161486
|
}
|
|
161478
161487
|
function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
161479
161488
|
const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
|
|
161480
|
-
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.
|
|
161489
|
+
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && !moduleName.includes("*"));
|
|
161481
161490
|
if (fragmentDirectory !== void 0) {
|
|
161482
161491
|
const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory);
|
|
161483
161492
|
return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator));
|
|
@@ -161593,7 +161602,7 @@ function isPathRelativeToScript(path) {
|
|
|
161593
161602
|
var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/;
|
|
161594
161603
|
var nodeModulesDependencyKeys = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
161595
161604
|
function containsSlash(fragment) {
|
|
161596
|
-
return
|
|
161605
|
+
return fragment.includes(directorySeparator);
|
|
161597
161606
|
}
|
|
161598
161607
|
function isRequireCallArgument(node) {
|
|
161599
161608
|
return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require";
|
|
@@ -170288,7 +170297,7 @@ function isSemicolonInsertionContext(context) {
|
|
|
170288
170297
|
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
|
|
170289
170298
|
}
|
|
170290
170299
|
function isNotPropertyAccessOnIntegerLiteral(context) {
|
|
170291
|
-
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().
|
|
170300
|
+
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().includes(".");
|
|
170292
170301
|
}
|
|
170293
170302
|
|
|
170294
170303
|
// src/services/formatting/rulesMap.ts
|
|
@@ -171460,7 +171469,7 @@ var SmartIndenter;
|
|
|
171460
171469
|
}
|
|
171461
171470
|
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
|
|
171462
171471
|
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
|
|
171463
|
-
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].
|
|
171472
|
+
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind);
|
|
171464
171473
|
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
|
|
171465
171474
|
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
|
|
171466
171475
|
}
|
|
@@ -174061,7 +174070,6 @@ __export(ts_exports2, {
|
|
|
174061
174070
|
startsWithDirectory: () => startsWithDirectory,
|
|
174062
174071
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
174063
174072
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
174064
|
-
stringContains: () => stringContains,
|
|
174065
174073
|
stringContainsAt: () => stringContainsAt,
|
|
174066
174074
|
stringToToken: () => stringToToken,
|
|
174067
174075
|
stripQuotes: () => stripQuotes,
|
|
@@ -175469,7 +175477,7 @@ var TextStorage = class {
|
|
|
175469
175477
|
}
|
|
175470
175478
|
};
|
|
175471
175479
|
function isDynamicFileName(fileName) {
|
|
175472
|
-
return fileName[0] === "^" || (
|
|
175480
|
+
return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator);
|
|
175473
175481
|
}
|
|
175474
175482
|
var ScriptInfo = class {
|
|
175475
175483
|
constructor(host, fileName, scriptKind, hasMixedContent, path, initialVersion) {
|
|
@@ -176861,7 +176869,7 @@ var Project3 = class _Project {
|
|
|
176861
176869
|
}
|
|
176862
176870
|
removeExistingTypings(include) {
|
|
176863
176871
|
const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
|
|
176864
|
-
return include.filter((i) => existing.
|
|
176872
|
+
return include.filter((i) => !existing.includes(i));
|
|
176865
176873
|
}
|
|
176866
176874
|
updateGraphWorker() {
|
|
176867
176875
|
var _a, _b;
|
|
@@ -181054,7 +181062,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181054
181062
|
this.logger.info(`Excluding files based on rule ${name} matching file '${root}'`);
|
|
181055
181063
|
if (rule2.types) {
|
|
181056
181064
|
for (const type of rule2.types) {
|
|
181057
|
-
if (typeAcqInclude.
|
|
181065
|
+
if (!typeAcqInclude.includes(type)) {
|
|
181058
181066
|
typeAcqInclude.push(type);
|
|
181059
181067
|
}
|
|
181060
181068
|
}
|
|
@@ -181073,13 +181081,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181073
181081
|
return groupNumberOrString;
|
|
181074
181082
|
}).join("");
|
|
181075
181083
|
});
|
|
181076
|
-
if (excludeRules.
|
|
181084
|
+
if (!excludeRules.includes(processedRule)) {
|
|
181077
181085
|
excludeRules.push(processedRule);
|
|
181078
181086
|
}
|
|
181079
181087
|
}
|
|
181080
181088
|
} else {
|
|
181081
181089
|
const escaped = _ProjectService.escapeFilenameForRegex(root);
|
|
181082
|
-
if (excludeRules.
|
|
181090
|
+
if (!excludeRules.includes(escaped)) {
|
|
181083
181091
|
excludeRules.push(escaped);
|
|
181084
181092
|
}
|
|
181085
181093
|
}
|
|
@@ -181103,7 +181111,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181103
181111
|
this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`);
|
|
181104
181112
|
excludedFiles.push(normalizedNames[i]);
|
|
181105
181113
|
exclude = true;
|
|
181106
|
-
if (typeAcqInclude.
|
|
181114
|
+
if (!typeAcqInclude.includes(typeName)) {
|
|
181107
181115
|
typeAcqInclude.push(typeName);
|
|
181108
181116
|
}
|
|
181109
181117
|
}
|
|
@@ -184574,7 +184582,7 @@ ${e.message}`;
|
|
|
184574
184582
|
if (languageServiceDisabled) {
|
|
184575
184583
|
return;
|
|
184576
184584
|
}
|
|
184577
|
-
const fileNamesInProject = fileNames.filter((value) => !
|
|
184585
|
+
const fileNamesInProject = fileNames.filter((value) => !value.includes("lib.d.ts"));
|
|
184578
184586
|
if (fileNamesInProject.length === 0) {
|
|
184579
184587
|
return;
|
|
184580
184588
|
}
|
|
@@ -188624,7 +188632,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188624
188632
|
startsWithDirectory,
|
|
188625
188633
|
startsWithUnderscore,
|
|
188626
188634
|
startsWithUseStrict,
|
|
188627
|
-
stringContains,
|
|
188628
188635
|
stringContainsAt,
|
|
188629
188636
|
stringToToken,
|
|
188630
188637
|
stripQuotes,
|