typescript 4.8.2 → 4.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +111 -84
- package/lib/tsserver.js +120 -94
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +119 -93
- package/lib/typescript.js +112 -86
- package/lib/typescriptServices.js +112 -86
- package/lib/typingsInstaller.js +112 -86
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.8";
|
|
72
|
-
ts.version = "4.8.
|
|
72
|
+
ts.version = "4.8.3";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -6031,7 +6031,7 @@ var ts;
|
|
|
6031
6031
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),
|
|
6032
6032
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),
|
|
6033
6033
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),
|
|
6034
|
-
|
|
6034
|
+
This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),
|
|
6035
6035
|
_0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."),
|
|
6036
6036
|
_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),
|
|
6037
6037
|
_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."),
|
|
@@ -36545,7 +36545,7 @@ var ts;
|
|
|
36545
36545
|
var _a, _b;
|
|
36546
36546
|
if (path === undefined)
|
|
36547
36547
|
return path;
|
|
36548
|
-
return ts.
|
|
36548
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
36549
36549
|
}
|
|
36550
36550
|
function combineDirectoryPath(root, dir) {
|
|
36551
36551
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -36560,7 +36560,7 @@ var ts;
|
|
|
36560
36560
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
36561
36561
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
36562
36562
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
36563
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
36563
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
36564
36564
|
var getCanonicalFileName = ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames });
|
|
36565
36565
|
var commonSourceDirGuesses = [];
|
|
36566
36566
|
if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) {
|
|
@@ -36590,7 +36590,7 @@ var ts;
|
|
|
36590
36590
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
36591
36591
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
36592
36592
|
var candidateDir = candidateDirectories_1[_e];
|
|
36593
|
-
if (ts.
|
|
36593
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
36594
36594
|
var pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
36595
36595
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
36596
36596
|
var jsAndDtsExtensions = [".mjs", ".cjs", ".js", ".json", ".d.mts", ".d.cts", ".d.ts"];
|
|
@@ -41875,40 +41875,60 @@ var ts;
|
|
|
41875
41875
|
return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), undefined, dontResolveAlias);
|
|
41876
41876
|
}
|
|
41877
41877
|
function getTargetOfImportClause(node, dontResolveAlias) {
|
|
41878
|
-
var _a;
|
|
41879
41878
|
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
|
|
41880
41879
|
if (moduleSymbol) {
|
|
41881
|
-
|
|
41882
|
-
|
|
41883
|
-
|
|
41884
|
-
|
|
41885
|
-
|
|
41886
|
-
|
|
41887
|
-
|
|
41888
|
-
|
|
41889
|
-
|
|
41890
|
-
|
|
41891
|
-
|
|
41892
|
-
|
|
41893
|
-
|
|
41894
|
-
|
|
41895
|
-
|
|
41896
|
-
|
|
41897
|
-
|
|
41898
|
-
|
|
41899
|
-
|
|
41900
|
-
|
|
41901
|
-
|
|
41902
|
-
|
|
41880
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
41881
|
+
}
|
|
41882
|
+
}
|
|
41883
|
+
function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
|
|
41884
|
+
var _a;
|
|
41885
|
+
var exportDefaultSymbol;
|
|
41886
|
+
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
41887
|
+
exportDefaultSymbol = moduleSymbol;
|
|
41888
|
+
}
|
|
41889
|
+
else {
|
|
41890
|
+
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", node, dontResolveAlias);
|
|
41891
|
+
}
|
|
41892
|
+
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
41893
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
41894
|
+
if (!specifier) {
|
|
41895
|
+
return exportDefaultSymbol;
|
|
41896
|
+
}
|
|
41897
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
41898
|
+
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
41899
|
+
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
41900
|
+
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
41901
|
+
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
41902
|
+
var exportEqualsSymbol = moduleSymbol.exports.get("export=");
|
|
41903
|
+
var exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
41904
|
+
var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
|
|
41905
|
+
if (exportAssignment) {
|
|
41906
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
|
|
41903
41907
|
}
|
|
41904
41908
|
}
|
|
41905
|
-
else if (
|
|
41906
|
-
|
|
41907
|
-
|
|
41908
|
-
|
|
41909
|
+
else if (ts.isImportClause(node)) {
|
|
41910
|
+
reportNonDefaultExport(moduleSymbol, node);
|
|
41911
|
+
}
|
|
41912
|
+
else {
|
|
41913
|
+
errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, ts.isImportOrExportSpecifier(node) && node.propertyName || node.name);
|
|
41909
41914
|
}
|
|
41910
|
-
|
|
41911
|
-
|
|
41915
|
+
}
|
|
41916
|
+
else if (hasSyntheticDefault || hasDefaultOnly) {
|
|
41917
|
+
var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
41918
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, false);
|
|
41919
|
+
return resolved;
|
|
41920
|
+
}
|
|
41921
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, undefined, false);
|
|
41922
|
+
return exportDefaultSymbol;
|
|
41923
|
+
}
|
|
41924
|
+
function getModuleSpecifierForImportOrExport(node) {
|
|
41925
|
+
switch (node.kind) {
|
|
41926
|
+
case 267: return node.parent.moduleSpecifier;
|
|
41927
|
+
case 265: return ts.isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
|
|
41928
|
+
case 268: return node.parent.parent.moduleSpecifier;
|
|
41929
|
+
case 270: return node.parent.parent.parent.moduleSpecifier;
|
|
41930
|
+
case 275: return node.parent.parent.moduleSpecifier;
|
|
41931
|
+
default: return ts.Debug.assertNever(node);
|
|
41912
41932
|
}
|
|
41913
41933
|
}
|
|
41914
41934
|
function reportNonDefaultExport(moduleSymbol, node) {
|
|
@@ -41980,7 +42000,7 @@ var ts;
|
|
|
41980
42000
|
}
|
|
41981
42001
|
}
|
|
41982
42002
|
function getExternalModuleMember(node, specifier, dontResolveAlias) {
|
|
41983
|
-
var _a
|
|
42003
|
+
var _a;
|
|
41984
42004
|
if (dontResolveAlias === void 0) { dontResolveAlias = false; }
|
|
41985
42005
|
var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
41986
42006
|
var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier);
|
|
@@ -42014,29 +42034,33 @@ var ts;
|
|
|
42014
42034
|
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
|
|
42015
42035
|
symbolFromModule || symbolFromVariable;
|
|
42016
42036
|
if (!symbol) {
|
|
42017
|
-
|
|
42018
|
-
var declarationName = ts.declarationNameToString(name);
|
|
42019
|
-
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
42020
|
-
if (suggestion !== undefined) {
|
|
42021
|
-
var suggestionName = symbolToString(suggestion);
|
|
42022
|
-
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
42023
|
-
if (suggestion.valueDeclaration) {
|
|
42024
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
42025
|
-
}
|
|
42026
|
-
}
|
|
42027
|
-
else {
|
|
42028
|
-
if ((_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.has("default")) {
|
|
42029
|
-
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
42030
|
-
}
|
|
42031
|
-
else {
|
|
42032
|
-
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
42033
|
-
}
|
|
42034
|
-
}
|
|
42037
|
+
errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name);
|
|
42035
42038
|
}
|
|
42036
42039
|
return symbol;
|
|
42037
42040
|
}
|
|
42038
42041
|
}
|
|
42039
42042
|
}
|
|
42043
|
+
function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
|
|
42044
|
+
var _a;
|
|
42045
|
+
var moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
42046
|
+
var declarationName = ts.declarationNameToString(name);
|
|
42047
|
+
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
42048
|
+
if (suggestion !== undefined) {
|
|
42049
|
+
var suggestionName = symbolToString(suggestion);
|
|
42050
|
+
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
42051
|
+
if (suggestion.valueDeclaration) {
|
|
42052
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
42053
|
+
}
|
|
42054
|
+
}
|
|
42055
|
+
else {
|
|
42056
|
+
if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has("default")) {
|
|
42057
|
+
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
42058
|
+
}
|
|
42059
|
+
else {
|
|
42060
|
+
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
42061
|
+
}
|
|
42062
|
+
}
|
|
42063
|
+
}
|
|
42040
42064
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
42041
42065
|
var _a, _b;
|
|
42042
42066
|
var localSymbol = (_b = (_a = moduleSymbol.valueDeclaration) === null || _a === void 0 ? void 0 : _a.locals) === null || _b === void 0 ? void 0 : _b.get(name.escapedText);
|
|
@@ -42082,6 +42106,13 @@ var ts;
|
|
|
42082
42106
|
}
|
|
42083
42107
|
}
|
|
42084
42108
|
function getTargetOfImportSpecifier(node, dontResolveAlias) {
|
|
42109
|
+
if (ts.isImportSpecifier(node) && ts.idText(node.propertyName || node.name) === "default") {
|
|
42110
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
42111
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
42112
|
+
if (moduleSymbol) {
|
|
42113
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
42114
|
+
}
|
|
42115
|
+
}
|
|
42085
42116
|
var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;
|
|
42086
42117
|
var commonJSPropertyAccess = getCommonJSPropertyAccess(root);
|
|
42087
42118
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
@@ -42103,6 +42134,13 @@ var ts;
|
|
|
42103
42134
|
return resolved;
|
|
42104
42135
|
}
|
|
42105
42136
|
function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
|
|
42137
|
+
if (ts.idText(node.propertyName || node.name) === "default") {
|
|
42138
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
42139
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
42140
|
+
if (moduleSymbol) {
|
|
42141
|
+
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
|
|
42142
|
+
}
|
|
42143
|
+
}
|
|
42106
42144
|
var resolved = node.parent.parent.moduleSpecifier ?
|
|
42107
42145
|
getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
|
|
42108
42146
|
resolveEntityName(node.propertyName || node.name, meaning, false, dontResolveAlias);
|
|
@@ -51674,7 +51712,7 @@ var ts;
|
|
|
51674
51712
|
return includes & 8388608 ? wildcardType : anyType;
|
|
51675
51713
|
}
|
|
51676
51714
|
if (!strictNullChecks && includes & 98304) {
|
|
51677
|
-
return includes & 32768 ? undefinedType : nullType;
|
|
51715
|
+
return includes & 16777216 ? neverType : includes & 32768 ? undefinedType : nullType;
|
|
51678
51716
|
}
|
|
51679
51717
|
if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
|
|
51680
51718
|
includes & 8 && includes & 256 ||
|
|
@@ -52309,7 +52347,7 @@ var ts;
|
|
|
52309
52347
|
type;
|
|
52310
52348
|
}
|
|
52311
52349
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
52312
|
-
if (objectType.flags &
|
|
52350
|
+
if (objectType.flags & 1048576 || objectType.flags & 2097152 && !shouldDeferIndexType(objectType)) {
|
|
52313
52351
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
52314
52352
|
return objectType.flags & 2097152 || writing ? getIntersectionType(types) : getUnionType(types);
|
|
52315
52353
|
}
|
|
@@ -54448,7 +54486,7 @@ var ts;
|
|
|
54448
54486
|
if (reduced !== type) {
|
|
54449
54487
|
return reduced;
|
|
54450
54488
|
}
|
|
54451
|
-
if (type.flags & 2097152) {
|
|
54489
|
+
if (type.flags & 2097152 && ts.some(type.types, isEmptyAnonymousObjectType)) {
|
|
54452
54490
|
var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
|
|
54453
54491
|
if (normalizedTypes !== type.types) {
|
|
54454
54492
|
return getIntersectionType(normalizedTypes);
|
|
@@ -55432,7 +55470,7 @@ var ts;
|
|
|
55432
55470
|
if (reportErrors && originalErrorInfo) {
|
|
55433
55471
|
resetErrorInfo(saveErrorInfo);
|
|
55434
55472
|
}
|
|
55435
|
-
if (result = isRelatedTo(source, constraint, 2, reportErrors)) {
|
|
55473
|
+
if (result = isRelatedTo(source, constraint, 2, reportErrors, undefined, intersectionState)) {
|
|
55436
55474
|
return result;
|
|
55437
55475
|
}
|
|
55438
55476
|
if (reportErrors && originalErrorInfo && errorInfo) {
|
|
@@ -55495,8 +55533,8 @@ var ts;
|
|
|
55495
55533
|
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
|
|
55496
55534
|
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
55497
55535
|
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
55498
|
-
if (result = skipTrue ? -1 : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2, false)) {
|
|
55499
|
-
result &= skipFalse ? -1 : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2, false);
|
|
55536
|
+
if (result = skipTrue ? -1 : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2, false, undefined, intersectionState)) {
|
|
55537
|
+
result &= skipFalse ? -1 : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2, false, undefined, intersectionState);
|
|
55500
55538
|
if (result) {
|
|
55501
55539
|
return result;
|
|
55502
55540
|
}
|
|
@@ -59855,7 +59893,7 @@ var ts;
|
|
|
59855
59893
|
var narrowedPropType = narrowType(propType);
|
|
59856
59894
|
return filterType(type, function (t) {
|
|
59857
59895
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
59858
|
-
return !(narrowedPropType.flags & 131072) &&
|
|
59896
|
+
return !(narrowedPropType.flags & 131072) && areTypesComparable(narrowedPropType, discriminantType);
|
|
59859
59897
|
});
|
|
59860
59898
|
}
|
|
59861
59899
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -59904,7 +59942,7 @@ var ts;
|
|
|
59904
59942
|
}
|
|
59905
59943
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
59906
59944
|
if (type.flags & 1048576
|
|
59907
|
-
|| type.flags & 524288 && declaredType !== type
|
|
59945
|
+
|| type.flags & 524288 && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
59908
59946
|
|| ts.isThisTypeParameter(type)
|
|
59909
59947
|
|| type.flags & 2097152 && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
59910
59948
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -60024,14 +60062,18 @@ var ts;
|
|
|
60024
60062
|
assumeTrue = !assumeTrue;
|
|
60025
60063
|
}
|
|
60026
60064
|
var valueType = getTypeOfExpression(value);
|
|
60027
|
-
if ((type.flags & 2)
|
|
60065
|
+
if (((type.flags & 2) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304)) &&
|
|
60066
|
+
assumeTrue &&
|
|
60067
|
+
(operator === 36 || operator === 37)) {
|
|
60028
60068
|
if (valueType.flags & (131068 | 67108864)) {
|
|
60029
60069
|
return valueType;
|
|
60030
60070
|
}
|
|
60031
60071
|
if (valueType.flags & 524288) {
|
|
60032
60072
|
return nonPrimitiveType;
|
|
60033
60073
|
}
|
|
60034
|
-
|
|
60074
|
+
if (type.flags & 2) {
|
|
60075
|
+
return type;
|
|
60076
|
+
}
|
|
60035
60077
|
}
|
|
60036
60078
|
if (valueType.flags & 98304) {
|
|
60037
60079
|
if (!strictNullChecks) {
|
|
@@ -60426,7 +60468,9 @@ var ts;
|
|
|
60426
60468
|
!!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
|
|
60427
60469
|
}
|
|
60428
60470
|
function isGenericTypeWithoutNullableConstraint(type) {
|
|
60429
|
-
return
|
|
60471
|
+
return type.flags & 2097152 ?
|
|
60472
|
+
ts.some(type.types, isGenericTypeWithoutNullableConstraint) :
|
|
60473
|
+
!!(type.flags & 465829888 && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304));
|
|
60430
60474
|
}
|
|
60431
60475
|
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
60432
60476
|
var contextualType = (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
|
|
@@ -105437,9 +105481,7 @@ var ts;
|
|
|
105437
105481
|
}
|
|
105438
105482
|
}
|
|
105439
105483
|
}
|
|
105440
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
105441
105484
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
105442
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
105443
105485
|
var pseudoUpToDate = false;
|
|
105444
105486
|
var usesPrepend = false;
|
|
105445
105487
|
var upstreamChangedProject;
|
|
@@ -105450,7 +105492,7 @@ var ts;
|
|
|
105450
105492
|
if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
|
|
105451
105493
|
continue;
|
|
105452
105494
|
}
|
|
105453
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
105495
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
105454
105496
|
return {
|
|
105455
105497
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
105456
105498
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -105501,24 +105543,9 @@ var ts;
|
|
|
105501
105543
|
oldestOutputFileName: oldestOutputFileName
|
|
105502
105544
|
};
|
|
105503
105545
|
}
|
|
105504
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
105505
|
-
if (seenRefs.has(resolvedRefPath))
|
|
105506
|
-
return false;
|
|
105507
|
-
seenRefs.add(resolvedRefPath);
|
|
105546
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
105508
105547
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
105509
|
-
|
|
105510
|
-
return true;
|
|
105511
|
-
if (resolvedConfig.projectReferences) {
|
|
105512
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
105513
|
-
var ref = _a[_i];
|
|
105514
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
105515
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
105516
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
105517
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
105518
|
-
return true;
|
|
105519
|
-
}
|
|
105520
|
-
}
|
|
105521
|
-
return false;
|
|
105548
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
105522
105549
|
}
|
|
105523
105550
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
105524
105551
|
if (project === undefined) {
|