typescript 4.8.3 → 4.8.4
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 +55 -54
- package/lib/tsserver.js +67 -59
- package/lib/tsserverlibrary.js +67 -59
- package/lib/typescript.js +66 -58
- package/lib/typescriptServices.js +66 -58
- package/lib/typingsInstaller.js +65 -57
- package/package.json +1 -1
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 = "4.8.
|
|
112
|
+
ts.version = "4.8.4";
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -31516,6 +31516,7 @@ var ts;
|
|
|
31516
31516
|
case 335 /* SyntaxKind.JSDocProtectedTag */:
|
|
31517
31517
|
case 336 /* SyntaxKind.JSDocReadonlyTag */:
|
|
31518
31518
|
case 331 /* SyntaxKind.JSDocDeprecatedTag */:
|
|
31519
|
+
case 337 /* SyntaxKind.JSDocOverrideTag */:
|
|
31519
31520
|
return visitNode(cbNode, node.tagName)
|
|
31520
31521
|
|| (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
31521
31522
|
case 350 /* SyntaxKind.PartiallyEmittedExpression */:
|
|
@@ -42804,7 +42805,7 @@ var ts;
|
|
|
42804
42805
|
function withPackageId(packageInfo, r) {
|
|
42805
42806
|
var packageId;
|
|
42806
42807
|
if (r && packageInfo) {
|
|
42807
|
-
var packageJsonContent = packageInfo.packageJsonContent;
|
|
42808
|
+
var packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
42808
42809
|
if (typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string") {
|
|
42809
42810
|
packageId = {
|
|
42810
42811
|
name: packageJsonContent.name,
|
|
@@ -44123,16 +44124,16 @@ var ts;
|
|
|
44123
44124
|
function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
44124
44125
|
if (considerPackageJson === void 0) { considerPackageJson = true; }
|
|
44125
44126
|
var packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : undefined;
|
|
44126
|
-
var packageJsonContent = packageInfo && packageInfo.packageJsonContent;
|
|
44127
|
-
var versionPaths = packageInfo && packageInfo.versionPaths;
|
|
44127
|
+
var packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
44128
|
+
var versionPaths = packageInfo && packageInfo.contents.versionPaths;
|
|
44128
44129
|
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
44129
44130
|
}
|
|
44130
44131
|
/* @internal */
|
|
44131
44132
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
44132
|
-
if (!resolveJs && packageJsonInfo.resolvedEntrypoints !== undefined) {
|
|
44133
|
+
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== undefined) {
|
|
44133
44134
|
// Cached value excludes resolutions to JS files - those could be
|
|
44134
44135
|
// cached separately, but they're used rarely.
|
|
44135
|
-
return packageJsonInfo.resolvedEntrypoints;
|
|
44136
|
+
return packageJsonInfo.contents.resolvedEntrypoints;
|
|
44136
44137
|
}
|
|
44137
44138
|
var entrypoints;
|
|
44138
44139
|
var extensions = resolveJs ? Extensions.JavaScript : Extensions.TypeScript;
|
|
@@ -44141,13 +44142,13 @@ var ts;
|
|
|
44141
44142
|
requireState.conditions = ["node", "require", "types"];
|
|
44142
44143
|
requireState.requestContainingDirectory = packageJsonInfo.packageDirectory;
|
|
44143
44144
|
var requireResolution = loadNodeModuleFromDirectoryWorker(extensions, packageJsonInfo.packageDirectory,
|
|
44144
|
-
/*onlyRecordFailures*/ false, requireState, packageJsonInfo.packageJsonContent, packageJsonInfo.versionPaths);
|
|
44145
|
+
/*onlyRecordFailures*/ false, requireState, packageJsonInfo.contents.packageJsonContent, packageJsonInfo.contents.versionPaths);
|
|
44145
44146
|
entrypoints = ts.append(entrypoints, requireResolution === null || requireResolution === void 0 ? void 0 : requireResolution.path);
|
|
44146
|
-
if (features & NodeResolutionFeatures.Exports && packageJsonInfo.packageJsonContent.exports) {
|
|
44147
|
+
if (features & NodeResolutionFeatures.Exports && packageJsonInfo.contents.packageJsonContent.exports) {
|
|
44147
44148
|
for (var _i = 0, _a = [["node", "import", "types"], ["node", "require", "types"]]; _i < _a.length; _i++) {
|
|
44148
44149
|
var conditions = _a[_i];
|
|
44149
44150
|
var exportState = __assign(__assign({}, requireState), { failedLookupLocations: [], conditions: conditions });
|
|
44150
|
-
var exportResolutions = loadEntrypointsFromExportMap(packageJsonInfo, packageJsonInfo.packageJsonContent.exports, exportState, extensions);
|
|
44151
|
+
var exportResolutions = loadEntrypointsFromExportMap(packageJsonInfo, packageJsonInfo.contents.packageJsonContent.exports, exportState, extensions);
|
|
44151
44152
|
if (exportResolutions) {
|
|
44152
44153
|
for (var _b = 0, exportResolutions_1 = exportResolutions; _b < exportResolutions_1.length; _b++) {
|
|
44153
44154
|
var resolution = exportResolutions_1[_b];
|
|
@@ -44156,7 +44157,7 @@ var ts;
|
|
|
44156
44157
|
}
|
|
44157
44158
|
}
|
|
44158
44159
|
}
|
|
44159
|
-
return packageJsonInfo.resolvedEntrypoints = entrypoints || false;
|
|
44160
|
+
return packageJsonInfo.contents.resolvedEntrypoints = entrypoints || false;
|
|
44160
44161
|
}
|
|
44161
44162
|
ts.getEntrypointsFromPackageJsonInfo = getEntrypointsFromPackageJsonInfo;
|
|
44162
44163
|
function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
@@ -44260,7 +44261,9 @@ var ts;
|
|
|
44260
44261
|
if (traceEnabled)
|
|
44261
44262
|
trace(host, ts.Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath);
|
|
44262
44263
|
state.affectingLocations.push(packageJsonPath);
|
|
44263
|
-
return existing
|
|
44264
|
+
return existing.packageDirectory === packageDirectory ?
|
|
44265
|
+
existing :
|
|
44266
|
+
{ packageDirectory: packageDirectory, contents: existing.contents };
|
|
44264
44267
|
}
|
|
44265
44268
|
else {
|
|
44266
44269
|
if (existing && traceEnabled)
|
|
@@ -44276,7 +44279,7 @@ var ts;
|
|
|
44276
44279
|
trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
44277
44280
|
}
|
|
44278
44281
|
var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);
|
|
44279
|
-
var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths, resolvedEntrypoints: undefined };
|
|
44282
|
+
var result = { packageDirectory: packageDirectory, contents: { packageJsonContent: packageJsonContent, versionPaths: versionPaths, resolvedEntrypoints: undefined } };
|
|
44280
44283
|
(_b = state.packageJsonInfoCache) === null || _b === void 0 ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result);
|
|
44281
44284
|
state.affectingLocations.push(packageJsonPath);
|
|
44282
44285
|
return result;
|
|
@@ -44401,17 +44404,16 @@ var ts;
|
|
|
44401
44404
|
}
|
|
44402
44405
|
function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
44403
44406
|
var _a, _b;
|
|
44404
|
-
var
|
|
44405
|
-
var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
|
44407
|
+
var directoryPath = ts.getNormalizedAbsolutePath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44406
44408
|
var scope = getPackageScopeForPath(directoryPath, state);
|
|
44407
|
-
if (!scope || !scope.packageJsonContent.exports) {
|
|
44409
|
+
if (!scope || !scope.contents.packageJsonContent.exports) {
|
|
44408
44410
|
return undefined;
|
|
44409
44411
|
}
|
|
44410
|
-
if (typeof scope.packageJsonContent.name !== "string") {
|
|
44412
|
+
if (typeof scope.contents.packageJsonContent.name !== "string") {
|
|
44411
44413
|
return undefined;
|
|
44412
44414
|
}
|
|
44413
44415
|
var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
|
|
44414
|
-
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
44416
|
+
var nameParts = ts.getPathComponents(scope.contents.packageJsonContent.name);
|
|
44415
44417
|
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
44416
44418
|
return undefined;
|
|
44417
44419
|
}
|
|
@@ -44419,30 +44421,30 @@ var ts;
|
|
|
44419
44421
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
|
|
44420
44422
|
}
|
|
44421
44423
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
44422
|
-
if (!scope.packageJsonContent.exports) {
|
|
44424
|
+
if (!scope.contents.packageJsonContent.exports) {
|
|
44423
44425
|
return undefined;
|
|
44424
44426
|
}
|
|
44425
44427
|
if (subpath === ".") {
|
|
44426
44428
|
var mainExport = void 0;
|
|
44427
|
-
if (typeof scope.packageJsonContent.exports === "string" || Array.isArray(scope.packageJsonContent.exports) || (typeof scope.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.packageJsonContent.exports))) {
|
|
44428
|
-
mainExport = scope.packageJsonContent.exports;
|
|
44429
|
+
if (typeof scope.contents.packageJsonContent.exports === "string" || Array.isArray(scope.contents.packageJsonContent.exports) || (typeof scope.contents.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.contents.packageJsonContent.exports))) {
|
|
44430
|
+
mainExport = scope.contents.packageJsonContent.exports;
|
|
44429
44431
|
}
|
|
44430
|
-
else if (ts.hasProperty(scope.packageJsonContent.exports, ".")) {
|
|
44431
|
-
mainExport = scope.packageJsonContent.exports["."];
|
|
44432
|
+
else if (ts.hasProperty(scope.contents.packageJsonContent.exports, ".")) {
|
|
44433
|
+
mainExport = scope.contents.packageJsonContent.exports["."];
|
|
44432
44434
|
}
|
|
44433
44435
|
if (mainExport) {
|
|
44434
44436
|
var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, /*isImports*/ false);
|
|
44435
44437
|
return loadModuleFromTargetImportOrExport(mainExport, "", /*pattern*/ false);
|
|
44436
44438
|
}
|
|
44437
44439
|
}
|
|
44438
|
-
else if (allKeysStartWithDot(scope.packageJsonContent.exports)) {
|
|
44439
|
-
if (typeof scope.packageJsonContent.exports !== "object") {
|
|
44440
|
+
else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) {
|
|
44441
|
+
if (typeof scope.contents.packageJsonContent.exports !== "object") {
|
|
44440
44442
|
if (state.traceEnabled) {
|
|
44441
44443
|
trace(state.host, ts.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory);
|
|
44442
44444
|
}
|
|
44443
44445
|
return toSearchResult(/*value*/ undefined);
|
|
44444
44446
|
}
|
|
44445
|
-
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.packageJsonContent.exports, scope, /*isImports*/ false);
|
|
44447
|
+
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.contents.packageJsonContent.exports, scope, /*isImports*/ false);
|
|
44446
44448
|
if (result) {
|
|
44447
44449
|
return result;
|
|
44448
44450
|
}
|
|
@@ -44460,8 +44462,7 @@ var ts;
|
|
|
44460
44462
|
}
|
|
44461
44463
|
return toSearchResult(/*value*/ undefined);
|
|
44462
44464
|
}
|
|
44463
|
-
var
|
|
44464
|
-
var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
|
44465
|
+
var directoryPath = ts.getNormalizedAbsolutePath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44465
44466
|
var scope = getPackageScopeForPath(directoryPath, state);
|
|
44466
44467
|
if (!scope) {
|
|
44467
44468
|
if (state.traceEnabled) {
|
|
@@ -44469,13 +44470,13 @@ var ts;
|
|
|
44469
44470
|
}
|
|
44470
44471
|
return toSearchResult(/*value*/ undefined);
|
|
44471
44472
|
}
|
|
44472
|
-
if (!scope.packageJsonContent.imports) {
|
|
44473
|
+
if (!scope.contents.packageJsonContent.imports) {
|
|
44473
44474
|
if (state.traceEnabled) {
|
|
44474
44475
|
trace(state.host, ts.Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory);
|
|
44475
44476
|
}
|
|
44476
44477
|
return toSearchResult(/*value*/ undefined);
|
|
44477
44478
|
}
|
|
44478
|
-
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.packageJsonContent.imports, scope, /*isImports*/ true);
|
|
44479
|
+
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.contents.packageJsonContent.imports, scope, /*isImports*/ true);
|
|
44479
44480
|
if (result) {
|
|
44480
44481
|
return result;
|
|
44481
44482
|
}
|
|
@@ -44820,7 +44821,7 @@ var ts;
|
|
|
44820
44821
|
if (fromFile) {
|
|
44821
44822
|
return noPackageId(fromFile);
|
|
44822
44823
|
}
|
|
44823
|
-
var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths);
|
|
44824
|
+
var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.contents.packageJsonContent, packageInfo.contents.versionPaths);
|
|
44824
44825
|
return withPackageId(packageInfo, fromDirectory);
|
|
44825
44826
|
}
|
|
44826
44827
|
}
|
|
@@ -44828,14 +44829,14 @@ var ts;
|
|
|
44828
44829
|
var loader = function (extensions, candidate, onlyRecordFailures, state) {
|
|
44829
44830
|
var _a;
|
|
44830
44831
|
// package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
|
|
44831
|
-
if (packageInfo && packageInfo.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
44832
|
+
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
44832
44833
|
return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
44833
44834
|
}
|
|
44834
44835
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
44835
|
-
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
44836
|
+
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
|
|
44836
44837
|
if (!pathAndExtension && packageInfo
|
|
44837
44838
|
// eslint-disable-next-line no-null/no-null
|
|
44838
|
-
&& (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
|
|
44839
|
+
&& (packageInfo.contents.packageJsonContent.exports === undefined || packageInfo.contents.packageJsonContent.exports === null)
|
|
44839
44840
|
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
44840
44841
|
// EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
|
|
44841
44842
|
// a default `index.js` entrypoint if no `main` or `exports` are present
|
|
@@ -44847,12 +44848,12 @@ var ts;
|
|
|
44847
44848
|
var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
|
|
44848
44849
|
// Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.
|
|
44849
44850
|
packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
44850
|
-
if (packageInfo && packageInfo.versionPaths) {
|
|
44851
|
+
if (packageInfo && packageInfo.contents.versionPaths) {
|
|
44851
44852
|
if (state.traceEnabled) {
|
|
44852
|
-
trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.versionPaths.version, ts.version, rest);
|
|
44853
|
+
trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
|
|
44853
44854
|
}
|
|
44854
44855
|
var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
|
|
44855
|
-
var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
|
|
44856
|
+
var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
|
|
44856
44857
|
if (fromPaths) {
|
|
44857
44858
|
return fromPaths.value;
|
|
44858
44859
|
}
|
|
@@ -49153,6 +49154,7 @@ var ts;
|
|
|
49153
49154
|
var wildcardType = createIntrinsicType(1 /* TypeFlags.Any */, "any");
|
|
49154
49155
|
var errorType = createIntrinsicType(1 /* TypeFlags.Any */, "error");
|
|
49155
49156
|
var unresolvedType = createIntrinsicType(1 /* TypeFlags.Any */, "unresolved");
|
|
49157
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* TypeFlags.Any */, "any", 65536 /* ObjectFlags.ContainsWideningType */);
|
|
49156
49158
|
var intrinsicMarkerType = createIntrinsicType(1 /* TypeFlags.Any */, "intrinsic");
|
|
49157
49159
|
var unknownType = createIntrinsicType(2 /* TypeFlags.Unknown */, "unknown");
|
|
49158
49160
|
var nonNullUnknownType = createIntrinsicType(2 /* TypeFlags.Unknown */, "unknown");
|
|
@@ -51754,7 +51756,7 @@ var ts;
|
|
|
51754
51756
|
if (ext === ".ts" /* Extension.Ts */ || ext === ".js" /* Extension.Js */ || ext === ".tsx" /* Extension.Tsx */ || ext === ".jsx" /* Extension.Jsx */) {
|
|
51755
51757
|
var scope = currentSourceFile.packageJsonScope;
|
|
51756
51758
|
var targetExt = ext === ".ts" /* Extension.Ts */ ? ".mts" /* Extension.Mts */ : ext === ".js" /* Extension.Js */ ? ".mjs" /* Extension.Mjs */ : undefined;
|
|
51757
|
-
if (scope && !scope.packageJsonContent.type) {
|
|
51759
|
+
if (scope && !scope.contents.packageJsonContent.type) {
|
|
51758
51760
|
if (targetExt) {
|
|
51759
51761
|
diagnosticDetails = ts.chainDiagnosticMessages(
|
|
51760
51762
|
/*details*/ undefined, ts.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1, targetExt, ts.combinePaths(scope.packageDirectory, "package.json"));
|
|
@@ -53982,22 +53984,15 @@ var ts;
|
|
|
53982
53984
|
context.approximateLength += ts.symbolName(parameterSymbol).length + 3;
|
|
53983
53985
|
return parameterNode;
|
|
53984
53986
|
function cloneBindingName(node) {
|
|
53985
|
-
return
|
|
53986
|
-
function
|
|
53987
|
+
return elideInitializerAndSetEmitFlags(node);
|
|
53988
|
+
function elideInitializerAndSetEmitFlags(node) {
|
|
53987
53989
|
if (context.tracker.trackSymbol && ts.isComputedPropertyName(node) && isLateBindableName(node)) {
|
|
53988
53990
|
trackComputedName(node.expression, context.enclosingDeclaration, context);
|
|
53989
53991
|
}
|
|
53990
|
-
var visited = ts.visitEachChild(node,
|
|
53992
|
+
var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags);
|
|
53991
53993
|
if (ts.isBindingElement(visited)) {
|
|
53992
|
-
|
|
53993
|
-
|
|
53994
|
-
/* propertyName*/ undefined, visited.propertyName,
|
|
53995
|
-
/*initializer*/ undefined);
|
|
53996
|
-
}
|
|
53997
|
-
else {
|
|
53998
|
-
visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
|
|
53999
|
-
/*initializer*/ undefined);
|
|
54000
|
-
}
|
|
53994
|
+
visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
|
|
53995
|
+
/*initializer*/ undefined);
|
|
54001
53996
|
}
|
|
54002
53997
|
if (!ts.nodeIsSynthesized(visited)) {
|
|
54003
53998
|
visited = ts.factory.cloneNode(visited);
|
|
@@ -56992,7 +56987,11 @@ var ts;
|
|
|
56992
56987
|
if (reportErrors && !declarationBelongsToPrivateAmbientMember(element)) {
|
|
56993
56988
|
reportImplicitAny(element, anyType);
|
|
56994
56989
|
}
|
|
56995
|
-
|
|
56990
|
+
// When we're including the pattern in the type (an indication we're obtaining a contextual type), we
|
|
56991
|
+
// use a non-inferrable any type. Inference will never directly infer this type, but it is possible
|
|
56992
|
+
// to infer a type that contains it, e.g. for a binding pattern like [foo] or { foo }. In such cases,
|
|
56993
|
+
// widening of the binding pattern type substitutes a regular any for the non-inferrable any.
|
|
56994
|
+
return includePatternInType ? nonInferrableAnyType : anyType;
|
|
56996
56995
|
}
|
|
56997
56996
|
// Return the type implied by an object binding pattern
|
|
56998
56997
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {
|
|
@@ -59093,6 +59092,12 @@ var ts;
|
|
|
59093
59092
|
return mapType(type, getLowerBoundOfKeyType);
|
|
59094
59093
|
}
|
|
59095
59094
|
if (type.flags & 2097152 /* TypeFlags.Intersection */) {
|
|
59095
|
+
// Similarly to getTypeFromIntersectionTypeNode, we preserve the special string & {}, number & {},
|
|
59096
|
+
// and bigint & {} intersections that are used to prevent subtype reduction in union types.
|
|
59097
|
+
var types = type.types;
|
|
59098
|
+
if (types.length === 2 && !!(types[0].flags & (4 /* TypeFlags.String */ | 8 /* TypeFlags.Number */ | 64 /* TypeFlags.BigInt */)) && types[1] === emptyTypeLiteralType) {
|
|
59099
|
+
return type;
|
|
59100
|
+
}
|
|
59096
59101
|
return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType));
|
|
59097
59102
|
}
|
|
59098
59103
|
return type;
|
|
@@ -69280,7 +69285,10 @@ var ts;
|
|
|
69280
69285
|
//
|
|
69281
69286
|
// This flag is infectious; if we produce Box<never> (where never is silentNeverType), Box<never> is
|
|
69282
69287
|
// also non-inferrable.
|
|
69283
|
-
|
|
69288
|
+
//
|
|
69289
|
+
// As a special case, also ignore nonInferrableAnyType, which is a special form of the any type
|
|
69290
|
+
// used as a stand-in for binding elements when they are being inferred.
|
|
69291
|
+
if (ts.getObjectFlags(source) & 262144 /* ObjectFlags.NonInferrableType */ || source === nonInferrableAnyType) {
|
|
69284
69292
|
return;
|
|
69285
69293
|
}
|
|
69286
69294
|
if (!inference.isFixed) {
|
|
@@ -81446,7 +81454,7 @@ var ts;
|
|
|
81446
81454
|
checkDecorators(node);
|
|
81447
81455
|
}
|
|
81448
81456
|
function getEffectiveTypeArgumentAtIndex(node, typeParameters, index) {
|
|
81449
|
-
if (index <
|
|
81457
|
+
if (node.typeArguments && index < node.typeArguments.length) {
|
|
81450
81458
|
return getTypeFromTypeNode(node.typeArguments[index]);
|
|
81451
81459
|
}
|
|
81452
81460
|
return getEffectiveTypeArguments(node, typeParameters)[index];
|
|
@@ -90225,7 +90233,7 @@ var ts;
|
|
|
90225
90233
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
90226
90234
|
}
|
|
90227
90235
|
var nodeArguments = node.arguments;
|
|
90228
|
-
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
|
|
90236
|
+
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext && moduleKind !== ts.ModuleKind.Node16) {
|
|
90229
90237
|
// We are allowed trailing comma after proposal-import-assertions.
|
|
90230
90238
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
90231
90239
|
if (nodeArguments.length > 1) {
|
|
@@ -117872,7 +117880,7 @@ var ts;
|
|
|
117872
117880
|
state.failedLookupLocations = packageJsonLocations;
|
|
117873
117881
|
state.affectingLocations = packageJsonLocations;
|
|
117874
117882
|
var packageJsonScope = ts.getPackageScopeForPath(fileName, state);
|
|
117875
|
-
var impliedNodeFormat = (packageJsonScope === null || packageJsonScope === void 0 ? void 0 : packageJsonScope.packageJsonContent.type) === "module" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
117883
|
+
var impliedNodeFormat = (packageJsonScope === null || packageJsonScope === void 0 ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
117876
117884
|
return { impliedNodeFormat: impliedNodeFormat, packageJsonLocations: packageJsonLocations, packageJsonScope: packageJsonScope };
|
|
117877
117885
|
}
|
|
117878
117886
|
}
|
|
@@ -119603,7 +119611,7 @@ var ts;
|
|
|
119603
119611
|
// It's a _little odd_ that we can't set `impliedNodeFormat` until the program step - but it's the first and only time we have a resolution cache
|
|
119604
119612
|
// and a freshly made source file node on hand at the same time, and we need both to set the field. Persisting the resolution cache all the way
|
|
119605
119613
|
// to the check and emit steps would be bad - so we much prefer detecting and storing the format information on the source file node upfront.
|
|
119606
|
-
var result = getImpliedNodeFormatForFileWorker(
|
|
119614
|
+
var result = getImpliedNodeFormatForFileWorker(ts.getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
|
|
119607
119615
|
var languageVersion = ts.getEmitScriptTarget(options);
|
|
119608
119616
|
var setExternalModuleIndicator = ts.getSetExternalModuleIndicator(options);
|
|
119609
119617
|
return typeof result === "object" ? __assign(__assign({}, result), { languageVersion: languageVersion, setExternalModuleIndicator: setExternalModuleIndicator }) :
|
|
@@ -124264,7 +124272,7 @@ var ts;
|
|
|
124264
124272
|
var maybeBlockedByTypesVersions = false;
|
|
124265
124273
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
124266
124274
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
124267
|
-
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
124275
|
+
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
124268
124276
|
var importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
124269
124277
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
124270
124278
|
var conditions = ["node", importMode === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
@@ -124626,7 +124634,7 @@ var ts;
|
|
|
124626
124634
|
case ts.ModuleKind.CommonJS:
|
|
124627
124635
|
if (file.packageJsonScope) {
|
|
124628
124636
|
(result !== null && result !== void 0 ? result : (result = [])).push(ts.chainDiagnosticMessages(
|
|
124629
|
-
/*details*/ undefined, file.packageJsonScope.packageJsonContent.type ?
|
|
124637
|
+
/*details*/ undefined, file.packageJsonScope.contents.packageJsonContent.type ?
|
|
124630
124638
|
ts.Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module :
|
|
124631
124639
|
ts.Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type, toFileName(ts.last(file.packageJsonLocations), fileNameConvertor)));
|
|
124632
124640
|
}
|
|
@@ -141362,7 +141370,7 @@ var ts;
|
|
|
141362
141370
|
}
|
|
141363
141371
|
var parent = node.parent;
|
|
141364
141372
|
var typeChecker = program.getTypeChecker();
|
|
141365
|
-
if (node.kind === 159 /* SyntaxKind.OverrideKeyword */ || (ts.
|
|
141373
|
+
if (node.kind === 159 /* SyntaxKind.OverrideKeyword */ || (ts.isIdentifier(node) && ts.isJSDocOverrideTag(parent) && parent.tagName === node)) {
|
|
141366
141374
|
return getDefinitionFromOverriddenMember(typeChecker, node) || ts.emptyArray;
|
|
141367
141375
|
}
|
|
141368
141376
|
// Labels
|
|
@@ -178842,7 +178850,7 @@ var ts;
|
|
|
178842
178850
|
var packageDirectory = fileName.substring(0, nodeModulesPathParts.packageRootIndex);
|
|
178843
178851
|
var packageJsonCache = (_a = project.getModuleResolutionCache()) === null || _a === void 0 ? void 0 : _a.getPackageJsonInfoCache();
|
|
178844
178852
|
var compilerOptions = project.getCompilationSettings();
|
|
178845
|
-
var packageJson = ts.getPackageScopeForPath(
|
|
178853
|
+
var packageJson = ts.getPackageScopeForPath(ts.getNormalizedAbsolutePath(packageDirectory + "/package.json", project.getCurrentDirectory()), ts.getTemporaryModuleResolutionState(packageJsonCache, project, compilerOptions));
|
|
178846
178854
|
if (!packageJson)
|
|
178847
178855
|
return undefined;
|
|
178848
178856
|
// Use fake options instead of actual compiler options to avoid following export map if the project uses node16 or nodenext -
|