typescript 4.9.0-dev.20220831 → 4.9.0-dev.20220903
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 +38 -35
- package/lib/tsserver.js +46 -44
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +45 -43
- package/lib/typescript.js +38 -36
- package/lib/typescriptServices.js +38 -36
- package/lib/typingsInstaller.js +38 -36
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220903");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -44880,7 +44880,7 @@ var ts;
|
|
|
44880
44880
|
var _a, _b;
|
|
44881
44881
|
if (path === undefined)
|
|
44882
44882
|
return path;
|
|
44883
|
-
return ts.
|
|
44883
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44884
44884
|
}
|
|
44885
44885
|
function combineDirectoryPath(root, dir) {
|
|
44886
44886
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -44900,7 +44900,7 @@ var ts;
|
|
|
44900
44900
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
44901
44901
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
44902
44902
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
44903
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
44903
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
44904
44904
|
// So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
|
|
44905
44905
|
// Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
|
|
44906
44906
|
// `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
|
|
@@ -44956,7 +44956,7 @@ var ts;
|
|
|
44956
44956
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
44957
44957
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
44958
44958
|
var candidateDir = candidateDirectories_1[_e];
|
|
44959
|
-
if (ts.
|
|
44959
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
44960
44960
|
// The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
|
|
44961
44961
|
var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
|
|
44962
44962
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
@@ -62526,7 +62526,7 @@ var ts;
|
|
|
62526
62526
|
return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
|
|
62527
62527
|
}
|
|
62528
62528
|
if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
|
|
62529
|
-
return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62529
|
+
return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62530
62530
|
}
|
|
62531
62531
|
if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
|
|
62532
62532
|
includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
|
|
@@ -63216,7 +63216,7 @@ var ts;
|
|
|
63216
63216
|
// (T | U)[K] -> T[K] | U[K] (reading)
|
|
63217
63217
|
// (T | U)[K] -> T[K] & U[K] (writing)
|
|
63218
63218
|
// (T & U)[K] -> T[K] & U[K]
|
|
63219
|
-
if (objectType.flags &
|
|
63219
|
+
if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
63220
63220
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
63221
63221
|
return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
|
|
63222
63222
|
}
|
|
@@ -65620,7 +65620,7 @@ var ts;
|
|
|
65620
65620
|
if (reduced !== type) {
|
|
65621
65621
|
return reduced;
|
|
65622
65622
|
}
|
|
65623
|
-
if (type.flags & 2097152 /* TypeFlags.Intersection */) {
|
|
65623
|
+
if (type.flags & 2097152 /* TypeFlags.Intersection */ && ts.some(type.types, isEmptyAnonymousObjectType)) {
|
|
65624
65624
|
var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
|
|
65625
65625
|
if (normalizedTypes !== type.types) {
|
|
65626
65626
|
return getIntersectionType(normalizedTypes);
|
|
@@ -71918,7 +71918,7 @@ var ts;
|
|
|
71918
71918
|
var narrowedPropType = narrowType(propType);
|
|
71919
71919
|
return filterType(type, function (t) {
|
|
71920
71920
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
71921
|
-
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) &&
|
|
71921
|
+
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
71922
71922
|
});
|
|
71923
71923
|
}
|
|
71924
71924
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -71967,7 +71967,7 @@ var ts;
|
|
|
71967
71967
|
}
|
|
71968
71968
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
71969
71969
|
if (type.flags & 1048576 /* TypeFlags.Union */
|
|
71970
|
-
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
|
|
71970
|
+
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
71971
71971
|
|| ts.isThisTypeParameter(type)
|
|
71972
71972
|
|| type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
71973
71973
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -72100,14 +72100,18 @@ var ts;
|
|
|
72100
72100
|
assumeTrue = !assumeTrue;
|
|
72101
72101
|
}
|
|
72102
72102
|
var valueType = getTypeOfExpression(value);
|
|
72103
|
-
if ((type.flags & 2 /* TypeFlags.Unknown */)
|
|
72103
|
+
if (((type.flags & 2 /* TypeFlags.Unknown */) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304 /* TypeFlags.Nullable */)) &&
|
|
72104
|
+
assumeTrue &&
|
|
72105
|
+
(operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
|
|
72104
72106
|
if (valueType.flags & (131068 /* TypeFlags.Primitive */ | 67108864 /* TypeFlags.NonPrimitive */)) {
|
|
72105
72107
|
return valueType;
|
|
72106
72108
|
}
|
|
72107
72109
|
if (valueType.flags & 524288 /* TypeFlags.Object */) {
|
|
72108
72110
|
return nonPrimitiveType;
|
|
72109
72111
|
}
|
|
72110
|
-
|
|
72112
|
+
if (type.flags & 2 /* TypeFlags.Unknown */) {
|
|
72113
|
+
return type;
|
|
72114
|
+
}
|
|
72111
72115
|
}
|
|
72112
72116
|
if (valueType.flags & 98304 /* TypeFlags.Nullable */) {
|
|
72113
72117
|
if (!strictNullChecks) {
|
|
@@ -72139,11 +72143,18 @@ var ts;
|
|
|
72139
72143
|
}
|
|
72140
72144
|
var target = getReferenceCandidate(typeOfExpr.expression);
|
|
72141
72145
|
if (!isMatchingReference(reference, target)) {
|
|
72146
|
+
var propertyAccess = getDiscriminantPropertyAccess(typeOfExpr.expression, type);
|
|
72147
|
+
if (propertyAccess) {
|
|
72148
|
+
return narrowTypeByDiscriminant(type, propertyAccess, function (t) { return narrowTypeByLiteralExpression(t, literal, assumeTrue); });
|
|
72149
|
+
}
|
|
72142
72150
|
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
72143
72151
|
return getAdjustedTypeWithFacts(type, 2097152 /* TypeFacts.NEUndefinedOrNull */);
|
|
72144
72152
|
}
|
|
72145
72153
|
return type;
|
|
72146
72154
|
}
|
|
72155
|
+
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
72156
|
+
}
|
|
72157
|
+
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
72147
72158
|
return assumeTrue ?
|
|
72148
72159
|
narrowTypeByTypeName(type, literal.text) :
|
|
72149
72160
|
getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeFacts.TypeofNEHostObject */);
|
|
@@ -74916,6 +74927,7 @@ var ts;
|
|
|
74916
74927
|
*/
|
|
74917
74928
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
74918
74929
|
var attributes = openingLikeElement.attributes;
|
|
74930
|
+
var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
|
|
74919
74931
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
74920
74932
|
var attributesTable = ts.createSymbolTable();
|
|
74921
74933
|
var spread = emptyJsxObjectType;
|
|
@@ -74943,6 +74955,12 @@ var ts;
|
|
|
74943
74955
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
74944
74956
|
explicitlySpecifyChildrenAttribute = true;
|
|
74945
74957
|
}
|
|
74958
|
+
if (attributesType) {
|
|
74959
|
+
var prop = getPropertyOfType(attributesType, member.escapedName);
|
|
74960
|
+
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
74961
|
+
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
74962
|
+
}
|
|
74963
|
+
}
|
|
74946
74964
|
}
|
|
74947
74965
|
else {
|
|
74948
74966
|
ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
|
|
@@ -120606,10 +120624,12 @@ var ts;
|
|
|
120606
120624
|
if (options.preserveConstEnums === false) {
|
|
120607
120625
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
120608
120626
|
}
|
|
120609
|
-
var
|
|
120610
|
-
|
|
120611
|
-
|
|
120612
|
-
|
|
120627
|
+
for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
|
|
120628
|
+
var file = files_5[_a];
|
|
120629
|
+
if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* ScriptKind.JSON */) {
|
|
120630
|
+
var span = ts.getErrorSpanForNode(file, file);
|
|
120631
|
+
programDiagnostics.add(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(file.fileName)));
|
|
120632
|
+
}
|
|
120613
120633
|
}
|
|
120614
120634
|
}
|
|
120615
120635
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
|
|
@@ -127390,9 +127410,7 @@ var ts;
|
|
|
127390
127410
|
}
|
|
127391
127411
|
}
|
|
127392
127412
|
}
|
|
127393
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
127394
127413
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
127395
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
127396
127414
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
127397
127415
|
var pseudoUpToDate = false;
|
|
127398
127416
|
var usesPrepend = false;
|
|
@@ -127407,7 +127425,7 @@ var ts;
|
|
|
127407
127425
|
continue;
|
|
127408
127426
|
}
|
|
127409
127427
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
127410
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127428
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
127411
127429
|
return {
|
|
127412
127430
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
127413
127431
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127465,25 +127483,9 @@ var ts;
|
|
|
127465
127483
|
oldestOutputFileName: oldestOutputFileName
|
|
127466
127484
|
};
|
|
127467
127485
|
}
|
|
127468
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127469
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127470
|
-
return false;
|
|
127471
|
-
seenRefs.add(resolvedRefPath);
|
|
127486
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127472
127487
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127473
|
-
|
|
127474
|
-
return true;
|
|
127475
|
-
if (resolvedConfig.projectReferences) {
|
|
127476
|
-
// Check references
|
|
127477
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127478
|
-
var ref = _a[_i];
|
|
127479
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127480
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127481
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127482
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127483
|
-
return true;
|
|
127484
|
-
}
|
|
127485
|
-
}
|
|
127486
|
-
return false;
|
|
127488
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127487
127489
|
}
|
|
127488
127490
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127489
127491
|
if (project === undefined) {
|
|
@@ -172210,13 +172212,13 @@ var ts;
|
|
|
172210
172212
|
return __generator(this, function (_a) {
|
|
172211
172213
|
switch (_a.label) {
|
|
172212
172214
|
case 0:
|
|
172213
|
-
ts.Debug.assertIsDefined(host.
|
|
172215
|
+
ts.Debug.assertIsDefined(host.importPlugin);
|
|
172214
172216
|
resolvedPath = ts.combinePaths(initialDir, "node_modules");
|
|
172215
172217
|
log("Dynamically importing ".concat(moduleName, " from ").concat(initialDir, " (resolved to ").concat(resolvedPath, ")"));
|
|
172216
172218
|
_a.label = 1;
|
|
172217
172219
|
case 1:
|
|
172218
172220
|
_a.trys.push([1, 3, , 4]);
|
|
172219
|
-
return [4 /*yield*/, host.
|
|
172221
|
+
return [4 /*yield*/, host.importPlugin(resolvedPath, moduleName)];
|
|
172220
172222
|
case 2:
|
|
172221
172223
|
result = _a.sent();
|
|
172222
172224
|
return [3 /*break*/, 4];
|
|
@@ -173295,7 +173297,7 @@ var ts;
|
|
|
173295
173297
|
};
|
|
173296
173298
|
Project.prototype.enableGlobalPlugins = function (options, pluginConfigOverrides) {
|
|
173297
173299
|
var host = this.projectService.host;
|
|
173298
|
-
if (!host.require && !host.
|
|
173300
|
+
if (!host.require && !host.importPlugin) {
|
|
173299
173301
|
this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
|
|
173300
173302
|
return;
|
|
173301
173303
|
}
|
|
@@ -173352,7 +173354,7 @@ var ts;
|
|
|
173352
173354
|
return __generator(this, function (_a) {
|
|
173353
173355
|
switch (_a.label) {
|
|
173354
173356
|
case 0:
|
|
173355
|
-
ts.Debug.assertIsDefined(this.projectService.host.
|
|
173357
|
+
ts.Debug.assertIsDefined(this.projectService.host.importPlugin);
|
|
173356
173358
|
log = function (message) { return _this.projectService.logger.info(message); };
|
|
173357
173359
|
logError = function (message) {
|
|
173358
173360
|
(errorLogs !== null && errorLogs !== void 0 ? errorLogs : (errorLogs = [])).push(message);
|
|
@@ -174053,7 +174055,7 @@ var ts;
|
|
|
174053
174055
|
/*@internal*/
|
|
174054
174056
|
ConfiguredProject.prototype.enablePluginsWithOptions = function (options, pluginConfigOverrides) {
|
|
174055
174057
|
var host = this.projectService.host;
|
|
174056
|
-
if (!host.require && !host.
|
|
174058
|
+
if (!host.require && !host.importPlugin) {
|
|
174057
174059
|
this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
|
|
174058
174060
|
return;
|
|
174059
174061
|
}
|
|
@@ -177497,7 +177499,7 @@ var ts;
|
|
|
177497
177499
|
/*@internal*/
|
|
177498
177500
|
ProjectService.prototype.requestEnablePlugin = function (project, pluginConfigEntry, searchPaths, pluginConfigOverrides) {
|
|
177499
177501
|
var _a;
|
|
177500
|
-
if (!this.host.
|
|
177502
|
+
if (!this.host.importPlugin && !this.host.require) {
|
|
177501
177503
|
this.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
|
|
177502
177504
|
return;
|
|
177503
177505
|
}
|
|
@@ -177507,7 +177509,7 @@ var ts;
|
|
|
177507
177509
|
return;
|
|
177508
177510
|
}
|
|
177509
177511
|
// If the host supports dynamic import, begin enabling the plugin asynchronously.
|
|
177510
|
-
if (this.host.
|
|
177512
|
+
if (this.host.importPlugin) {
|
|
177511
177513
|
var importPromise = project.beginEnablePluginAsync(pluginConfigEntry, searchPaths, pluginConfigOverrides);
|
|
177512
177514
|
(_a = this.pendingPluginEnablements) !== null && _a !== void 0 ? _a : (this.pendingPluginEnablements = new ts.Map());
|
|
177513
177515
|
var promises = this.pendingPluginEnablements.get(project);
|
package/lib/typescript.js
CHANGED
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220903");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -44871,7 +44871,7 @@ var ts;
|
|
|
44871
44871
|
var _a, _b;
|
|
44872
44872
|
if (path === undefined)
|
|
44873
44873
|
return path;
|
|
44874
|
-
return ts.
|
|
44874
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44875
44875
|
}
|
|
44876
44876
|
function combineDirectoryPath(root, dir) {
|
|
44877
44877
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -44891,7 +44891,7 @@ var ts;
|
|
|
44891
44891
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
44892
44892
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
44893
44893
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
44894
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
44894
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
44895
44895
|
// So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
|
|
44896
44896
|
// Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
|
|
44897
44897
|
// `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
|
|
@@ -44947,7 +44947,7 @@ var ts;
|
|
|
44947
44947
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
44948
44948
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
44949
44949
|
var candidateDir = candidateDirectories_1[_e];
|
|
44950
|
-
if (ts.
|
|
44950
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
44951
44951
|
// The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
|
|
44952
44952
|
var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
|
|
44953
44953
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
@@ -62517,7 +62517,7 @@ var ts;
|
|
|
62517
62517
|
return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
|
|
62518
62518
|
}
|
|
62519
62519
|
if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
|
|
62520
|
-
return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62520
|
+
return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62521
62521
|
}
|
|
62522
62522
|
if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
|
|
62523
62523
|
includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
|
|
@@ -63207,7 +63207,7 @@ var ts;
|
|
|
63207
63207
|
// (T | U)[K] -> T[K] | U[K] (reading)
|
|
63208
63208
|
// (T | U)[K] -> T[K] & U[K] (writing)
|
|
63209
63209
|
// (T & U)[K] -> T[K] & U[K]
|
|
63210
|
-
if (objectType.flags &
|
|
63210
|
+
if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
63211
63211
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
63212
63212
|
return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
|
|
63213
63213
|
}
|
|
@@ -65611,7 +65611,7 @@ var ts;
|
|
|
65611
65611
|
if (reduced !== type) {
|
|
65612
65612
|
return reduced;
|
|
65613
65613
|
}
|
|
65614
|
-
if (type.flags & 2097152 /* TypeFlags.Intersection */) {
|
|
65614
|
+
if (type.flags & 2097152 /* TypeFlags.Intersection */ && ts.some(type.types, isEmptyAnonymousObjectType)) {
|
|
65615
65615
|
var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
|
|
65616
65616
|
if (normalizedTypes !== type.types) {
|
|
65617
65617
|
return getIntersectionType(normalizedTypes);
|
|
@@ -71909,7 +71909,7 @@ var ts;
|
|
|
71909
71909
|
var narrowedPropType = narrowType(propType);
|
|
71910
71910
|
return filterType(type, function (t) {
|
|
71911
71911
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
71912
|
-
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) &&
|
|
71912
|
+
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
71913
71913
|
});
|
|
71914
71914
|
}
|
|
71915
71915
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -71958,7 +71958,7 @@ var ts;
|
|
|
71958
71958
|
}
|
|
71959
71959
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
71960
71960
|
if (type.flags & 1048576 /* TypeFlags.Union */
|
|
71961
|
-
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
|
|
71961
|
+
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
71962
71962
|
|| ts.isThisTypeParameter(type)
|
|
71963
71963
|
|| type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
71964
71964
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -72091,14 +72091,18 @@ var ts;
|
|
|
72091
72091
|
assumeTrue = !assumeTrue;
|
|
72092
72092
|
}
|
|
72093
72093
|
var valueType = getTypeOfExpression(value);
|
|
72094
|
-
if ((type.flags & 2 /* TypeFlags.Unknown */)
|
|
72094
|
+
if (((type.flags & 2 /* TypeFlags.Unknown */) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304 /* TypeFlags.Nullable */)) &&
|
|
72095
|
+
assumeTrue &&
|
|
72096
|
+
(operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
|
|
72095
72097
|
if (valueType.flags & (131068 /* TypeFlags.Primitive */ | 67108864 /* TypeFlags.NonPrimitive */)) {
|
|
72096
72098
|
return valueType;
|
|
72097
72099
|
}
|
|
72098
72100
|
if (valueType.flags & 524288 /* TypeFlags.Object */) {
|
|
72099
72101
|
return nonPrimitiveType;
|
|
72100
72102
|
}
|
|
72101
|
-
|
|
72103
|
+
if (type.flags & 2 /* TypeFlags.Unknown */) {
|
|
72104
|
+
return type;
|
|
72105
|
+
}
|
|
72102
72106
|
}
|
|
72103
72107
|
if (valueType.flags & 98304 /* TypeFlags.Nullable */) {
|
|
72104
72108
|
if (!strictNullChecks) {
|
|
@@ -72130,11 +72134,18 @@ var ts;
|
|
|
72130
72134
|
}
|
|
72131
72135
|
var target = getReferenceCandidate(typeOfExpr.expression);
|
|
72132
72136
|
if (!isMatchingReference(reference, target)) {
|
|
72137
|
+
var propertyAccess = getDiscriminantPropertyAccess(typeOfExpr.expression, type);
|
|
72138
|
+
if (propertyAccess) {
|
|
72139
|
+
return narrowTypeByDiscriminant(type, propertyAccess, function (t) { return narrowTypeByLiteralExpression(t, literal, assumeTrue); });
|
|
72140
|
+
}
|
|
72133
72141
|
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
72134
72142
|
return getAdjustedTypeWithFacts(type, 2097152 /* TypeFacts.NEUndefinedOrNull */);
|
|
72135
72143
|
}
|
|
72136
72144
|
return type;
|
|
72137
72145
|
}
|
|
72146
|
+
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
72147
|
+
}
|
|
72148
|
+
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
72138
72149
|
return assumeTrue ?
|
|
72139
72150
|
narrowTypeByTypeName(type, literal.text) :
|
|
72140
72151
|
getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeFacts.TypeofNEHostObject */);
|
|
@@ -74907,6 +74918,7 @@ var ts;
|
|
|
74907
74918
|
*/
|
|
74908
74919
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
74909
74920
|
var attributes = openingLikeElement.attributes;
|
|
74921
|
+
var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
|
|
74910
74922
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
74911
74923
|
var attributesTable = ts.createSymbolTable();
|
|
74912
74924
|
var spread = emptyJsxObjectType;
|
|
@@ -74934,6 +74946,12 @@ var ts;
|
|
|
74934
74946
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
74935
74947
|
explicitlySpecifyChildrenAttribute = true;
|
|
74936
74948
|
}
|
|
74949
|
+
if (attributesType) {
|
|
74950
|
+
var prop = getPropertyOfType(attributesType, member.escapedName);
|
|
74951
|
+
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
74952
|
+
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
74953
|
+
}
|
|
74954
|
+
}
|
|
74937
74955
|
}
|
|
74938
74956
|
else {
|
|
74939
74957
|
ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
|
|
@@ -120597,10 +120615,12 @@ var ts;
|
|
|
120597
120615
|
if (options.preserveConstEnums === false) {
|
|
120598
120616
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
120599
120617
|
}
|
|
120600
|
-
var
|
|
120601
|
-
|
|
120602
|
-
|
|
120603
|
-
|
|
120618
|
+
for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
|
|
120619
|
+
var file = files_5[_a];
|
|
120620
|
+
if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* ScriptKind.JSON */) {
|
|
120621
|
+
var span = ts.getErrorSpanForNode(file, file);
|
|
120622
|
+
programDiagnostics.add(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(file.fileName)));
|
|
120623
|
+
}
|
|
120604
120624
|
}
|
|
120605
120625
|
}
|
|
120606
120626
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
|
|
@@ -127381,9 +127401,7 @@ var ts;
|
|
|
127381
127401
|
}
|
|
127382
127402
|
}
|
|
127383
127403
|
}
|
|
127384
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
127385
127404
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
127386
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
127387
127405
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
127388
127406
|
var pseudoUpToDate = false;
|
|
127389
127407
|
var usesPrepend = false;
|
|
@@ -127398,7 +127416,7 @@ var ts;
|
|
|
127398
127416
|
continue;
|
|
127399
127417
|
}
|
|
127400
127418
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
127401
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127419
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
127402
127420
|
return {
|
|
127403
127421
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
127404
127422
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127456,25 +127474,9 @@ var ts;
|
|
|
127456
127474
|
oldestOutputFileName: oldestOutputFileName
|
|
127457
127475
|
};
|
|
127458
127476
|
}
|
|
127459
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127460
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127461
|
-
return false;
|
|
127462
|
-
seenRefs.add(resolvedRefPath);
|
|
127477
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127463
127478
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127464
|
-
|
|
127465
|
-
return true;
|
|
127466
|
-
if (resolvedConfig.projectReferences) {
|
|
127467
|
-
// Check references
|
|
127468
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127469
|
-
var ref = _a[_i];
|
|
127470
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127471
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127472
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127473
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127474
|
-
return true;
|
|
127475
|
-
}
|
|
127476
|
-
}
|
|
127477
|
-
return false;
|
|
127479
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127478
127480
|
}
|
|
127479
127481
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127480
127482
|
if (project === undefined) {
|