typescript 4.9.3 → 4.9.5
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 +32 -19
- package/lib/tsserver.js +40 -19
- package/lib/tsserverlibrary.js +40 -19
- package/lib/typescript.js +40 -19
- package/lib/typescriptServices.js +40 -19
- package/lib/typingsInstaller.js +40 -19
- 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, ".
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".5");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -33654,7 +33654,12 @@ var ts;
|
|
|
33654
33654
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
33655
33655
|
category: ts.Diagnostics.Language_and_Environment,
|
|
33656
33656
|
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
33657
|
-
}
|
|
33657
|
+
},
|
|
33658
|
+
{
|
|
33659
|
+
name: "ignoreDeprecations",
|
|
33660
|
+
type: "string",
|
|
33661
|
+
defaultValueDescription: undefined,
|
|
33662
|
+
},
|
|
33658
33663
|
];
|
|
33659
33664
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
33660
33665
|
ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });
|
|
@@ -57536,7 +57541,8 @@ var ts;
|
|
|
57536
57541
|
return !!(type.flags & 109440);
|
|
57537
57542
|
}
|
|
57538
57543
|
function isUnitLikeType(type) {
|
|
57539
|
-
|
|
57544
|
+
var t = getBaseConstraintOrType(type);
|
|
57545
|
+
return t.flags & 2097152 ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
57540
57546
|
}
|
|
57541
57547
|
function extractUnitType(type) {
|
|
57542
57548
|
return type.flags & 2097152 ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -66236,11 +66242,11 @@ var ts;
|
|
|
66236
66242
|
}
|
|
66237
66243
|
function checkSatisfiesExpression(node) {
|
|
66238
66244
|
checkSourceElement(node.type);
|
|
66245
|
+
var exprType = checkExpression(node.expression);
|
|
66239
66246
|
var targetType = getTypeFromTypeNode(node.type);
|
|
66240
66247
|
if (isErrorType(targetType)) {
|
|
66241
66248
|
return targetType;
|
|
66242
66249
|
}
|
|
66243
|
-
var exprType = checkExpression(node.expression);
|
|
66244
66250
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
66245
66251
|
return exprType;
|
|
66246
66252
|
}
|
|
@@ -77596,8 +77602,8 @@ var ts;
|
|
|
77596
77602
|
_a[302] = function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
77597
77603
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
77598
77604
|
},
|
|
77599
|
-
_a[308] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
77600
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
77605
|
+
_a[308] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
77606
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
77601
77607
|
},
|
|
77602
77608
|
_a[353] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
77603
77609
|
return context.factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
@@ -104328,7 +104334,7 @@ var ts;
|
|
|
104328
104334
|
function getLocaleTimeString(system) {
|
|
104329
104335
|
return !system.now ?
|
|
104330
104336
|
new Date().toLocaleTimeString() :
|
|
104331
|
-
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" });
|
|
104337
|
+
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202f", " ");
|
|
104332
104338
|
}
|
|
104333
104339
|
ts.getLocaleTimeString = getLocaleTimeString;
|
|
104334
104340
|
function createWatchStatusReporter(system, pretty) {
|
|
@@ -104718,12 +104724,13 @@ var ts;
|
|
|
104718
104724
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
104719
104725
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
104720
104726
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
104721
|
-
|
|
104727
|
+
var compilerHost = {
|
|
104722
104728
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
104723
104729
|
var text;
|
|
104724
104730
|
try {
|
|
104725
104731
|
ts.performance.mark("beforeIORead");
|
|
104726
|
-
|
|
104732
|
+
var encoding = getCompilerOptions().charset;
|
|
104733
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
104727
104734
|
ts.performance.mark("afterIORead");
|
|
104728
104735
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
104729
104736
|
}
|
|
@@ -104754,6 +104761,7 @@ var ts;
|
|
|
104754
104761
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
104755
104762
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
104756
104763
|
};
|
|
104764
|
+
return compilerHost;
|
|
104757
104765
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
104758
104766
|
try {
|
|
104759
104767
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -104769,9 +104777,9 @@ var ts;
|
|
|
104769
104777
|
}
|
|
104770
104778
|
}
|
|
104771
104779
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
104772
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
104780
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
104773
104781
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
104774
|
-
var computeHash = ts.maybeBind(
|
|
104782
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
104775
104783
|
compilerHost.getSourceFile = function () {
|
|
104776
104784
|
var args = [];
|
|
104777
104785
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -104887,7 +104895,7 @@ var ts;
|
|
|
104887
104895
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
104888
104896
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
104889
104897
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
104890
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
104898
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
104891
104899
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
104892
104900
|
return host;
|
|
104893
104901
|
}
|
|
@@ -104972,7 +104980,7 @@ var ts;
|
|
|
104972
104980
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
104973
104981
|
}
|
|
104974
104982
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
104975
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
104983
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
104976
104984
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
104977
104985
|
compilerHost.getSourceFile = function (fileName) {
|
|
104978
104986
|
var args = [];
|
|
@@ -105092,8 +105100,8 @@ var ts;
|
|
|
105092
105100
|
}
|
|
105093
105101
|
}
|
|
105094
105102
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
105095
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
105096
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
105103
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
105104
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
105097
105105
|
if (hasChangedConfigFileParsingErrors) {
|
|
105098
105106
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
105099
105107
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -105218,9 +105226,14 @@ var ts;
|
|
|
105218
105226
|
}
|
|
105219
105227
|
}
|
|
105220
105228
|
}
|
|
105221
|
-
function getSourceVersion(path) {
|
|
105229
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
105222
105230
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
105223
|
-
|
|
105231
|
+
if (!hostSourceFile)
|
|
105232
|
+
return undefined;
|
|
105233
|
+
if (hostSourceFile.version)
|
|
105234
|
+
return hostSourceFile.version;
|
|
105235
|
+
var text = readFileWithCache(path);
|
|
105236
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
105224
105237
|
}
|
|
105225
105238
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
105226
105239
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -105652,7 +105665,7 @@ var ts;
|
|
|
105652
105665
|
var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
105653
105666
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
105654
105667
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
105655
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
105668
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
105656
105669
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
105657
105670
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
105658
105671
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -106634,7 +106647,7 @@ var ts;
|
|
|
106634
106647
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
106635
106648
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
106636
106649
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
106637
|
-
currentVersion = text
|
|
106650
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
106638
106651
|
if (version_3 && version_3 === currentVersion)
|
|
106639
106652
|
pseudoInputUpToDate = true;
|
|
106640
106653
|
}
|
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, ".
|
|
112
|
+
ts.version = "".concat(ts.versionMajorMinor, ".5");
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -41291,7 +41291,12 @@ var ts;
|
|
|
41291
41291
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
41292
41292
|
category: ts.Diagnostics.Language_and_Environment,
|
|
41293
41293
|
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
41294
|
-
}
|
|
41294
|
+
},
|
|
41295
|
+
{
|
|
41296
|
+
name: "ignoreDeprecations",
|
|
41297
|
+
type: "string",
|
|
41298
|
+
defaultValueDescription: undefined,
|
|
41299
|
+
},
|
|
41295
41300
|
];
|
|
41296
41301
|
/* @internal */
|
|
41297
41302
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
@@ -68904,7 +68909,10 @@ var ts;
|
|
|
68904
68909
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68905
68910
|
}
|
|
68906
68911
|
function isUnitLikeType(type) {
|
|
68907
|
-
|
|
68912
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68913
|
+
var t = getBaseConstraintOrType(type);
|
|
68914
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68915
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68908
68916
|
}
|
|
68909
68917
|
function extractUnitType(type) {
|
|
68910
68918
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79084,11 +79092,11 @@ var ts;
|
|
|
79084
79092
|
}
|
|
79085
79093
|
function checkSatisfiesExpression(node) {
|
|
79086
79094
|
checkSourceElement(node.type);
|
|
79095
|
+
var exprType = checkExpression(node.expression);
|
|
79087
79096
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79088
79097
|
if (isErrorType(targetType)) {
|
|
79089
79098
|
return targetType;
|
|
79090
79099
|
}
|
|
79091
|
-
var exprType = checkExpression(node.expression);
|
|
79092
79100
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79093
79101
|
return exprType;
|
|
79094
79102
|
}
|
|
@@ -91973,8 +91981,8 @@ var ts;
|
|
|
91973
91981
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91974
91982
|
},
|
|
91975
91983
|
// Top-level nodes
|
|
91976
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91977
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91984
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91985
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91978
91986
|
},
|
|
91979
91987
|
// Transformation nodes
|
|
91980
91988
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -125795,7 +125803,12 @@ var ts;
|
|
|
125795
125803
|
function getLocaleTimeString(system) {
|
|
125796
125804
|
return !system.now ?
|
|
125797
125805
|
new Date().toLocaleTimeString() :
|
|
125798
|
-
|
|
125806
|
+
// On some systems / builds of Node, there's a non-breaking space between the time and AM/PM.
|
|
125807
|
+
// This branch is solely for testing, so just switch it to a normal space for baseline stability.
|
|
125808
|
+
// See:
|
|
125809
|
+
// - https://github.com/nodejs/node/issues/45171
|
|
125810
|
+
// - https://github.com/nodejs/node/issues/45753
|
|
125811
|
+
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202f", " ");
|
|
125799
125812
|
}
|
|
125800
125813
|
ts.getLocaleTimeString = getLocaleTimeString;
|
|
125801
125814
|
/**
|
|
@@ -126211,12 +126224,13 @@ var ts;
|
|
|
126211
126224
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126212
126225
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126213
126226
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126214
|
-
|
|
126227
|
+
var compilerHost = {
|
|
126215
126228
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126216
126229
|
var text;
|
|
126217
126230
|
try {
|
|
126218
126231
|
ts.performance.mark("beforeIORead");
|
|
126219
|
-
|
|
126232
|
+
var encoding = getCompilerOptions().charset;
|
|
126233
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126220
126234
|
ts.performance.mark("afterIORead");
|
|
126221
126235
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126222
126236
|
}
|
|
@@ -126247,6 +126261,7 @@ var ts;
|
|
|
126247
126261
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126248
126262
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126249
126263
|
};
|
|
126264
|
+
return compilerHost;
|
|
126250
126265
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126251
126266
|
try {
|
|
126252
126267
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126265,9 +126280,9 @@ var ts;
|
|
|
126265
126280
|
}
|
|
126266
126281
|
}
|
|
126267
126282
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126268
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126283
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126269
126284
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126270
|
-
var computeHash = ts.maybeBind(
|
|
126285
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126271
126286
|
compilerHost.getSourceFile = function () {
|
|
126272
126287
|
var args = [];
|
|
126273
126288
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126399,7 +126414,7 @@ var ts;
|
|
|
126399
126414
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126400
126415
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126401
126416
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126402
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126417
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126403
126418
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126404
126419
|
return host;
|
|
126405
126420
|
}
|
|
@@ -126485,7 +126500,7 @@ var ts;
|
|
|
126485
126500
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126486
126501
|
}
|
|
126487
126502
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126488
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126503
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126489
126504
|
// Members for CompilerHost
|
|
126490
126505
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126491
126506
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126613,8 +126628,8 @@ var ts;
|
|
|
126613
126628
|
}
|
|
126614
126629
|
}
|
|
126615
126630
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126616
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126617
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126631
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126632
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126618
126633
|
if (hasChangedConfigFileParsingErrors) {
|
|
126619
126634
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126620
126635
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126753,9 +126768,15 @@ var ts;
|
|
|
126753
126768
|
}
|
|
126754
126769
|
}
|
|
126755
126770
|
}
|
|
126756
|
-
function getSourceVersion(path) {
|
|
126771
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126757
126772
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126758
|
-
|
|
126773
|
+
if (!hostSourceFile)
|
|
126774
|
+
return undefined;
|
|
126775
|
+
if (hostSourceFile.version)
|
|
126776
|
+
return hostSourceFile.version;
|
|
126777
|
+
// Read file and get new version
|
|
126778
|
+
var text = readFileWithCache(path);
|
|
126779
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126759
126780
|
}
|
|
126760
126781
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126761
126782
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127249,7 +127270,7 @@ var ts;
|
|
|
127249
127270
|
// State of the solution
|
|
127250
127271
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127251
127272
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127252
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127273
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127253
127274
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127254
127275
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127255
127276
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128282,7 +128303,7 @@ var ts;
|
|
|
128282
128303
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128283
128304
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128284
128305
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128285
|
-
currentVersion = text
|
|
128306
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128286
128307
|
if (version_3 && version_3 === currentVersion)
|
|
128287
128308
|
pseudoInputUpToDate = true;
|
|
128288
128309
|
}
|
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, ".
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".5");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -41290,7 +41290,12 @@ var ts;
|
|
|
41290
41290
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
41291
41291
|
category: ts.Diagnostics.Language_and_Environment,
|
|
41292
41292
|
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
41293
|
-
}
|
|
41293
|
+
},
|
|
41294
|
+
{
|
|
41295
|
+
name: "ignoreDeprecations",
|
|
41296
|
+
type: "string",
|
|
41297
|
+
defaultValueDescription: undefined,
|
|
41298
|
+
},
|
|
41294
41299
|
];
|
|
41295
41300
|
/* @internal */
|
|
41296
41301
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
@@ -68903,7 +68908,10 @@ var ts;
|
|
|
68903
68908
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68904
68909
|
}
|
|
68905
68910
|
function isUnitLikeType(type) {
|
|
68906
|
-
|
|
68911
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68912
|
+
var t = getBaseConstraintOrType(type);
|
|
68913
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68914
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68907
68915
|
}
|
|
68908
68916
|
function extractUnitType(type) {
|
|
68909
68917
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79083,11 +79091,11 @@ var ts;
|
|
|
79083
79091
|
}
|
|
79084
79092
|
function checkSatisfiesExpression(node) {
|
|
79085
79093
|
checkSourceElement(node.type);
|
|
79094
|
+
var exprType = checkExpression(node.expression);
|
|
79086
79095
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79087
79096
|
if (isErrorType(targetType)) {
|
|
79088
79097
|
return targetType;
|
|
79089
79098
|
}
|
|
79090
|
-
var exprType = checkExpression(node.expression);
|
|
79091
79099
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79092
79100
|
return exprType;
|
|
79093
79101
|
}
|
|
@@ -91972,8 +91980,8 @@ var ts;
|
|
|
91972
91980
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91973
91981
|
},
|
|
91974
91982
|
// Top-level nodes
|
|
91975
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91976
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91983
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91984
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91977
91985
|
},
|
|
91978
91986
|
// Transformation nodes
|
|
91979
91987
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -125794,7 +125802,12 @@ var ts;
|
|
|
125794
125802
|
function getLocaleTimeString(system) {
|
|
125795
125803
|
return !system.now ?
|
|
125796
125804
|
new Date().toLocaleTimeString() :
|
|
125797
|
-
|
|
125805
|
+
// On some systems / builds of Node, there's a non-breaking space between the time and AM/PM.
|
|
125806
|
+
// This branch is solely for testing, so just switch it to a normal space for baseline stability.
|
|
125807
|
+
// See:
|
|
125808
|
+
// - https://github.com/nodejs/node/issues/45171
|
|
125809
|
+
// - https://github.com/nodejs/node/issues/45753
|
|
125810
|
+
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202f", " ");
|
|
125798
125811
|
}
|
|
125799
125812
|
ts.getLocaleTimeString = getLocaleTimeString;
|
|
125800
125813
|
/**
|
|
@@ -126210,12 +126223,13 @@ var ts;
|
|
|
126210
126223
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126211
126224
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126212
126225
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126213
|
-
|
|
126226
|
+
var compilerHost = {
|
|
126214
126227
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126215
126228
|
var text;
|
|
126216
126229
|
try {
|
|
126217
126230
|
ts.performance.mark("beforeIORead");
|
|
126218
|
-
|
|
126231
|
+
var encoding = getCompilerOptions().charset;
|
|
126232
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126219
126233
|
ts.performance.mark("afterIORead");
|
|
126220
126234
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126221
126235
|
}
|
|
@@ -126246,6 +126260,7 @@ var ts;
|
|
|
126246
126260
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126247
126261
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126248
126262
|
};
|
|
126263
|
+
return compilerHost;
|
|
126249
126264
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126250
126265
|
try {
|
|
126251
126266
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126264,9 +126279,9 @@ var ts;
|
|
|
126264
126279
|
}
|
|
126265
126280
|
}
|
|
126266
126281
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126267
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126282
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126268
126283
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126269
|
-
var computeHash = ts.maybeBind(
|
|
126284
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126270
126285
|
compilerHost.getSourceFile = function () {
|
|
126271
126286
|
var args = [];
|
|
126272
126287
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126398,7 +126413,7 @@ var ts;
|
|
|
126398
126413
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126399
126414
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126400
126415
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126401
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126416
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126402
126417
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126403
126418
|
return host;
|
|
126404
126419
|
}
|
|
@@ -126484,7 +126499,7 @@ var ts;
|
|
|
126484
126499
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126485
126500
|
}
|
|
126486
126501
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126487
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126502
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126488
126503
|
// Members for CompilerHost
|
|
126489
126504
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126490
126505
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126612,8 +126627,8 @@ var ts;
|
|
|
126612
126627
|
}
|
|
126613
126628
|
}
|
|
126614
126629
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126615
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126616
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126630
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126631
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126617
126632
|
if (hasChangedConfigFileParsingErrors) {
|
|
126618
126633
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126619
126634
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126752,9 +126767,15 @@ var ts;
|
|
|
126752
126767
|
}
|
|
126753
126768
|
}
|
|
126754
126769
|
}
|
|
126755
|
-
function getSourceVersion(path) {
|
|
126770
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126756
126771
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126757
|
-
|
|
126772
|
+
if (!hostSourceFile)
|
|
126773
|
+
return undefined;
|
|
126774
|
+
if (hostSourceFile.version)
|
|
126775
|
+
return hostSourceFile.version;
|
|
126776
|
+
// Read file and get new version
|
|
126777
|
+
var text = readFileWithCache(path);
|
|
126778
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126758
126779
|
}
|
|
126759
126780
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126760
126781
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127248,7 +127269,7 @@ var ts;
|
|
|
127248
127269
|
// State of the solution
|
|
127249
127270
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127250
127271
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127251
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127272
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127252
127273
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127253
127274
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127254
127275
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128281,7 +128302,7 @@ var ts;
|
|
|
128281
128302
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128282
128303
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128283
128304
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128284
|
-
currentVersion = text
|
|
128305
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128285
128306
|
if (version_3 && version_3 === currentVersion)
|
|
128286
128307
|
pseudoInputUpToDate = true;
|
|
128287
128308
|
}
|
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, ".
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".5");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -41281,7 +41281,12 @@ var ts;
|
|
|
41281
41281
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
41282
41282
|
category: ts.Diagnostics.Language_and_Environment,
|
|
41283
41283
|
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
41284
|
-
}
|
|
41284
|
+
},
|
|
41285
|
+
{
|
|
41286
|
+
name: "ignoreDeprecations",
|
|
41287
|
+
type: "string",
|
|
41288
|
+
defaultValueDescription: undefined,
|
|
41289
|
+
},
|
|
41285
41290
|
];
|
|
41286
41291
|
/* @internal */
|
|
41287
41292
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
@@ -68894,7 +68899,10 @@ var ts;
|
|
|
68894
68899
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68895
68900
|
}
|
|
68896
68901
|
function isUnitLikeType(type) {
|
|
68897
|
-
|
|
68902
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68903
|
+
var t = getBaseConstraintOrType(type);
|
|
68904
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68905
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68898
68906
|
}
|
|
68899
68907
|
function extractUnitType(type) {
|
|
68900
68908
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79074,11 +79082,11 @@ var ts;
|
|
|
79074
79082
|
}
|
|
79075
79083
|
function checkSatisfiesExpression(node) {
|
|
79076
79084
|
checkSourceElement(node.type);
|
|
79085
|
+
var exprType = checkExpression(node.expression);
|
|
79077
79086
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79078
79087
|
if (isErrorType(targetType)) {
|
|
79079
79088
|
return targetType;
|
|
79080
79089
|
}
|
|
79081
|
-
var exprType = checkExpression(node.expression);
|
|
79082
79090
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79083
79091
|
return exprType;
|
|
79084
79092
|
}
|
|
@@ -91963,8 +91971,8 @@ var ts;
|
|
|
91963
91971
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91964
91972
|
},
|
|
91965
91973
|
// Top-level nodes
|
|
91966
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91967
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91974
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91975
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91968
91976
|
},
|
|
91969
91977
|
// Transformation nodes
|
|
91970
91978
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -125785,7 +125793,12 @@ var ts;
|
|
|
125785
125793
|
function getLocaleTimeString(system) {
|
|
125786
125794
|
return !system.now ?
|
|
125787
125795
|
new Date().toLocaleTimeString() :
|
|
125788
|
-
|
|
125796
|
+
// On some systems / builds of Node, there's a non-breaking space between the time and AM/PM.
|
|
125797
|
+
// This branch is solely for testing, so just switch it to a normal space for baseline stability.
|
|
125798
|
+
// See:
|
|
125799
|
+
// - https://github.com/nodejs/node/issues/45171
|
|
125800
|
+
// - https://github.com/nodejs/node/issues/45753
|
|
125801
|
+
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202f", " ");
|
|
125789
125802
|
}
|
|
125790
125803
|
ts.getLocaleTimeString = getLocaleTimeString;
|
|
125791
125804
|
/**
|
|
@@ -126201,12 +126214,13 @@ var ts;
|
|
|
126201
126214
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126202
126215
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126203
126216
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126204
|
-
|
|
126217
|
+
var compilerHost = {
|
|
126205
126218
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126206
126219
|
var text;
|
|
126207
126220
|
try {
|
|
126208
126221
|
ts.performance.mark("beforeIORead");
|
|
126209
|
-
|
|
126222
|
+
var encoding = getCompilerOptions().charset;
|
|
126223
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126210
126224
|
ts.performance.mark("afterIORead");
|
|
126211
126225
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126212
126226
|
}
|
|
@@ -126237,6 +126251,7 @@ var ts;
|
|
|
126237
126251
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126238
126252
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126239
126253
|
};
|
|
126254
|
+
return compilerHost;
|
|
126240
126255
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126241
126256
|
try {
|
|
126242
126257
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126255,9 +126270,9 @@ var ts;
|
|
|
126255
126270
|
}
|
|
126256
126271
|
}
|
|
126257
126272
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126258
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126273
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126259
126274
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126260
|
-
var computeHash = ts.maybeBind(
|
|
126275
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126261
126276
|
compilerHost.getSourceFile = function () {
|
|
126262
126277
|
var args = [];
|
|
126263
126278
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126389,7 +126404,7 @@ var ts;
|
|
|
126389
126404
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126390
126405
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126391
126406
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126392
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126407
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126393
126408
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126394
126409
|
return host;
|
|
126395
126410
|
}
|
|
@@ -126475,7 +126490,7 @@ var ts;
|
|
|
126475
126490
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126476
126491
|
}
|
|
126477
126492
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126478
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126493
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126479
126494
|
// Members for CompilerHost
|
|
126480
126495
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126481
126496
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126603,8 +126618,8 @@ var ts;
|
|
|
126603
126618
|
}
|
|
126604
126619
|
}
|
|
126605
126620
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126606
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126607
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126621
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126622
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126608
126623
|
if (hasChangedConfigFileParsingErrors) {
|
|
126609
126624
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126610
126625
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126743,9 +126758,15 @@ var ts;
|
|
|
126743
126758
|
}
|
|
126744
126759
|
}
|
|
126745
126760
|
}
|
|
126746
|
-
function getSourceVersion(path) {
|
|
126761
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126747
126762
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126748
|
-
|
|
126763
|
+
if (!hostSourceFile)
|
|
126764
|
+
return undefined;
|
|
126765
|
+
if (hostSourceFile.version)
|
|
126766
|
+
return hostSourceFile.version;
|
|
126767
|
+
// Read file and get new version
|
|
126768
|
+
var text = readFileWithCache(path);
|
|
126769
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126749
126770
|
}
|
|
126750
126771
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126751
126772
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127239,7 +127260,7 @@ var ts;
|
|
|
127239
127260
|
// State of the solution
|
|
127240
127261
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127241
127262
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127242
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127263
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127243
127264
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127244
127265
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127245
127266
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128272,7 +128293,7 @@ var ts;
|
|
|
128272
128293
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128273
128294
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128274
128295
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128275
|
-
currentVersion = text
|
|
128296
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128276
128297
|
if (version_3 && version_3 === currentVersion)
|
|
128277
128298
|
pseudoInputUpToDate = true;
|
|
128278
128299
|
}
|
|
@@ -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, ".
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".5");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -41281,7 +41281,12 @@ var ts;
|
|
|
41281
41281
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
41282
41282
|
category: ts.Diagnostics.Language_and_Environment,
|
|
41283
41283
|
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
41284
|
-
}
|
|
41284
|
+
},
|
|
41285
|
+
{
|
|
41286
|
+
name: "ignoreDeprecations",
|
|
41287
|
+
type: "string",
|
|
41288
|
+
defaultValueDescription: undefined,
|
|
41289
|
+
},
|
|
41285
41290
|
];
|
|
41286
41291
|
/* @internal */
|
|
41287
41292
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
@@ -68894,7 +68899,10 @@ var ts;
|
|
|
68894
68899
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68895
68900
|
}
|
|
68896
68901
|
function isUnitLikeType(type) {
|
|
68897
|
-
|
|
68902
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68903
|
+
var t = getBaseConstraintOrType(type);
|
|
68904
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68905
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68898
68906
|
}
|
|
68899
68907
|
function extractUnitType(type) {
|
|
68900
68908
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79074,11 +79082,11 @@ var ts;
|
|
|
79074
79082
|
}
|
|
79075
79083
|
function checkSatisfiesExpression(node) {
|
|
79076
79084
|
checkSourceElement(node.type);
|
|
79085
|
+
var exprType = checkExpression(node.expression);
|
|
79077
79086
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79078
79087
|
if (isErrorType(targetType)) {
|
|
79079
79088
|
return targetType;
|
|
79080
79089
|
}
|
|
79081
|
-
var exprType = checkExpression(node.expression);
|
|
79082
79090
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79083
79091
|
return exprType;
|
|
79084
79092
|
}
|
|
@@ -91963,8 +91971,8 @@ var ts;
|
|
|
91963
91971
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91964
91972
|
},
|
|
91965
91973
|
// Top-level nodes
|
|
91966
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91967
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91974
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91975
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91968
91976
|
},
|
|
91969
91977
|
// Transformation nodes
|
|
91970
91978
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -125785,7 +125793,12 @@ var ts;
|
|
|
125785
125793
|
function getLocaleTimeString(system) {
|
|
125786
125794
|
return !system.now ?
|
|
125787
125795
|
new Date().toLocaleTimeString() :
|
|
125788
|
-
|
|
125796
|
+
// On some systems / builds of Node, there's a non-breaking space between the time and AM/PM.
|
|
125797
|
+
// This branch is solely for testing, so just switch it to a normal space for baseline stability.
|
|
125798
|
+
// See:
|
|
125799
|
+
// - https://github.com/nodejs/node/issues/45171
|
|
125800
|
+
// - https://github.com/nodejs/node/issues/45753
|
|
125801
|
+
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202f", " ");
|
|
125789
125802
|
}
|
|
125790
125803
|
ts.getLocaleTimeString = getLocaleTimeString;
|
|
125791
125804
|
/**
|
|
@@ -126201,12 +126214,13 @@ var ts;
|
|
|
126201
126214
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126202
126215
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126203
126216
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126204
|
-
|
|
126217
|
+
var compilerHost = {
|
|
126205
126218
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126206
126219
|
var text;
|
|
126207
126220
|
try {
|
|
126208
126221
|
ts.performance.mark("beforeIORead");
|
|
126209
|
-
|
|
126222
|
+
var encoding = getCompilerOptions().charset;
|
|
126223
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126210
126224
|
ts.performance.mark("afterIORead");
|
|
126211
126225
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126212
126226
|
}
|
|
@@ -126237,6 +126251,7 @@ var ts;
|
|
|
126237
126251
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126238
126252
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126239
126253
|
};
|
|
126254
|
+
return compilerHost;
|
|
126240
126255
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126241
126256
|
try {
|
|
126242
126257
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126255,9 +126270,9 @@ var ts;
|
|
|
126255
126270
|
}
|
|
126256
126271
|
}
|
|
126257
126272
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126258
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126273
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126259
126274
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126260
|
-
var computeHash = ts.maybeBind(
|
|
126275
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126261
126276
|
compilerHost.getSourceFile = function () {
|
|
126262
126277
|
var args = [];
|
|
126263
126278
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126389,7 +126404,7 @@ var ts;
|
|
|
126389
126404
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126390
126405
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126391
126406
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126392
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126407
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126393
126408
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126394
126409
|
return host;
|
|
126395
126410
|
}
|
|
@@ -126475,7 +126490,7 @@ var ts;
|
|
|
126475
126490
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126476
126491
|
}
|
|
126477
126492
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126478
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126493
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126479
126494
|
// Members for CompilerHost
|
|
126480
126495
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126481
126496
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126603,8 +126618,8 @@ var ts;
|
|
|
126603
126618
|
}
|
|
126604
126619
|
}
|
|
126605
126620
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126606
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126607
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126621
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126622
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126608
126623
|
if (hasChangedConfigFileParsingErrors) {
|
|
126609
126624
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126610
126625
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126743,9 +126758,15 @@ var ts;
|
|
|
126743
126758
|
}
|
|
126744
126759
|
}
|
|
126745
126760
|
}
|
|
126746
|
-
function getSourceVersion(path) {
|
|
126761
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126747
126762
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126748
|
-
|
|
126763
|
+
if (!hostSourceFile)
|
|
126764
|
+
return undefined;
|
|
126765
|
+
if (hostSourceFile.version)
|
|
126766
|
+
return hostSourceFile.version;
|
|
126767
|
+
// Read file and get new version
|
|
126768
|
+
var text = readFileWithCache(path);
|
|
126769
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126749
126770
|
}
|
|
126750
126771
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126751
126772
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127239,7 +127260,7 @@ var ts;
|
|
|
127239
127260
|
// State of the solution
|
|
127240
127261
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127241
127262
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127242
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127263
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127243
127264
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127244
127265
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127245
127266
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128272,7 +128293,7 @@ var ts;
|
|
|
128272
128293
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128273
128294
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128274
128295
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128275
|
-
currentVersion = text
|
|
128296
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128276
128297
|
if (version_3 && version_3 === currentVersion)
|
|
128277
128298
|
pseudoInputUpToDate = true;
|
|
128278
128299
|
}
|
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, ".
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".5");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -41271,7 +41271,12 @@ var ts;
|
|
|
41271
41271
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
41272
41272
|
category: ts.Diagnostics.Language_and_Environment,
|
|
41273
41273
|
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
41274
|
-
}
|
|
41274
|
+
},
|
|
41275
|
+
{
|
|
41276
|
+
name: "ignoreDeprecations",
|
|
41277
|
+
type: "string",
|
|
41278
|
+
defaultValueDescription: undefined,
|
|
41279
|
+
},
|
|
41275
41280
|
];
|
|
41276
41281
|
/* @internal */
|
|
41277
41282
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
@@ -68884,7 +68889,10 @@ var ts;
|
|
|
68884
68889
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68885
68890
|
}
|
|
68886
68891
|
function isUnitLikeType(type) {
|
|
68887
|
-
|
|
68892
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68893
|
+
var t = getBaseConstraintOrType(type);
|
|
68894
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68895
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68888
68896
|
}
|
|
68889
68897
|
function extractUnitType(type) {
|
|
68890
68898
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79064,11 +79072,11 @@ var ts;
|
|
|
79064
79072
|
}
|
|
79065
79073
|
function checkSatisfiesExpression(node) {
|
|
79066
79074
|
checkSourceElement(node.type);
|
|
79075
|
+
var exprType = checkExpression(node.expression);
|
|
79067
79076
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79068
79077
|
if (isErrorType(targetType)) {
|
|
79069
79078
|
return targetType;
|
|
79070
79079
|
}
|
|
79071
|
-
var exprType = checkExpression(node.expression);
|
|
79072
79080
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79073
79081
|
return exprType;
|
|
79074
79082
|
}
|
|
@@ -91953,8 +91961,8 @@ var ts;
|
|
|
91953
91961
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91954
91962
|
},
|
|
91955
91963
|
// Top-level nodes
|
|
91956
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91957
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91964
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91965
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91958
91966
|
},
|
|
91959
91967
|
// Transformation nodes
|
|
91960
91968
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -125775,7 +125783,12 @@ var ts;
|
|
|
125775
125783
|
function getLocaleTimeString(system) {
|
|
125776
125784
|
return !system.now ?
|
|
125777
125785
|
new Date().toLocaleTimeString() :
|
|
125778
|
-
|
|
125786
|
+
// On some systems / builds of Node, there's a non-breaking space between the time and AM/PM.
|
|
125787
|
+
// This branch is solely for testing, so just switch it to a normal space for baseline stability.
|
|
125788
|
+
// See:
|
|
125789
|
+
// - https://github.com/nodejs/node/issues/45171
|
|
125790
|
+
// - https://github.com/nodejs/node/issues/45753
|
|
125791
|
+
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202f", " ");
|
|
125779
125792
|
}
|
|
125780
125793
|
ts.getLocaleTimeString = getLocaleTimeString;
|
|
125781
125794
|
/**
|
|
@@ -126191,12 +126204,13 @@ var ts;
|
|
|
126191
126204
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126192
126205
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126193
126206
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126194
|
-
|
|
126207
|
+
var compilerHost = {
|
|
126195
126208
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126196
126209
|
var text;
|
|
126197
126210
|
try {
|
|
126198
126211
|
ts.performance.mark("beforeIORead");
|
|
126199
|
-
|
|
126212
|
+
var encoding = getCompilerOptions().charset;
|
|
126213
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126200
126214
|
ts.performance.mark("afterIORead");
|
|
126201
126215
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126202
126216
|
}
|
|
@@ -126227,6 +126241,7 @@ var ts;
|
|
|
126227
126241
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126228
126242
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126229
126243
|
};
|
|
126244
|
+
return compilerHost;
|
|
126230
126245
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126231
126246
|
try {
|
|
126232
126247
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126245,9 +126260,9 @@ var ts;
|
|
|
126245
126260
|
}
|
|
126246
126261
|
}
|
|
126247
126262
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126248
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126263
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126249
126264
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126250
|
-
var computeHash = ts.maybeBind(
|
|
126265
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126251
126266
|
compilerHost.getSourceFile = function () {
|
|
126252
126267
|
var args = [];
|
|
126253
126268
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126379,7 +126394,7 @@ var ts;
|
|
|
126379
126394
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126380
126395
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126381
126396
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126382
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126397
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126383
126398
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126384
126399
|
return host;
|
|
126385
126400
|
}
|
|
@@ -126465,7 +126480,7 @@ var ts;
|
|
|
126465
126480
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126466
126481
|
}
|
|
126467
126482
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126468
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126483
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126469
126484
|
// Members for CompilerHost
|
|
126470
126485
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126471
126486
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126593,8 +126608,8 @@ var ts;
|
|
|
126593
126608
|
}
|
|
126594
126609
|
}
|
|
126595
126610
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126596
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126597
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126611
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126612
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126598
126613
|
if (hasChangedConfigFileParsingErrors) {
|
|
126599
126614
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126600
126615
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126733,9 +126748,15 @@ var ts;
|
|
|
126733
126748
|
}
|
|
126734
126749
|
}
|
|
126735
126750
|
}
|
|
126736
|
-
function getSourceVersion(path) {
|
|
126751
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126737
126752
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126738
|
-
|
|
126753
|
+
if (!hostSourceFile)
|
|
126754
|
+
return undefined;
|
|
126755
|
+
if (hostSourceFile.version)
|
|
126756
|
+
return hostSourceFile.version;
|
|
126757
|
+
// Read file and get new version
|
|
126758
|
+
var text = readFileWithCache(path);
|
|
126759
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126739
126760
|
}
|
|
126740
126761
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126741
126762
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127229,7 +127250,7 @@ var ts;
|
|
|
127229
127250
|
// State of the solution
|
|
127230
127251
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127231
127252
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127232
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127253
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127233
127254
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127234
127255
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127235
127256
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128262,7 +128283,7 @@ var ts;
|
|
|
128262
128283
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128263
128284
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128264
128285
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128265
|
-
currentVersion = text
|
|
128286
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128266
128287
|
if (version_3 && version_3 === currentVersion)
|
|
128267
128288
|
pseudoInputUpToDate = true;
|
|
128268
128289
|
}
|
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.
|
|
5
|
+
"version": "4.9.5",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|