typescript 4.9.0-dev.20220901 → 4.9.0-dev.20220904
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 +30 -34
- package/lib/tsserver.js +30 -35
- package/lib/tsserverlibrary.js +30 -35
- package/lib/typescript.js +30 -35
- package/lib/typescriptServices.js +30 -35
- package/lib/typingsInstaller.js +30 -35
- 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.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220904");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -36780,7 +36780,7 @@ var ts;
|
|
|
36780
36780
|
var _a, _b;
|
|
36781
36781
|
if (path === undefined)
|
|
36782
36782
|
return path;
|
|
36783
|
-
return ts.
|
|
36783
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
36784
36784
|
}
|
|
36785
36785
|
function combineDirectoryPath(root, dir) {
|
|
36786
36786
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -36795,7 +36795,7 @@ var ts;
|
|
|
36795
36795
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
36796
36796
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
36797
36797
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
36798
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
36798
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
36799
36799
|
var getCanonicalFileName = ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames });
|
|
36800
36800
|
var commonSourceDirGuesses = [];
|
|
36801
36801
|
if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) {
|
|
@@ -36825,7 +36825,7 @@ var ts;
|
|
|
36825
36825
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
36826
36826
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
36827
36827
|
var candidateDir = candidateDirectories_1[_e];
|
|
36828
|
-
if (ts.
|
|
36828
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
36829
36829
|
var pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
36830
36830
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
36831
36831
|
var jsAndDtsExtensions = [".mjs", ".cjs", ".js", ".json", ".d.mts", ".d.cts", ".d.ts"];
|
|
@@ -51995,7 +51995,7 @@ var ts;
|
|
|
51995
51995
|
return includes & 8388608 ? wildcardType : anyType;
|
|
51996
51996
|
}
|
|
51997
51997
|
if (!strictNullChecks && includes & 98304) {
|
|
51998
|
-
return includes & 32768 ? undefinedType : nullType;
|
|
51998
|
+
return includes & 16777216 ? neverType : includes & 32768 ? undefinedType : nullType;
|
|
51999
51999
|
}
|
|
52000
52000
|
if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
|
|
52001
52001
|
includes & 8 && includes & 256 ||
|
|
@@ -52630,7 +52630,7 @@ var ts;
|
|
|
52630
52630
|
type;
|
|
52631
52631
|
}
|
|
52632
52632
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
52633
|
-
if (objectType.flags &
|
|
52633
|
+
if (objectType.flags & 1048576 || objectType.flags & 2097152 && !shouldDeferIndexType(objectType)) {
|
|
52634
52634
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
52635
52635
|
return objectType.flags & 2097152 || writing ? getIntersectionType(types) : getUnionType(types);
|
|
52636
52636
|
}
|
|
@@ -60174,7 +60174,7 @@ var ts;
|
|
|
60174
60174
|
var narrowedPropType = narrowType(propType);
|
|
60175
60175
|
return filterType(type, function (t) {
|
|
60176
60176
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
60177
|
-
return !(narrowedPropType.flags & 131072) &&
|
|
60177
|
+
return !(narrowedPropType.flags & 131072) && areTypesComparable(narrowedPropType, discriminantType);
|
|
60178
60178
|
});
|
|
60179
60179
|
}
|
|
60180
60180
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -60223,7 +60223,7 @@ var ts;
|
|
|
60223
60223
|
}
|
|
60224
60224
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
60225
60225
|
if (type.flags & 1048576
|
|
60226
|
-
|| type.flags & 524288 && declaredType !== type
|
|
60226
|
+
|| type.flags & 524288 && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
60227
60227
|
|| ts.isThisTypeParameter(type)
|
|
60228
60228
|
|| type.flags & 2097152 && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
60229
60229
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -60343,14 +60343,18 @@ var ts;
|
|
|
60343
60343
|
assumeTrue = !assumeTrue;
|
|
60344
60344
|
}
|
|
60345
60345
|
var valueType = getTypeOfExpression(value);
|
|
60346
|
-
if ((type.flags & 2)
|
|
60346
|
+
if (((type.flags & 2) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304)) &&
|
|
60347
|
+
assumeTrue &&
|
|
60348
|
+
(operator === 36 || operator === 37)) {
|
|
60347
60349
|
if (valueType.flags & (131068 | 67108864)) {
|
|
60348
60350
|
return valueType;
|
|
60349
60351
|
}
|
|
60350
60352
|
if (valueType.flags & 524288) {
|
|
60351
60353
|
return nonPrimitiveType;
|
|
60352
60354
|
}
|
|
60353
|
-
|
|
60355
|
+
if (type.flags & 2) {
|
|
60356
|
+
return type;
|
|
60357
|
+
}
|
|
60354
60358
|
}
|
|
60355
60359
|
if (valueType.flags & 98304) {
|
|
60356
60360
|
if (!strictNullChecks) {
|
|
@@ -62700,6 +62704,7 @@ var ts;
|
|
|
62700
62704
|
}
|
|
62701
62705
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
62702
62706
|
var attributes = openingLikeElement.attributes;
|
|
62707
|
+
var attributesType = getContextualType(attributes, 0);
|
|
62703
62708
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
62704
62709
|
var attributesTable = ts.createSymbolTable();
|
|
62705
62710
|
var spread = emptyJsxObjectType;
|
|
@@ -62727,6 +62732,12 @@ var ts;
|
|
|
62727
62732
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
62728
62733
|
explicitlySpecifyChildrenAttribute = true;
|
|
62729
62734
|
}
|
|
62735
|
+
if (attributesType) {
|
|
62736
|
+
var prop = getPropertyOfType(attributesType, member.escapedName);
|
|
62737
|
+
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
62738
|
+
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
62739
|
+
}
|
|
62740
|
+
}
|
|
62730
62741
|
}
|
|
62731
62742
|
else {
|
|
62732
62743
|
ts.Debug.assert(attributeDecl.kind === 289);
|
|
@@ -99894,10 +99905,12 @@ var ts;
|
|
|
99894
99905
|
if (options.preserveConstEnums === false) {
|
|
99895
99906
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
99896
99907
|
}
|
|
99897
|
-
var
|
|
99898
|
-
|
|
99899
|
-
|
|
99900
|
-
|
|
99908
|
+
for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
|
|
99909
|
+
var file = files_5[_a];
|
|
99910
|
+
if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6) {
|
|
99911
|
+
var span = ts.getErrorSpanForNode(file, file);
|
|
99912
|
+
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)));
|
|
99913
|
+
}
|
|
99901
99914
|
}
|
|
99902
99915
|
}
|
|
99903
99916
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) {
|
|
@@ -105882,9 +105895,7 @@ var ts;
|
|
|
105882
105895
|
}
|
|
105883
105896
|
}
|
|
105884
105897
|
}
|
|
105885
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
105886
105898
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
105887
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
105888
105899
|
var pseudoUpToDate = false;
|
|
105889
105900
|
var usesPrepend = false;
|
|
105890
105901
|
var upstreamChangedProject;
|
|
@@ -105895,7 +105906,7 @@ var ts;
|
|
|
105895
105906
|
if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
|
|
105896
105907
|
continue;
|
|
105897
105908
|
}
|
|
105898
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
105909
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
105899
105910
|
return {
|
|
105900
105911
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
105901
105912
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -105946,24 +105957,9 @@ var ts;
|
|
|
105946
105957
|
oldestOutputFileName: oldestOutputFileName
|
|
105947
105958
|
};
|
|
105948
105959
|
}
|
|
105949
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
105950
|
-
if (seenRefs.has(resolvedRefPath))
|
|
105951
|
-
return false;
|
|
105952
|
-
seenRefs.add(resolvedRefPath);
|
|
105960
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
105953
105961
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
105954
|
-
|
|
105955
|
-
return true;
|
|
105956
|
-
if (resolvedConfig.projectReferences) {
|
|
105957
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
105958
|
-
var ref = _a[_i];
|
|
105959
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
105960
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
105961
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
105962
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
105963
|
-
return true;
|
|
105964
|
-
}
|
|
105965
|
-
}
|
|
105966
|
-
return false;
|
|
105962
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
105967
105963
|
}
|
|
105968
105964
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
105969
105965
|
if (project === undefined) {
|
package/lib/tsserver.js
CHANGED
|
@@ -109,7 +109,7 @@ var ts;
|
|
|
109
109
|
// The following is baselined as a literal template type without intervention
|
|
110
110
|
/** The version of the TypeScript compiler release */
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
112
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
112
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220904");
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -44881,7 +44881,7 @@ var ts;
|
|
|
44881
44881
|
var _a, _b;
|
|
44882
44882
|
if (path === undefined)
|
|
44883
44883
|
return path;
|
|
44884
|
-
return ts.
|
|
44884
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44885
44885
|
}
|
|
44886
44886
|
function combineDirectoryPath(root, dir) {
|
|
44887
44887
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -44901,7 +44901,7 @@ var ts;
|
|
|
44901
44901
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
44902
44902
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
44903
44903
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
44904
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
44904
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
44905
44905
|
// 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.
|
|
44906
44906
|
// Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
|
|
44907
44907
|
// `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
|
|
@@ -44957,7 +44957,7 @@ var ts;
|
|
|
44957
44957
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
44958
44958
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
44959
44959
|
var candidateDir = candidateDirectories_1[_e];
|
|
44960
|
-
if (ts.
|
|
44960
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
44961
44961
|
// 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
|
|
44962
44962
|
var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
|
|
44963
44963
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
@@ -62527,7 +62527,7 @@ var ts;
|
|
|
62527
62527
|
return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
|
|
62528
62528
|
}
|
|
62529
62529
|
if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
|
|
62530
|
-
return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62530
|
+
return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62531
62531
|
}
|
|
62532
62532
|
if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
|
|
62533
62533
|
includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
|
|
@@ -63217,7 +63217,7 @@ var ts;
|
|
|
63217
63217
|
// (T | U)[K] -> T[K] | U[K] (reading)
|
|
63218
63218
|
// (T | U)[K] -> T[K] & U[K] (writing)
|
|
63219
63219
|
// (T & U)[K] -> T[K] & U[K]
|
|
63220
|
-
if (objectType.flags &
|
|
63220
|
+
if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
63221
63221
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
63222
63222
|
return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
|
|
63223
63223
|
}
|
|
@@ -71919,7 +71919,7 @@ var ts;
|
|
|
71919
71919
|
var narrowedPropType = narrowType(propType);
|
|
71920
71920
|
return filterType(type, function (t) {
|
|
71921
71921
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
71922
|
-
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) &&
|
|
71922
|
+
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
71923
71923
|
});
|
|
71924
71924
|
}
|
|
71925
71925
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -71968,7 +71968,7 @@ var ts;
|
|
|
71968
71968
|
}
|
|
71969
71969
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
71970
71970
|
if (type.flags & 1048576 /* TypeFlags.Union */
|
|
71971
|
-
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
|
|
71971
|
+
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
71972
71972
|
|| ts.isThisTypeParameter(type)
|
|
71973
71973
|
|| type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
71974
71974
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -72101,14 +72101,18 @@ var ts;
|
|
|
72101
72101
|
assumeTrue = !assumeTrue;
|
|
72102
72102
|
}
|
|
72103
72103
|
var valueType = getTypeOfExpression(value);
|
|
72104
|
-
if ((type.flags & 2 /* TypeFlags.Unknown */)
|
|
72104
|
+
if (((type.flags & 2 /* TypeFlags.Unknown */) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304 /* TypeFlags.Nullable */)) &&
|
|
72105
|
+
assumeTrue &&
|
|
72106
|
+
(operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
|
|
72105
72107
|
if (valueType.flags & (131068 /* TypeFlags.Primitive */ | 67108864 /* TypeFlags.NonPrimitive */)) {
|
|
72106
72108
|
return valueType;
|
|
72107
72109
|
}
|
|
72108
72110
|
if (valueType.flags & 524288 /* TypeFlags.Object */) {
|
|
72109
72111
|
return nonPrimitiveType;
|
|
72110
72112
|
}
|
|
72111
|
-
|
|
72113
|
+
if (type.flags & 2 /* TypeFlags.Unknown */) {
|
|
72114
|
+
return type;
|
|
72115
|
+
}
|
|
72112
72116
|
}
|
|
72113
72117
|
if (valueType.flags & 98304 /* TypeFlags.Nullable */) {
|
|
72114
72118
|
if (!strictNullChecks) {
|
|
@@ -74924,6 +74928,7 @@ var ts;
|
|
|
74924
74928
|
*/
|
|
74925
74929
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
74926
74930
|
var attributes = openingLikeElement.attributes;
|
|
74931
|
+
var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
|
|
74927
74932
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
74928
74933
|
var attributesTable = ts.createSymbolTable();
|
|
74929
74934
|
var spread = emptyJsxObjectType;
|
|
@@ -74951,6 +74956,12 @@ var ts;
|
|
|
74951
74956
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
74952
74957
|
explicitlySpecifyChildrenAttribute = true;
|
|
74953
74958
|
}
|
|
74959
|
+
if (attributesType) {
|
|
74960
|
+
var prop = getPropertyOfType(attributesType, member.escapedName);
|
|
74961
|
+
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
74962
|
+
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
74963
|
+
}
|
|
74964
|
+
}
|
|
74954
74965
|
}
|
|
74955
74966
|
else {
|
|
74956
74967
|
ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
|
|
@@ -120614,10 +120625,12 @@ var ts;
|
|
|
120614
120625
|
if (options.preserveConstEnums === false) {
|
|
120615
120626
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
120616
120627
|
}
|
|
120617
|
-
var
|
|
120618
|
-
|
|
120619
|
-
|
|
120620
|
-
|
|
120628
|
+
for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
|
|
120629
|
+
var file = files_5[_a];
|
|
120630
|
+
if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* ScriptKind.JSON */) {
|
|
120631
|
+
var span = ts.getErrorSpanForNode(file, file);
|
|
120632
|
+
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)));
|
|
120633
|
+
}
|
|
120621
120634
|
}
|
|
120622
120635
|
}
|
|
120623
120636
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
|
|
@@ -127398,9 +127411,7 @@ var ts;
|
|
|
127398
127411
|
}
|
|
127399
127412
|
}
|
|
127400
127413
|
}
|
|
127401
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
127402
127414
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
127403
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
127404
127415
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
127405
127416
|
var pseudoUpToDate = false;
|
|
127406
127417
|
var usesPrepend = false;
|
|
@@ -127415,7 +127426,7 @@ var ts;
|
|
|
127415
127426
|
continue;
|
|
127416
127427
|
}
|
|
127417
127428
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
127418
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127429
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
127419
127430
|
return {
|
|
127420
127431
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
127421
127432
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127473,25 +127484,9 @@ var ts;
|
|
|
127473
127484
|
oldestOutputFileName: oldestOutputFileName
|
|
127474
127485
|
};
|
|
127475
127486
|
}
|
|
127476
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127477
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127478
|
-
return false;
|
|
127479
|
-
seenRefs.add(resolvedRefPath);
|
|
127487
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127480
127488
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127481
|
-
|
|
127482
|
-
return true;
|
|
127483
|
-
if (resolvedConfig.projectReferences) {
|
|
127484
|
-
// Check references
|
|
127485
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127486
|
-
var ref = _a[_i];
|
|
127487
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127488
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127489
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127490
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127491
|
-
return true;
|
|
127492
|
-
}
|
|
127493
|
-
}
|
|
127494
|
-
return false;
|
|
127489
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127495
127490
|
}
|
|
127496
127491
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127497
127492
|
if (project === undefined) {
|
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.20220904");
|
|
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
|
}
|
|
@@ -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) {
|
|
@@ -74923,6 +74927,7 @@ var ts;
|
|
|
74923
74927
|
*/
|
|
74924
74928
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
74925
74929
|
var attributes = openingLikeElement.attributes;
|
|
74930
|
+
var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
|
|
74926
74931
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
74927
74932
|
var attributesTable = ts.createSymbolTable();
|
|
74928
74933
|
var spread = emptyJsxObjectType;
|
|
@@ -74950,6 +74955,12 @@ var ts;
|
|
|
74950
74955
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
74951
74956
|
explicitlySpecifyChildrenAttribute = true;
|
|
74952
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
|
+
}
|
|
74953
74964
|
}
|
|
74954
74965
|
else {
|
|
74955
74966
|
ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
|
|
@@ -120613,10 +120624,12 @@ var ts;
|
|
|
120613
120624
|
if (options.preserveConstEnums === false) {
|
|
120614
120625
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
120615
120626
|
}
|
|
120616
|
-
var
|
|
120617
|
-
|
|
120618
|
-
|
|
120619
|
-
|
|
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
|
+
}
|
|
120620
120633
|
}
|
|
120621
120634
|
}
|
|
120622
120635
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
|
|
@@ -127397,9 +127410,7 @@ var ts;
|
|
|
127397
127410
|
}
|
|
127398
127411
|
}
|
|
127399
127412
|
}
|
|
127400
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
127401
127413
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
127402
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
127403
127414
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
127404
127415
|
var pseudoUpToDate = false;
|
|
127405
127416
|
var usesPrepend = false;
|
|
@@ -127414,7 +127425,7 @@ var ts;
|
|
|
127414
127425
|
continue;
|
|
127415
127426
|
}
|
|
127416
127427
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
127417
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127428
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
127418
127429
|
return {
|
|
127419
127430
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
127420
127431
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127472,25 +127483,9 @@ var ts;
|
|
|
127472
127483
|
oldestOutputFileName: oldestOutputFileName
|
|
127473
127484
|
};
|
|
127474
127485
|
}
|
|
127475
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127476
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127477
|
-
return false;
|
|
127478
|
-
seenRefs.add(resolvedRefPath);
|
|
127486
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127479
127487
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127480
|
-
|
|
127481
|
-
return true;
|
|
127482
|
-
if (resolvedConfig.projectReferences) {
|
|
127483
|
-
// Check references
|
|
127484
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127485
|
-
var ref = _a[_i];
|
|
127486
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127487
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127488
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127489
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127490
|
-
return true;
|
|
127491
|
-
}
|
|
127492
|
-
}
|
|
127493
|
-
return false;
|
|
127488
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127494
127489
|
}
|
|
127495
127490
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127496
127491
|
if (project === undefined) {
|
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.20220904");
|
|
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
|
}
|
|
@@ -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) {
|
|
@@ -74914,6 +74918,7 @@ var ts;
|
|
|
74914
74918
|
*/
|
|
74915
74919
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
74916
74920
|
var attributes = openingLikeElement.attributes;
|
|
74921
|
+
var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
|
|
74917
74922
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
74918
74923
|
var attributesTable = ts.createSymbolTable();
|
|
74919
74924
|
var spread = emptyJsxObjectType;
|
|
@@ -74941,6 +74946,12 @@ var ts;
|
|
|
74941
74946
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
74942
74947
|
explicitlySpecifyChildrenAttribute = true;
|
|
74943
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
|
+
}
|
|
74944
74955
|
}
|
|
74945
74956
|
else {
|
|
74946
74957
|
ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
|
|
@@ -120604,10 +120615,12 @@ var ts;
|
|
|
120604
120615
|
if (options.preserveConstEnums === false) {
|
|
120605
120616
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
120606
120617
|
}
|
|
120607
|
-
var
|
|
120608
|
-
|
|
120609
|
-
|
|
120610
|
-
|
|
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
|
+
}
|
|
120611
120624
|
}
|
|
120612
120625
|
}
|
|
120613
120626
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
|
|
@@ -127388,9 +127401,7 @@ var ts;
|
|
|
127388
127401
|
}
|
|
127389
127402
|
}
|
|
127390
127403
|
}
|
|
127391
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
127392
127404
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
127393
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
127394
127405
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
127395
127406
|
var pseudoUpToDate = false;
|
|
127396
127407
|
var usesPrepend = false;
|
|
@@ -127405,7 +127416,7 @@ var ts;
|
|
|
127405
127416
|
continue;
|
|
127406
127417
|
}
|
|
127407
127418
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
127408
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127419
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
127409
127420
|
return {
|
|
127410
127421
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
127411
127422
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127463,25 +127474,9 @@ var ts;
|
|
|
127463
127474
|
oldestOutputFileName: oldestOutputFileName
|
|
127464
127475
|
};
|
|
127465
127476
|
}
|
|
127466
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127467
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127468
|
-
return false;
|
|
127469
|
-
seenRefs.add(resolvedRefPath);
|
|
127477
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127470
127478
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127471
|
-
|
|
127472
|
-
return true;
|
|
127473
|
-
if (resolvedConfig.projectReferences) {
|
|
127474
|
-
// Check references
|
|
127475
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127476
|
-
var ref = _a[_i];
|
|
127477
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127478
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127479
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127480
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127481
|
-
return true;
|
|
127482
|
-
}
|
|
127483
|
-
}
|
|
127484
|
-
return false;
|
|
127479
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127485
127480
|
}
|
|
127486
127481
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127487
127482
|
if (project === undefined) {
|
|
@@ -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.20220904");
|
|
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
|
}
|
|
@@ -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) {
|
|
@@ -74914,6 +74918,7 @@ var ts;
|
|
|
74914
74918
|
*/
|
|
74915
74919
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
74916
74920
|
var attributes = openingLikeElement.attributes;
|
|
74921
|
+
var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
|
|
74917
74922
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
74918
74923
|
var attributesTable = ts.createSymbolTable();
|
|
74919
74924
|
var spread = emptyJsxObjectType;
|
|
@@ -74941,6 +74946,12 @@ var ts;
|
|
|
74941
74946
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
74942
74947
|
explicitlySpecifyChildrenAttribute = true;
|
|
74943
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
|
+
}
|
|
74944
74955
|
}
|
|
74945
74956
|
else {
|
|
74946
74957
|
ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
|
|
@@ -120604,10 +120615,12 @@ var ts;
|
|
|
120604
120615
|
if (options.preserveConstEnums === false) {
|
|
120605
120616
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
120606
120617
|
}
|
|
120607
|
-
var
|
|
120608
|
-
|
|
120609
|
-
|
|
120610
|
-
|
|
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
|
+
}
|
|
120611
120624
|
}
|
|
120612
120625
|
}
|
|
120613
120626
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
|
|
@@ -127388,9 +127401,7 @@ var ts;
|
|
|
127388
127401
|
}
|
|
127389
127402
|
}
|
|
127390
127403
|
}
|
|
127391
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
127392
127404
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
127393
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
127394
127405
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
127395
127406
|
var pseudoUpToDate = false;
|
|
127396
127407
|
var usesPrepend = false;
|
|
@@ -127405,7 +127416,7 @@ var ts;
|
|
|
127405
127416
|
continue;
|
|
127406
127417
|
}
|
|
127407
127418
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
127408
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127419
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
127409
127420
|
return {
|
|
127410
127421
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
127411
127422
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127463,25 +127474,9 @@ var ts;
|
|
|
127463
127474
|
oldestOutputFileName: oldestOutputFileName
|
|
127464
127475
|
};
|
|
127465
127476
|
}
|
|
127466
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127467
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127468
|
-
return false;
|
|
127469
|
-
seenRefs.add(resolvedRefPath);
|
|
127477
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127470
127478
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127471
|
-
|
|
127472
|
-
return true;
|
|
127473
|
-
if (resolvedConfig.projectReferences) {
|
|
127474
|
-
// Check references
|
|
127475
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127476
|
-
var ref = _a[_i];
|
|
127477
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127478
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127479
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127480
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127481
|
-
return true;
|
|
127482
|
-
}
|
|
127483
|
-
}
|
|
127484
|
-
return false;
|
|
127479
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127485
127480
|
}
|
|
127486
127481
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127487
127482
|
if (project === undefined) {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220904");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -44861,7 +44861,7 @@ var ts;
|
|
|
44861
44861
|
var _a, _b;
|
|
44862
44862
|
if (path === undefined)
|
|
44863
44863
|
return path;
|
|
44864
|
-
return ts.
|
|
44864
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44865
44865
|
}
|
|
44866
44866
|
function combineDirectoryPath(root, dir) {
|
|
44867
44867
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -44881,7 +44881,7 @@ var ts;
|
|
|
44881
44881
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
44882
44882
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
44883
44883
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
44884
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
44884
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
44885
44885
|
// 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.
|
|
44886
44886
|
// Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
|
|
44887
44887
|
// `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
|
|
@@ -44937,7 +44937,7 @@ var ts;
|
|
|
44937
44937
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
44938
44938
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
44939
44939
|
var candidateDir = candidateDirectories_1[_e];
|
|
44940
|
-
if (ts.
|
|
44940
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
44941
44941
|
// 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
|
|
44942
44942
|
var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
|
|
44943
44943
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
@@ -62507,7 +62507,7 @@ var ts;
|
|
|
62507
62507
|
return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
|
|
62508
62508
|
}
|
|
62509
62509
|
if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
|
|
62510
|
-
return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62510
|
+
return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62511
62511
|
}
|
|
62512
62512
|
if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
|
|
62513
62513
|
includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
|
|
@@ -63197,7 +63197,7 @@ var ts;
|
|
|
63197
63197
|
// (T | U)[K] -> T[K] | U[K] (reading)
|
|
63198
63198
|
// (T | U)[K] -> T[K] & U[K] (writing)
|
|
63199
63199
|
// (T & U)[K] -> T[K] & U[K]
|
|
63200
|
-
if (objectType.flags &
|
|
63200
|
+
if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
63201
63201
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
63202
63202
|
return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
|
|
63203
63203
|
}
|
|
@@ -71899,7 +71899,7 @@ var ts;
|
|
|
71899
71899
|
var narrowedPropType = narrowType(propType);
|
|
71900
71900
|
return filterType(type, function (t) {
|
|
71901
71901
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
71902
|
-
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) &&
|
|
71902
|
+
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
71903
71903
|
});
|
|
71904
71904
|
}
|
|
71905
71905
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -71948,7 +71948,7 @@ var ts;
|
|
|
71948
71948
|
}
|
|
71949
71949
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
71950
71950
|
if (type.flags & 1048576 /* TypeFlags.Union */
|
|
71951
|
-
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
|
|
71951
|
+
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
71952
71952
|
|| ts.isThisTypeParameter(type)
|
|
71953
71953
|
|| type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
71954
71954
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -72081,14 +72081,18 @@ var ts;
|
|
|
72081
72081
|
assumeTrue = !assumeTrue;
|
|
72082
72082
|
}
|
|
72083
72083
|
var valueType = getTypeOfExpression(value);
|
|
72084
|
-
if ((type.flags & 2 /* TypeFlags.Unknown */)
|
|
72084
|
+
if (((type.flags & 2 /* TypeFlags.Unknown */) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304 /* TypeFlags.Nullable */)) &&
|
|
72085
|
+
assumeTrue &&
|
|
72086
|
+
(operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
|
|
72085
72087
|
if (valueType.flags & (131068 /* TypeFlags.Primitive */ | 67108864 /* TypeFlags.NonPrimitive */)) {
|
|
72086
72088
|
return valueType;
|
|
72087
72089
|
}
|
|
72088
72090
|
if (valueType.flags & 524288 /* TypeFlags.Object */) {
|
|
72089
72091
|
return nonPrimitiveType;
|
|
72090
72092
|
}
|
|
72091
|
-
|
|
72093
|
+
if (type.flags & 2 /* TypeFlags.Unknown */) {
|
|
72094
|
+
return type;
|
|
72095
|
+
}
|
|
72092
72096
|
}
|
|
72093
72097
|
if (valueType.flags & 98304 /* TypeFlags.Nullable */) {
|
|
72094
72098
|
if (!strictNullChecks) {
|
|
@@ -74904,6 +74908,7 @@ var ts;
|
|
|
74904
74908
|
*/
|
|
74905
74909
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
74906
74910
|
var attributes = openingLikeElement.attributes;
|
|
74911
|
+
var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
|
|
74907
74912
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
74908
74913
|
var attributesTable = ts.createSymbolTable();
|
|
74909
74914
|
var spread = emptyJsxObjectType;
|
|
@@ -74931,6 +74936,12 @@ var ts;
|
|
|
74931
74936
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
74932
74937
|
explicitlySpecifyChildrenAttribute = true;
|
|
74933
74938
|
}
|
|
74939
|
+
if (attributesType) {
|
|
74940
|
+
var prop = getPropertyOfType(attributesType, member.escapedName);
|
|
74941
|
+
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
74942
|
+
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
74943
|
+
}
|
|
74944
|
+
}
|
|
74934
74945
|
}
|
|
74935
74946
|
else {
|
|
74936
74947
|
ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
|
|
@@ -120594,10 +120605,12 @@ var ts;
|
|
|
120594
120605
|
if (options.preserveConstEnums === false) {
|
|
120595
120606
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
120596
120607
|
}
|
|
120597
|
-
var
|
|
120598
|
-
|
|
120599
|
-
|
|
120600
|
-
|
|
120608
|
+
for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
|
|
120609
|
+
var file = files_5[_a];
|
|
120610
|
+
if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* ScriptKind.JSON */) {
|
|
120611
|
+
var span = ts.getErrorSpanForNode(file, file);
|
|
120612
|
+
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)));
|
|
120613
|
+
}
|
|
120601
120614
|
}
|
|
120602
120615
|
}
|
|
120603
120616
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
|
|
@@ -127378,9 +127391,7 @@ var ts;
|
|
|
127378
127391
|
}
|
|
127379
127392
|
}
|
|
127380
127393
|
}
|
|
127381
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
127382
127394
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
127383
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
127384
127395
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
127385
127396
|
var pseudoUpToDate = false;
|
|
127386
127397
|
var usesPrepend = false;
|
|
@@ -127395,7 +127406,7 @@ var ts;
|
|
|
127395
127406
|
continue;
|
|
127396
127407
|
}
|
|
127397
127408
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
127398
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127409
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
127399
127410
|
return {
|
|
127400
127411
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
127401
127412
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127453,25 +127464,9 @@ var ts;
|
|
|
127453
127464
|
oldestOutputFileName: oldestOutputFileName
|
|
127454
127465
|
};
|
|
127455
127466
|
}
|
|
127456
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127457
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127458
|
-
return false;
|
|
127459
|
-
seenRefs.add(resolvedRefPath);
|
|
127467
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127460
127468
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127461
|
-
|
|
127462
|
-
return true;
|
|
127463
|
-
if (resolvedConfig.projectReferences) {
|
|
127464
|
-
// Check references
|
|
127465
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127466
|
-
var ref = _a[_i];
|
|
127467
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127468
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127469
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127470
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127471
|
-
return true;
|
|
127472
|
-
}
|
|
127473
|
-
}
|
|
127474
|
-
return false;
|
|
127469
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127475
127470
|
}
|
|
127476
127471
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127477
127472
|
if (project === undefined) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.9.0-dev.
|
|
5
|
+
"version": "4.9.0-dev.20220904",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|