typescript 4.8.2 → 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 +165 -137
- package/lib/tsserver.js +186 -152
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +185 -151
- package/lib/typescript.js +177 -143
- package/lib/typescriptServices.js +177 -143
- package/lib/typingsInstaller.js +176 -142
- 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) {
|
|
@@ -8875,7 +8875,7 @@ var ts;
|
|
|
8875
8875
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),
|
|
8876
8876
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),
|
|
8877
8877
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),
|
|
8878
|
-
|
|
8878
|
+
This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),
|
|
8879
8879
|
_0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."),
|
|
8880
8880
|
_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),
|
|
8881
8881
|
_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."),
|
|
@@ -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
|
}
|
|
@@ -44636,7 +44637,7 @@ var ts;
|
|
|
44636
44637
|
var _a, _b;
|
|
44637
44638
|
if (path === undefined)
|
|
44638
44639
|
return path;
|
|
44639
|
-
return ts.
|
|
44640
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44640
44641
|
}
|
|
44641
44642
|
function combineDirectoryPath(root, dir) {
|
|
44642
44643
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -44656,7 +44657,7 @@ var ts;
|
|
|
44656
44657
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
44657
44658
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
44658
44659
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
44659
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
44660
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
44660
44661
|
// So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
|
|
44661
44662
|
// Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
|
|
44662
44663
|
// `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
|
|
@@ -44712,7 +44713,7 @@ var ts;
|
|
|
44712
44713
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
44713
44714
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
44714
44715
|
var candidateDir = candidateDirectories_1[_e];
|
|
44715
|
-
if (ts.
|
|
44716
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
44716
44717
|
// The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
|
|
44717
44718
|
var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
|
|
44718
44719
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
@@ -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");
|
|
@@ -50994,41 +50996,61 @@ var ts;
|
|
|
50994
50996
|
return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), /*sourceNode*/ undefined, dontResolveAlias);
|
|
50995
50997
|
}
|
|
50996
50998
|
function getTargetOfImportClause(node, dontResolveAlias) {
|
|
50997
|
-
var _a;
|
|
50998
50999
|
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
|
|
50999
51000
|
if (moduleSymbol) {
|
|
51000
|
-
|
|
51001
|
-
|
|
51002
|
-
|
|
51003
|
-
|
|
51004
|
-
|
|
51005
|
-
|
|
51006
|
-
|
|
51007
|
-
|
|
51008
|
-
|
|
51009
|
-
|
|
51010
|
-
|
|
51011
|
-
|
|
51012
|
-
|
|
51013
|
-
|
|
51014
|
-
|
|
51015
|
-
|
|
51016
|
-
|
|
51017
|
-
|
|
51018
|
-
|
|
51019
|
-
|
|
51020
|
-
|
|
51021
|
-
|
|
51001
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
51002
|
+
}
|
|
51003
|
+
}
|
|
51004
|
+
function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
|
|
51005
|
+
var _a;
|
|
51006
|
+
var exportDefaultSymbol;
|
|
51007
|
+
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
51008
|
+
exportDefaultSymbol = moduleSymbol;
|
|
51009
|
+
}
|
|
51010
|
+
else {
|
|
51011
|
+
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* InternalSymbolName.Default */, node, dontResolveAlias);
|
|
51012
|
+
}
|
|
51013
|
+
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
51014
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51015
|
+
if (!specifier) {
|
|
51016
|
+
return exportDefaultSymbol;
|
|
51017
|
+
}
|
|
51018
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
51019
|
+
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
51020
|
+
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
51021
|
+
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
51022
|
+
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
51023
|
+
var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* InternalSymbolName.ExportEquals */);
|
|
51024
|
+
var exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
51025
|
+
var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
|
|
51026
|
+
if (exportAssignment) {
|
|
51027
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
|
|
51022
51028
|
}
|
|
51023
51029
|
}
|
|
51024
|
-
else if (
|
|
51025
|
-
|
|
51026
|
-
var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
51027
|
-
markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
|
|
51028
|
-
return resolved;
|
|
51030
|
+
else if (ts.isImportClause(node)) {
|
|
51031
|
+
reportNonDefaultExport(moduleSymbol, node);
|
|
51029
51032
|
}
|
|
51030
|
-
|
|
51031
|
-
|
|
51033
|
+
else {
|
|
51034
|
+
errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, ts.isImportOrExportSpecifier(node) && node.propertyName || node.name);
|
|
51035
|
+
}
|
|
51036
|
+
}
|
|
51037
|
+
else if (hasSyntheticDefault || hasDefaultOnly) {
|
|
51038
|
+
// per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
|
|
51039
|
+
var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
51040
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
|
|
51041
|
+
return resolved;
|
|
51042
|
+
}
|
|
51043
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);
|
|
51044
|
+
return exportDefaultSymbol;
|
|
51045
|
+
}
|
|
51046
|
+
function getModuleSpecifierForImportOrExport(node) {
|
|
51047
|
+
switch (node.kind) {
|
|
51048
|
+
case 267 /* SyntaxKind.ImportClause */: return node.parent.moduleSpecifier;
|
|
51049
|
+
case 265 /* SyntaxKind.ImportEqualsDeclaration */: return ts.isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
|
|
51050
|
+
case 268 /* SyntaxKind.NamespaceImport */: return node.parent.parent.moduleSpecifier;
|
|
51051
|
+
case 270 /* SyntaxKind.ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier;
|
|
51052
|
+
case 275 /* SyntaxKind.ExportSpecifier */: return node.parent.parent.moduleSpecifier;
|
|
51053
|
+
default: return ts.Debug.assertNever(node);
|
|
51032
51054
|
}
|
|
51033
51055
|
}
|
|
51034
51056
|
function reportNonDefaultExport(moduleSymbol, node) {
|
|
@@ -51118,7 +51140,7 @@ var ts;
|
|
|
51118
51140
|
}
|
|
51119
51141
|
}
|
|
51120
51142
|
function getExternalModuleMember(node, specifier, dontResolveAlias) {
|
|
51121
|
-
var _a
|
|
51143
|
+
var _a;
|
|
51122
51144
|
if (dontResolveAlias === void 0) { dontResolveAlias = false; }
|
|
51123
51145
|
var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
51124
51146
|
var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217
|
|
@@ -51154,29 +51176,33 @@ var ts;
|
|
|
51154
51176
|
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
|
|
51155
51177
|
symbolFromModule || symbolFromVariable;
|
|
51156
51178
|
if (!symbol) {
|
|
51157
|
-
|
|
51158
|
-
var declarationName = ts.declarationNameToString(name);
|
|
51159
|
-
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
51160
|
-
if (suggestion !== undefined) {
|
|
51161
|
-
var suggestionName = symbolToString(suggestion);
|
|
51162
|
-
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
51163
|
-
if (suggestion.valueDeclaration) {
|
|
51164
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
51165
|
-
}
|
|
51166
|
-
}
|
|
51167
|
-
else {
|
|
51168
|
-
if ((_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.has("default" /* InternalSymbolName.Default */)) {
|
|
51169
|
-
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
51170
|
-
}
|
|
51171
|
-
else {
|
|
51172
|
-
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
51173
|
-
}
|
|
51174
|
-
}
|
|
51179
|
+
errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name);
|
|
51175
51180
|
}
|
|
51176
51181
|
return symbol;
|
|
51177
51182
|
}
|
|
51178
51183
|
}
|
|
51179
51184
|
}
|
|
51185
|
+
function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
|
|
51186
|
+
var _a;
|
|
51187
|
+
var moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
51188
|
+
var declarationName = ts.declarationNameToString(name);
|
|
51189
|
+
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
51190
|
+
if (suggestion !== undefined) {
|
|
51191
|
+
var suggestionName = symbolToString(suggestion);
|
|
51192
|
+
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
51193
|
+
if (suggestion.valueDeclaration) {
|
|
51194
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
51195
|
+
}
|
|
51196
|
+
}
|
|
51197
|
+
else {
|
|
51198
|
+
if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has("default" /* InternalSymbolName.Default */)) {
|
|
51199
|
+
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
51200
|
+
}
|
|
51201
|
+
else {
|
|
51202
|
+
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
51203
|
+
}
|
|
51204
|
+
}
|
|
51205
|
+
}
|
|
51180
51206
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
51181
51207
|
var _a, _b;
|
|
51182
51208
|
var localSymbol = (_b = (_a = moduleSymbol.valueDeclaration) === null || _a === void 0 ? void 0 : _a.locals) === null || _b === void 0 ? void 0 : _b.get(name.escapedText);
|
|
@@ -51222,6 +51248,13 @@ var ts;
|
|
|
51222
51248
|
}
|
|
51223
51249
|
}
|
|
51224
51250
|
function getTargetOfImportSpecifier(node, dontResolveAlias) {
|
|
51251
|
+
if (ts.isImportSpecifier(node) && ts.idText(node.propertyName || node.name) === "default" /* InternalSymbolName.Default */) {
|
|
51252
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51253
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
51254
|
+
if (moduleSymbol) {
|
|
51255
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
51256
|
+
}
|
|
51257
|
+
}
|
|
51225
51258
|
var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;
|
|
51226
51259
|
var commonJSPropertyAccess = getCommonJSPropertyAccess(root);
|
|
51227
51260
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
@@ -51243,6 +51276,13 @@ var ts;
|
|
|
51243
51276
|
return resolved;
|
|
51244
51277
|
}
|
|
51245
51278
|
function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
|
|
51279
|
+
if (ts.idText(node.propertyName || node.name) === "default" /* InternalSymbolName.Default */) {
|
|
51280
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51281
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
51282
|
+
if (moduleSymbol) {
|
|
51283
|
+
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
|
|
51284
|
+
}
|
|
51285
|
+
}
|
|
51246
51286
|
var resolved = node.parent.parent.moduleSpecifier ?
|
|
51247
51287
|
getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
|
|
51248
51288
|
resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias);
|
|
@@ -51716,7 +51756,7 @@ var ts;
|
|
|
51716
51756
|
if (ext === ".ts" /* Extension.Ts */ || ext === ".js" /* Extension.Js */ || ext === ".tsx" /* Extension.Tsx */ || ext === ".jsx" /* Extension.Jsx */) {
|
|
51717
51757
|
var scope = currentSourceFile.packageJsonScope;
|
|
51718
51758
|
var targetExt = ext === ".ts" /* Extension.Ts */ ? ".mts" /* Extension.Mts */ : ext === ".js" /* Extension.Js */ ? ".mjs" /* Extension.Mjs */ : undefined;
|
|
51719
|
-
if (scope && !scope.packageJsonContent.type) {
|
|
51759
|
+
if (scope && !scope.contents.packageJsonContent.type) {
|
|
51720
51760
|
if (targetExt) {
|
|
51721
51761
|
diagnosticDetails = ts.chainDiagnosticMessages(
|
|
51722
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"));
|
|
@@ -53944,22 +53984,15 @@ var ts;
|
|
|
53944
53984
|
context.approximateLength += ts.symbolName(parameterSymbol).length + 3;
|
|
53945
53985
|
return parameterNode;
|
|
53946
53986
|
function cloneBindingName(node) {
|
|
53947
|
-
return
|
|
53948
|
-
function
|
|
53987
|
+
return elideInitializerAndSetEmitFlags(node);
|
|
53988
|
+
function elideInitializerAndSetEmitFlags(node) {
|
|
53949
53989
|
if (context.tracker.trackSymbol && ts.isComputedPropertyName(node) && isLateBindableName(node)) {
|
|
53950
53990
|
trackComputedName(node.expression, context.enclosingDeclaration, context);
|
|
53951
53991
|
}
|
|
53952
|
-
var visited = ts.visitEachChild(node,
|
|
53992
|
+
var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags);
|
|
53953
53993
|
if (ts.isBindingElement(visited)) {
|
|
53954
|
-
|
|
53955
|
-
|
|
53956
|
-
/* propertyName*/ undefined, visited.propertyName,
|
|
53957
|
-
/*initializer*/ undefined);
|
|
53958
|
-
}
|
|
53959
|
-
else {
|
|
53960
|
-
visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
|
|
53961
|
-
/*initializer*/ undefined);
|
|
53962
|
-
}
|
|
53994
|
+
visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
|
|
53995
|
+
/*initializer*/ undefined);
|
|
53963
53996
|
}
|
|
53964
53997
|
if (!ts.nodeIsSynthesized(visited)) {
|
|
53965
53998
|
visited = ts.factory.cloneNode(visited);
|
|
@@ -56954,7 +56987,11 @@ var ts;
|
|
|
56954
56987
|
if (reportErrors && !declarationBelongsToPrivateAmbientMember(element)) {
|
|
56955
56988
|
reportImplicitAny(element, anyType);
|
|
56956
56989
|
}
|
|
56957
|
-
|
|
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;
|
|
56958
56995
|
}
|
|
56959
56996
|
// Return the type implied by an object binding pattern
|
|
56960
56997
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {
|
|
@@ -59055,6 +59092,12 @@ var ts;
|
|
|
59055
59092
|
return mapType(type, getLowerBoundOfKeyType);
|
|
59056
59093
|
}
|
|
59057
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
|
+
}
|
|
59058
59101
|
return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType));
|
|
59059
59102
|
}
|
|
59060
59103
|
return type;
|
|
@@ -62193,7 +62236,7 @@ var ts;
|
|
|
62193
62236
|
return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
|
|
62194
62237
|
}
|
|
62195
62238
|
if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
|
|
62196
|
-
return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62239
|
+
return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
|
|
62197
62240
|
}
|
|
62198
62241
|
if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
|
|
62199
62242
|
includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
|
|
@@ -62883,7 +62926,7 @@ var ts;
|
|
|
62883
62926
|
// (T | U)[K] -> T[K] | U[K] (reading)
|
|
62884
62927
|
// (T | U)[K] -> T[K] & U[K] (writing)
|
|
62885
62928
|
// (T & U)[K] -> T[K] & U[K]
|
|
62886
|
-
if (objectType.flags &
|
|
62929
|
+
if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
62887
62930
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
62888
62931
|
return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
|
|
62889
62932
|
}
|
|
@@ -65291,7 +65334,7 @@ var ts;
|
|
|
65291
65334
|
if (reduced !== type) {
|
|
65292
65335
|
return reduced;
|
|
65293
65336
|
}
|
|
65294
|
-
if (type.flags & 2097152 /* TypeFlags.Intersection */) {
|
|
65337
|
+
if (type.flags & 2097152 /* TypeFlags.Intersection */ && ts.some(type.types, isEmptyAnonymousObjectType)) {
|
|
65295
65338
|
var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
|
|
65296
65339
|
if (normalizedTypes !== type.types) {
|
|
65297
65340
|
return getIntersectionType(normalizedTypes);
|
|
@@ -66462,7 +66505,7 @@ var ts;
|
|
|
66462
66505
|
// create a new chain for the constraint error
|
|
66463
66506
|
resetErrorInfo(saveErrorInfo);
|
|
66464
66507
|
}
|
|
66465
|
-
if (result = isRelatedTo(source, constraint, 2 /* RecursionFlags.Target */, reportErrors)) {
|
|
66508
|
+
if (result = isRelatedTo(source, constraint, 2 /* RecursionFlags.Target */, reportErrors, /* headMessage */ undefined, intersectionState)) {
|
|
66466
66509
|
return result;
|
|
66467
66510
|
}
|
|
66468
66511
|
// prefer the shorter chain of the constraint comparison chain, and the direct comparison chain
|
|
@@ -66554,8 +66597,8 @@ var ts;
|
|
|
66554
66597
|
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
66555
66598
|
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
66556
66599
|
// TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
|
|
66557
|
-
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false)) {
|
|
66558
|
-
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false);
|
|
66600
|
+
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
66601
|
+
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);
|
|
66559
66602
|
if (result) {
|
|
66560
66603
|
return result;
|
|
66561
66604
|
}
|
|
@@ -69242,7 +69285,10 @@ var ts;
|
|
|
69242
69285
|
//
|
|
69243
69286
|
// This flag is infectious; if we produce Box<never> (where never is silentNeverType), Box<never> is
|
|
69244
69287
|
// also non-inferrable.
|
|
69245
|
-
|
|
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) {
|
|
69246
69292
|
return;
|
|
69247
69293
|
}
|
|
69248
69294
|
if (!inference.isFixed) {
|
|
@@ -71584,7 +71630,7 @@ var ts;
|
|
|
71584
71630
|
var narrowedPropType = narrowType(propType);
|
|
71585
71631
|
return filterType(type, function (t) {
|
|
71586
71632
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
71587
|
-
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) &&
|
|
71633
|
+
return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
71588
71634
|
});
|
|
71589
71635
|
}
|
|
71590
71636
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -71633,7 +71679,7 @@ var ts;
|
|
|
71633
71679
|
}
|
|
71634
71680
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
71635
71681
|
if (type.flags & 1048576 /* TypeFlags.Union */
|
|
71636
|
-
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
|
|
71682
|
+
|| type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
71637
71683
|
|| ts.isThisTypeParameter(type)
|
|
71638
71684
|
|| type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
71639
71685
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -71766,14 +71812,18 @@ var ts;
|
|
|
71766
71812
|
assumeTrue = !assumeTrue;
|
|
71767
71813
|
}
|
|
71768
71814
|
var valueType = getTypeOfExpression(value);
|
|
71769
|
-
if ((type.flags & 2 /* TypeFlags.Unknown */)
|
|
71815
|
+
if (((type.flags & 2 /* TypeFlags.Unknown */) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304 /* TypeFlags.Nullable */)) &&
|
|
71816
|
+
assumeTrue &&
|
|
71817
|
+
(operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
|
|
71770
71818
|
if (valueType.flags & (131068 /* TypeFlags.Primitive */ | 67108864 /* TypeFlags.NonPrimitive */)) {
|
|
71771
71819
|
return valueType;
|
|
71772
71820
|
}
|
|
71773
71821
|
if (valueType.flags & 524288 /* TypeFlags.Object */) {
|
|
71774
71822
|
return nonPrimitiveType;
|
|
71775
71823
|
}
|
|
71776
|
-
|
|
71824
|
+
if (type.flags & 2 /* TypeFlags.Unknown */) {
|
|
71825
|
+
return type;
|
|
71826
|
+
}
|
|
71777
71827
|
}
|
|
71778
71828
|
if (valueType.flags & 98304 /* TypeFlags.Nullable */) {
|
|
71779
71829
|
if (!strictNullChecks) {
|
|
@@ -72232,7 +72282,9 @@ var ts;
|
|
|
72232
72282
|
!!(type.flags & 465829888 /* TypeFlags.Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* TypeFlags.Nullable */ | 1048576 /* TypeFlags.Union */));
|
|
72233
72283
|
}
|
|
72234
72284
|
function isGenericTypeWithoutNullableConstraint(type) {
|
|
72235
|
-
return
|
|
72285
|
+
return type.flags & 2097152 /* TypeFlags.Intersection */ ?
|
|
72286
|
+
ts.some(type.types, isGenericTypeWithoutNullableConstraint) :
|
|
72287
|
+
!!(type.flags & 465829888 /* TypeFlags.Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* TypeFlags.Nullable */));
|
|
72236
72288
|
}
|
|
72237
72289
|
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
72238
72290
|
// Computing the contextual type for a child of a JSX element involves resolving the type of the
|
|
@@ -81402,7 +81454,7 @@ var ts;
|
|
|
81402
81454
|
checkDecorators(node);
|
|
81403
81455
|
}
|
|
81404
81456
|
function getEffectiveTypeArgumentAtIndex(node, typeParameters, index) {
|
|
81405
|
-
if (index <
|
|
81457
|
+
if (node.typeArguments && index < node.typeArguments.length) {
|
|
81406
81458
|
return getTypeFromTypeNode(node.typeArguments[index]);
|
|
81407
81459
|
}
|
|
81408
81460
|
return getEffectiveTypeArguments(node, typeParameters)[index];
|
|
@@ -90181,7 +90233,7 @@ var ts;
|
|
|
90181
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);
|
|
90182
90234
|
}
|
|
90183
90235
|
var nodeArguments = node.arguments;
|
|
90184
|
-
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
|
|
90236
|
+
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext && moduleKind !== ts.ModuleKind.Node16) {
|
|
90185
90237
|
// We are allowed trailing comma after proposal-import-assertions.
|
|
90186
90238
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
90187
90239
|
if (nodeArguments.length > 1) {
|
|
@@ -117828,7 +117880,7 @@ var ts;
|
|
|
117828
117880
|
state.failedLookupLocations = packageJsonLocations;
|
|
117829
117881
|
state.affectingLocations = packageJsonLocations;
|
|
117830
117882
|
var packageJsonScope = ts.getPackageScopeForPath(fileName, state);
|
|
117831
|
-
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;
|
|
117832
117884
|
return { impliedNodeFormat: impliedNodeFormat, packageJsonLocations: packageJsonLocations, packageJsonScope: packageJsonScope };
|
|
117833
117885
|
}
|
|
117834
117886
|
}
|
|
@@ -119559,7 +119611,7 @@ var ts;
|
|
|
119559
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
|
|
119560
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
|
|
119561
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.
|
|
119562
|
-
var result = getImpliedNodeFormatForFileWorker(
|
|
119614
|
+
var result = getImpliedNodeFormatForFileWorker(ts.getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
|
|
119563
119615
|
var languageVersion = ts.getEmitScriptTarget(options);
|
|
119564
119616
|
var setExternalModuleIndicator = ts.getSetExternalModuleIndicator(options);
|
|
119565
119617
|
return typeof result === "object" ? __assign(__assign({}, result), { languageVersion: languageVersion, setExternalModuleIndicator: setExternalModuleIndicator }) :
|
|
@@ -124220,7 +124272,7 @@ var ts;
|
|
|
124220
124272
|
var maybeBlockedByTypesVersions = false;
|
|
124221
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);
|
|
124222
124274
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
124223
|
-
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));
|
|
124224
124276
|
var importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
124225
124277
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
124226
124278
|
var conditions = ["node", importMode === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
@@ -124582,7 +124634,7 @@ var ts;
|
|
|
124582
124634
|
case ts.ModuleKind.CommonJS:
|
|
124583
124635
|
if (file.packageJsonScope) {
|
|
124584
124636
|
(result !== null && result !== void 0 ? result : (result = [])).push(ts.chainDiagnosticMessages(
|
|
124585
|
-
/*details*/ undefined, file.packageJsonScope.packageJsonContent.type ?
|
|
124637
|
+
/*details*/ undefined, file.packageJsonScope.contents.packageJsonContent.type ?
|
|
124586
124638
|
ts.Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module :
|
|
124587
124639
|
ts.Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type, toFileName(ts.last(file.packageJsonLocations), fileNameConvertor)));
|
|
124588
124640
|
}
|
|
@@ -126929,9 +126981,7 @@ var ts;
|
|
|
126929
126981
|
}
|
|
126930
126982
|
}
|
|
126931
126983
|
}
|
|
126932
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
126933
126984
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
126934
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
126935
126985
|
/** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
|
|
126936
126986
|
var pseudoUpToDate = false;
|
|
126937
126987
|
var usesPrepend = false;
|
|
@@ -126946,7 +126996,7 @@ var ts;
|
|
|
126946
126996
|
continue;
|
|
126947
126997
|
}
|
|
126948
126998
|
// Check if tsbuildinfo path is shared, then we need to rebuild
|
|
126949
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
126999
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
126950
127000
|
return {
|
|
126951
127001
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
126952
127002
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -127004,25 +127054,9 @@ var ts;
|
|
|
127004
127054
|
oldestOutputFileName: oldestOutputFileName
|
|
127005
127055
|
};
|
|
127006
127056
|
}
|
|
127007
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
127008
|
-
if (seenRefs.has(resolvedRefPath))
|
|
127009
|
-
return false;
|
|
127010
|
-
seenRefs.add(resolvedRefPath);
|
|
127057
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
127011
127058
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
127012
|
-
|
|
127013
|
-
return true;
|
|
127014
|
-
if (resolvedConfig.projectReferences) {
|
|
127015
|
-
// Check references
|
|
127016
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
127017
|
-
var ref = _a[_i];
|
|
127018
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
127019
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
127020
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
127021
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
127022
|
-
return true;
|
|
127023
|
-
}
|
|
127024
|
-
}
|
|
127025
|
-
return false;
|
|
127059
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
127026
127060
|
}
|
|
127027
127061
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
127028
127062
|
if (project === undefined) {
|
|
@@ -141336,7 +141370,7 @@ var ts;
|
|
|
141336
141370
|
}
|
|
141337
141371
|
var parent = node.parent;
|
|
141338
141372
|
var typeChecker = program.getTypeChecker();
|
|
141339
|
-
if (node.kind === 159 /* SyntaxKind.OverrideKeyword */ || (ts.
|
|
141373
|
+
if (node.kind === 159 /* SyntaxKind.OverrideKeyword */ || (ts.isIdentifier(node) && ts.isJSDocOverrideTag(parent) && parent.tagName === node)) {
|
|
141340
141374
|
return getDefinitionFromOverriddenMember(typeChecker, node) || ts.emptyArray;
|
|
141341
141375
|
}
|
|
141342
141376
|
// Labels
|
|
@@ -171614,13 +171648,13 @@ var ts;
|
|
|
171614
171648
|
return __generator(this, function (_a) {
|
|
171615
171649
|
switch (_a.label) {
|
|
171616
171650
|
case 0:
|
|
171617
|
-
ts.Debug.assertIsDefined(host.
|
|
171651
|
+
ts.Debug.assertIsDefined(host.importPlugin);
|
|
171618
171652
|
resolvedPath = ts.combinePaths(initialDir, "node_modules");
|
|
171619
171653
|
log("Dynamically importing ".concat(moduleName, " from ").concat(initialDir, " (resolved to ").concat(resolvedPath, ")"));
|
|
171620
171654
|
_a.label = 1;
|
|
171621
171655
|
case 1:
|
|
171622
171656
|
_a.trys.push([1, 3, , 4]);
|
|
171623
|
-
return [4 /*yield*/, host.
|
|
171657
|
+
return [4 /*yield*/, host.importPlugin(resolvedPath, moduleName)];
|
|
171624
171658
|
case 2:
|
|
171625
171659
|
result = _a.sent();
|
|
171626
171660
|
return [3 /*break*/, 4];
|
|
@@ -172699,7 +172733,7 @@ var ts;
|
|
|
172699
172733
|
};
|
|
172700
172734
|
Project.prototype.enableGlobalPlugins = function (options, pluginConfigOverrides) {
|
|
172701
172735
|
var host = this.projectService.host;
|
|
172702
|
-
if (!host.require && !host.
|
|
172736
|
+
if (!host.require && !host.importPlugin) {
|
|
172703
172737
|
this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
|
|
172704
172738
|
return;
|
|
172705
172739
|
}
|
|
@@ -172756,7 +172790,7 @@ var ts;
|
|
|
172756
172790
|
return __generator(this, function (_a) {
|
|
172757
172791
|
switch (_a.label) {
|
|
172758
172792
|
case 0:
|
|
172759
|
-
ts.Debug.assertIsDefined(this.projectService.host.
|
|
172793
|
+
ts.Debug.assertIsDefined(this.projectService.host.importPlugin);
|
|
172760
172794
|
log = function (message) { return _this.projectService.logger.info(message); };
|
|
172761
172795
|
logError = function (message) {
|
|
172762
172796
|
(errorLogs !== null && errorLogs !== void 0 ? errorLogs : (errorLogs = [])).push(message);
|
|
@@ -173457,7 +173491,7 @@ var ts;
|
|
|
173457
173491
|
/*@internal*/
|
|
173458
173492
|
ConfiguredProject.prototype.enablePluginsWithOptions = function (options, pluginConfigOverrides) {
|
|
173459
173493
|
var host = this.projectService.host;
|
|
173460
|
-
if (!host.require && !host.
|
|
173494
|
+
if (!host.require && !host.importPlugin) {
|
|
173461
173495
|
this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
|
|
173462
173496
|
return;
|
|
173463
173497
|
}
|
|
@@ -176901,7 +176935,7 @@ var ts;
|
|
|
176901
176935
|
/*@internal*/
|
|
176902
176936
|
ProjectService.prototype.requestEnablePlugin = function (project, pluginConfigEntry, searchPaths, pluginConfigOverrides) {
|
|
176903
176937
|
var _a;
|
|
176904
|
-
if (!this.host.
|
|
176938
|
+
if (!this.host.importPlugin && !this.host.require) {
|
|
176905
176939
|
this.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
|
|
176906
176940
|
return;
|
|
176907
176941
|
}
|
|
@@ -176911,7 +176945,7 @@ var ts;
|
|
|
176911
176945
|
return;
|
|
176912
176946
|
}
|
|
176913
176947
|
// If the host supports dynamic import, begin enabling the plugin asynchronously.
|
|
176914
|
-
if (this.host.
|
|
176948
|
+
if (this.host.importPlugin) {
|
|
176915
176949
|
var importPromise = project.beginEnablePluginAsync(pluginConfigEntry, searchPaths, pluginConfigOverrides);
|
|
176916
176950
|
(_a = this.pendingPluginEnablements) !== null && _a !== void 0 ? _a : (this.pendingPluginEnablements = new ts.Map());
|
|
176917
176951
|
var promises = this.pendingPluginEnablements.get(project);
|
|
@@ -178816,7 +178850,7 @@ var ts;
|
|
|
178816
178850
|
var packageDirectory = fileName.substring(0, nodeModulesPathParts.packageRootIndex);
|
|
178817
178851
|
var packageJsonCache = (_a = project.getModuleResolutionCache()) === null || _a === void 0 ? void 0 : _a.getPackageJsonInfoCache();
|
|
178818
178852
|
var compilerOptions = project.getCompilationSettings();
|
|
178819
|
-
var packageJson = ts.getPackageScopeForPath(
|
|
178853
|
+
var packageJson = ts.getPackageScopeForPath(ts.getNormalizedAbsolutePath(packageDirectory + "/package.json", project.getCurrentDirectory()), ts.getTemporaryModuleResolutionState(packageJsonCache, project, compilerOptions));
|
|
178820
178854
|
if (!packageJson)
|
|
178821
178855
|
return undefined;
|
|
178822
178856
|
// Use fake options instead of actual compiler options to avoid following export map if the project uses node16 or nodenext -
|
|
@@ -181210,7 +181244,7 @@ var ts;
|
|
|
181210
181244
|
setImmediate: function (x) { return setTimeout(x, 0); },
|
|
181211
181245
|
clearImmediate: function (handle) { return clearTimeout(handle); },
|
|
181212
181246
|
/* eslint-enable no-restricted-globals */
|
|
181213
|
-
|
|
181247
|
+
importPlugin: function (initialDir, moduleName) { return __awaiter(_this, void 0, void 0, function () {
|
|
181214
181248
|
var packageRoot, packageJson, packageJsonResponse, e_1, browser, scriptPath, module_1, e_2;
|
|
181215
181249
|
return __generator(this, function (_a) {
|
|
181216
181250
|
switch (_a.label) {
|