@typescript-deploys/pr-build 5.4.0-pr-56785-6 → 5.4.0-pr-56805-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/lib.esnext.collection.d.ts +29 -0
- package/lib/lib.esnext.d.ts +2 -0
- package/lib/lib.esnext.object.d.ts +29 -0
- package/lib/tsc.js +77 -106
- package/lib/tsserver.js +94 -122
- package/lib/typescript.d.ts +4 -9
- package/lib/typescript.js +93 -122
- package/lib/typingsInstaller.js +24 -15
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -3767,7 +3767,6 @@ var ModuleKind = /* @__PURE__ */ ((ModuleKind2) => {
|
|
|
3767
3767
|
ModuleKind2[ModuleKind2["ESNext"] = 99] = "ESNext";
|
|
3768
3768
|
ModuleKind2[ModuleKind2["Node16"] = 100] = "Node16";
|
|
3769
3769
|
ModuleKind2[ModuleKind2["NodeNext"] = 199] = "NodeNext";
|
|
3770
|
-
ModuleKind2[ModuleKind2["Preserve"] = 200] = "Preserve";
|
|
3771
3770
|
return ModuleKind2;
|
|
3772
3771
|
})(ModuleKind || {});
|
|
3773
3772
|
var ScriptKind = /* @__PURE__ */ ((ScriptKind3) => {
|
|
@@ -6005,7 +6004,7 @@ var Diagnostics = {
|
|
|
6005
6004
|
await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6006
6005
|
_0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
6007
6006
|
_0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
6008
|
-
|
|
6007
|
+
Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
6009
6008
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
|
|
6010
6009
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
|
|
6011
6010
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -6056,7 +6055,7 @@ var Diagnostics = {
|
|
|
6056
6055
|
File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
6057
6056
|
The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
6058
6057
|
for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6059
|
-
|
|
6058
|
+
Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
6060
6059
|
Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
|
|
6061
6060
|
Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
6062
6061
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -6639,9 +6638,9 @@ var Diagnostics = {
|
|
|
6639
6638
|
Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
|
|
6640
6639
|
Namespace_name_cannot_be_0: diag(2819, 1 /* Error */, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
|
|
6641
6640
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
6642
|
-
|
|
6641
|
+
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
6643
6642
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
6644
|
-
|
|
6643
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
6645
6644
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
6646
6645
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
6647
6646
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
@@ -6661,7 +6660,7 @@ var Diagnostics = {
|
|
|
6661
6660
|
The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1 /* Error */, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
|
|
6662
6661
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
6663
6662
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6664
|
-
|
|
6663
|
+
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
6665
6664
|
Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
|
|
6666
6665
|
Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
6667
6666
|
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
|
|
@@ -6815,7 +6814,7 @@ var Diagnostics = {
|
|
|
6815
6814
|
Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, 1 /* Error */, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
|
|
6816
6815
|
Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),
|
|
6817
6816
|
Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic: diag(5070, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070", "Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),
|
|
6818
|
-
|
|
6817
|
+
Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, 1 /* Error */, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),
|
|
6819
6818
|
Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
|
|
6820
6819
|
Build_option_0_requires_a_value_of_type_1: diag(5073, 1 /* Error */, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."),
|
|
6821
6820
|
Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, 1 /* Error */, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),
|
|
@@ -6838,7 +6837,7 @@ var Diagnostics = {
|
|
|
6838
6837
|
The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
|
|
6839
6838
|
Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
|
|
6840
6839
|
Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
|
|
6841
|
-
|
|
6840
|
+
Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."),
|
|
6842
6841
|
Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
|
|
6843
6842
|
An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
|
|
6844
6843
|
Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
|
|
@@ -11547,13 +11546,13 @@ function packageIdToString(packageId) {
|
|
|
11547
11546
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
11548
11547
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
11549
11548
|
}
|
|
11550
|
-
function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter
|
|
11549
|
+
function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
|
|
11551
11550
|
Debug.assert(names.length === newResolutions.length);
|
|
11552
11551
|
for (let i = 0; i < names.length; i++) {
|
|
11553
11552
|
const newResolution = newResolutions[i];
|
|
11554
11553
|
const entry = names[i];
|
|
11555
11554
|
const name = nameAndModeGetter.getName(entry);
|
|
11556
|
-
const mode = nameAndModeGetter.getMode(entry, newSourceFile
|
|
11555
|
+
const mode = nameAndModeGetter.getMode(entry, newSourceFile);
|
|
11557
11556
|
const oldResolution = getOldResolution(name, mode);
|
|
11558
11557
|
const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
|
|
11559
11558
|
if (changed) {
|
|
@@ -16397,9 +16396,6 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
16397
16396
|
case 199 /* NodeNext */:
|
|
16398
16397
|
moduleResolution = 99 /* NodeNext */;
|
|
16399
16398
|
break;
|
|
16400
|
-
case 200 /* Preserve */:
|
|
16401
|
-
moduleResolution = 100 /* Bundler */;
|
|
16402
|
-
break;
|
|
16403
16399
|
default:
|
|
16404
16400
|
moduleResolution = 1 /* Classic */;
|
|
16405
16401
|
break;
|
|
@@ -16429,7 +16425,6 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
16429
16425
|
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
16430
16426
|
case 100 /* Node16 */:
|
|
16431
16427
|
case 199 /* NodeNext */:
|
|
16432
|
-
case 200 /* Preserve */:
|
|
16433
16428
|
return true;
|
|
16434
16429
|
}
|
|
16435
16430
|
return false;
|
|
@@ -16597,12 +16592,18 @@ function emitModuleKindIsNonNodeESM(moduleKind) {
|
|
|
16597
16592
|
}
|
|
16598
16593
|
function hasJsonModuleEmitEnabled(options) {
|
|
16599
16594
|
switch (getEmitModuleKind(options)) {
|
|
16600
|
-
case
|
|
16601
|
-
case
|
|
16602
|
-
case
|
|
16595
|
+
case 1 /* CommonJS */:
|
|
16596
|
+
case 2 /* AMD */:
|
|
16597
|
+
case 5 /* ES2015 */:
|
|
16598
|
+
case 6 /* ES2020 */:
|
|
16599
|
+
case 7 /* ES2022 */:
|
|
16600
|
+
case 99 /* ESNext */:
|
|
16601
|
+
case 100 /* Node16 */:
|
|
16602
|
+
case 199 /* NodeNext */:
|
|
16603
|
+
return true;
|
|
16604
|
+
default:
|
|
16603
16605
|
return false;
|
|
16604
16606
|
}
|
|
16605
|
-
return true;
|
|
16606
16607
|
}
|
|
16607
16608
|
function unreachableCodeIsError(options) {
|
|
16608
16609
|
return options.allowUnreachableCode === false;
|
|
@@ -16613,6 +16614,9 @@ function unusedLabelIsError(options) {
|
|
|
16613
16614
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
16614
16615
|
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
16615
16616
|
}
|
|
16617
|
+
function shouldResolveJsRequire(compilerOptions) {
|
|
16618
|
+
return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
|
|
16619
|
+
}
|
|
16616
16620
|
function getStrictOptionValue(compilerOptions, flag) {
|
|
16617
16621
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
16618
16622
|
}
|
|
@@ -16989,8 +16993,7 @@ function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtens
|
|
|
16989
16993
|
return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false;
|
|
16990
16994
|
}
|
|
16991
16995
|
function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
|
|
16992
|
-
|
|
16993
|
-
if (preference === "js" || resolutionMode === 99 /* ESNext */ && 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */) {
|
|
16996
|
+
if (preference === "js" || resolutionMode === 99 /* ESNext */) {
|
|
16994
16997
|
if (!shouldAllowImportingTsExtension(compilerOptions)) {
|
|
16995
16998
|
return 2 /* JsExtension */;
|
|
16996
16999
|
}
|
|
@@ -34044,7 +34047,7 @@ var libEntries = [
|
|
|
34044
34047
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
34045
34048
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
34046
34049
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
34047
|
-
["esnext.collection", "lib.
|
|
34050
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
34048
34051
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
34049
34052
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
34050
34053
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -34054,6 +34057,7 @@ var libEntries = [
|
|
|
34054
34057
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
34055
34058
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
34056
34059
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
34060
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
34057
34061
|
["decorators", "lib.decorators.d.ts"],
|
|
34058
34062
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
34059
34063
|
];
|
|
@@ -34359,8 +34363,7 @@ var moduleOptionDeclaration = {
|
|
|
34359
34363
|
es2022: 7 /* ES2022 */,
|
|
34360
34364
|
esnext: 99 /* ESNext */,
|
|
34361
34365
|
node16: 100 /* Node16 */,
|
|
34362
|
-
nodenext: 199 /* NodeNext
|
|
34363
|
-
preserve: 200 /* Preserve */
|
|
34366
|
+
nodenext: 199 /* NodeNext */
|
|
34364
34367
|
})),
|
|
34365
34368
|
affectsSourceFile: true,
|
|
34366
34369
|
affectsModuleResolution: true,
|
|
@@ -37954,7 +37957,20 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
37954
37957
|
} else {
|
|
37955
37958
|
let moduleResolution = compilerOptions.moduleResolution;
|
|
37956
37959
|
if (moduleResolution === void 0) {
|
|
37957
|
-
|
|
37960
|
+
switch (getEmitModuleKind(compilerOptions)) {
|
|
37961
|
+
case 1 /* CommonJS */:
|
|
37962
|
+
moduleResolution = 2 /* Node10 */;
|
|
37963
|
+
break;
|
|
37964
|
+
case 100 /* Node16 */:
|
|
37965
|
+
moduleResolution = 3 /* Node16 */;
|
|
37966
|
+
break;
|
|
37967
|
+
case 199 /* NodeNext */:
|
|
37968
|
+
moduleResolution = 99 /* NodeNext */;
|
|
37969
|
+
break;
|
|
37970
|
+
default:
|
|
37971
|
+
moduleResolution = 1 /* Classic */;
|
|
37972
|
+
break;
|
|
37973
|
+
}
|
|
37958
37974
|
if (traceEnabled) {
|
|
37959
37975
|
trace(host, Diagnostics.Module_resolution_kind_is_not_specified_using_0, ModuleResolutionKind[moduleResolution]);
|
|
37960
37976
|
}
|
|
@@ -42127,7 +42143,7 @@ function createBinder() {
|
|
|
42127
42143
|
}
|
|
42128
42144
|
if (!isBindingPattern(node.name)) {
|
|
42129
42145
|
const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
42130
|
-
if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
|
|
42146
|
+
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
|
|
42131
42147
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
42132
42148
|
} else if (isBlockOrCatchScoped(node)) {
|
|
42133
42149
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -42656,7 +42672,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
42656
42672
|
(reason) => {
|
|
42657
42673
|
if (reason.kind !== 3 /* Import */ || reason.file !== importingSourceFile.path)
|
|
42658
42674
|
return void 0;
|
|
42659
|
-
if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== getModeForResolutionAtIndex(importingSourceFile, reason.index
|
|
42675
|
+
if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== getModeForResolutionAtIndex(importingSourceFile, reason.index))
|
|
42660
42676
|
return void 0;
|
|
42661
42677
|
const specifier = getModuleNameStringLiteralAt(importingSourceFile, reason.index).text;
|
|
42662
42678
|
return preferences.relativePreference !== 1 /* NonRelative */ || !pathIsRelative(specifier) ? specifier : void 0;
|
|
@@ -45792,7 +45808,7 @@ function createTypeChecker(host) {
|
|
|
45792
45808
|
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
45793
45809
|
}
|
|
45794
45810
|
function getUsageModeForExpression(usage) {
|
|
45795
|
-
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage
|
|
45811
|
+
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
45796
45812
|
}
|
|
45797
45813
|
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
45798
45814
|
return usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */;
|
|
@@ -45803,7 +45819,7 @@ function createTypeChecker(host) {
|
|
|
45803
45819
|
}
|
|
45804
45820
|
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
|
|
45805
45821
|
const usageMode = file && getUsageModeForExpression(usage);
|
|
45806
|
-
if (file && usageMode !== void 0
|
|
45822
|
+
if (file && usageMode !== void 0) {
|
|
45807
45823
|
const result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
|
|
45808
45824
|
if (usageMode === 99 /* ESNext */ || result) {
|
|
45809
45825
|
return result;
|
|
@@ -46697,12 +46713,8 @@ function createTypeChecker(host) {
|
|
|
46697
46713
|
return ambientModule;
|
|
46698
46714
|
}
|
|
46699
46715
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
46700
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 :
|
|
46701
|
-
|
|
46702
|
-
/*requireStringLiteralLikeArgument*/
|
|
46703
|
-
true
|
|
46704
|
-
) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, isImportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression) || ((_f = findAncestor(location, isExportDeclaration)) == null ? void 0 : _f.moduleSpecifier);
|
|
46705
|
-
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier, compilerOptions) : currentSourceFile.impliedNodeFormat;
|
|
46716
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
|
|
46717
|
+
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
46706
46718
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
46707
46719
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
46708
46720
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
@@ -69578,12 +69590,7 @@ function createTypeChecker(host) {
|
|
|
69578
69590
|
}
|
|
69579
69591
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
69580
69592
|
const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
|
|
69581
|
-
const
|
|
69582
|
-
const specifier = file == null ? void 0 : file.imports[jsxImportIndex];
|
|
69583
|
-
if (specifier) {
|
|
69584
|
-
Debug.assert(nodeIsSynthesized(specifier) && specifier.text === runtimeImportSpecifier, `Expected sourceFile.imports[${jsxImportIndex}] to be the synthesized JSX runtime import`);
|
|
69585
|
-
}
|
|
69586
|
-
const mod = resolveExternalModule(specifier || location, runtimeImportSpecifier, errorMessage, location);
|
|
69593
|
+
const mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location);
|
|
69587
69594
|
const result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : void 0;
|
|
69588
69595
|
if (links) {
|
|
69589
69596
|
links.jsxImplicitImportContainer = result || false;
|
|
@@ -72624,7 +72631,7 @@ function createTypeChecker(host) {
|
|
|
72624
72631
|
return anyType;
|
|
72625
72632
|
}
|
|
72626
72633
|
}
|
|
72627
|
-
if (isInJSFile(node) && isCommonJsRequire(node)) {
|
|
72634
|
+
if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) {
|
|
72628
72635
|
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
|
|
72629
72636
|
}
|
|
72630
72637
|
const returnType = getReturnTypeOfSignature(signature);
|
|
@@ -74276,14 +74283,13 @@ function createTypeChecker(host) {
|
|
|
74276
74283
|
}
|
|
74277
74284
|
case 7 /* ES2022 */:
|
|
74278
74285
|
case 99 /* ESNext */:
|
|
74279
|
-
case 200 /* Preserve */:
|
|
74280
74286
|
case 4 /* System */:
|
|
74281
74287
|
if (languageVersion >= 4 /* ES2017 */) {
|
|
74282
74288
|
break;
|
|
74283
74289
|
}
|
|
74284
74290
|
default:
|
|
74285
74291
|
span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
74286
|
-
const message = isAwaitExpression(node) ? Diagnostics.
|
|
74292
|
+
const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher;
|
|
74287
74293
|
diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message));
|
|
74288
74294
|
hasError = true;
|
|
74289
74295
|
break;
|
|
@@ -80791,8 +80797,8 @@ function createTypeChecker(host) {
|
|
|
80791
80797
|
return;
|
|
80792
80798
|
}
|
|
80793
80799
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
80794
|
-
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */
|
|
80795
|
-
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.
|
|
80800
|
+
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
80801
|
+
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;
|
|
80796
80802
|
return grammarErrorOnNode(node, message);
|
|
80797
80803
|
}
|
|
80798
80804
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
@@ -80861,7 +80867,7 @@ function createTypeChecker(host) {
|
|
|
80861
80867
|
grammarErrorOnNode(node, Diagnostics.An_import_alias_cannot_use_import_type);
|
|
80862
80868
|
}
|
|
80863
80869
|
} else {
|
|
80864
|
-
if (moduleKind >= 5 /* ES2015 */ &&
|
|
80870
|
+
if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 33554432 /* Ambient */)) {
|
|
80865
80871
|
grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
80866
80872
|
}
|
|
80867
80873
|
}
|
|
@@ -81096,7 +81102,7 @@ function createTypeChecker(host) {
|
|
|
81096
81102
|
grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
81097
81103
|
}
|
|
81098
81104
|
if (node.isExportEquals) {
|
|
81099
|
-
if (moduleKind >= 5 /* ES2015 */ &&
|
|
81105
|
+
if (moduleKind >= 5 /* ES2015 */ && (node.flags & 33554432 /* Ambient */ && getSourceFileOfNode(node).impliedNodeFormat === 99 /* ESNext */ || !(node.flags & 33554432 /* Ambient */) && getSourceFileOfNode(node).impliedNodeFormat !== 1 /* CommonJS */)) {
|
|
81100
81106
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
81101
81107
|
} else if (moduleKind === 4 /* System */ && !(node.flags & 33554432 /* Ambient */)) {
|
|
81102
81108
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
|
|
@@ -82088,7 +82094,7 @@ function createTypeChecker(host) {
|
|
|
82088
82094
|
return void 0;
|
|
82089
82095
|
case 11 /* StringLiteral */:
|
|
82090
82096
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
82091
|
-
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
|
|
82097
|
+
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */ && isRequireCall(
|
|
82092
82098
|
node.parent,
|
|
82093
82099
|
/*requireStringLiteralLikeArgument*/
|
|
82094
82100
|
false
|
|
@@ -84144,7 +84150,7 @@ function createTypeChecker(host) {
|
|
|
84144
84150
|
}
|
|
84145
84151
|
default:
|
|
84146
84152
|
diagnostics.add(
|
|
84147
|
-
createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.
|
|
84153
|
+
createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)
|
|
84148
84154
|
);
|
|
84149
84155
|
break;
|
|
84150
84156
|
}
|
|
@@ -107368,7 +107374,7 @@ function transformECMAScriptModule(context) {
|
|
|
107368
107374
|
setTextRange(factory2.createNodeArray(insertStatementsAfterCustomPrologue(result.statements.slice(), importRequireStatements)), result.statements)
|
|
107369
107375
|
);
|
|
107370
107376
|
}
|
|
107371
|
-
if (!isExternalModule(node) ||
|
|
107377
|
+
if (!isExternalModule(node) || some(result.statements, isExternalModuleIndicator)) {
|
|
107372
107378
|
return result;
|
|
107373
107379
|
}
|
|
107374
107380
|
return factory2.updateSourceFile(
|
|
@@ -107411,14 +107417,6 @@ function transformECMAScriptModule(context) {
|
|
|
107411
107417
|
if (moduleName) {
|
|
107412
107418
|
args.push(moduleName);
|
|
107413
107419
|
}
|
|
107414
|
-
if (getEmitModuleKind(compilerOptions) === 200 /* Preserve */) {
|
|
107415
|
-
return factory2.createCallExpression(
|
|
107416
|
-
factory2.createIdentifier("require"),
|
|
107417
|
-
/*typeArguments*/
|
|
107418
|
-
void 0,
|
|
107419
|
-
args
|
|
107420
|
-
);
|
|
107421
|
-
}
|
|
107422
107420
|
if (!importRequireStatements) {
|
|
107423
107421
|
const createRequireName = factory2.createUniqueName("_createRequire", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
107424
107422
|
const importStatement = factory2.createImportDeclaration(
|
|
@@ -107533,25 +107531,7 @@ function transformECMAScriptModule(context) {
|
|
|
107533
107531
|
return statements;
|
|
107534
107532
|
}
|
|
107535
107533
|
function visitExportAssignment(node) {
|
|
107536
|
-
|
|
107537
|
-
if (getEmitModuleKind(compilerOptions) === 200 /* Preserve */) {
|
|
107538
|
-
const statement = setOriginalNode(
|
|
107539
|
-
factory2.createExpressionStatement(
|
|
107540
|
-
factory2.createAssignment(
|
|
107541
|
-
factory2.createPropertyAccessExpression(
|
|
107542
|
-
factory2.createIdentifier("module"),
|
|
107543
|
-
"exports"
|
|
107544
|
-
),
|
|
107545
|
-
node.expression
|
|
107546
|
-
)
|
|
107547
|
-
),
|
|
107548
|
-
node
|
|
107549
|
-
);
|
|
107550
|
-
return statement;
|
|
107551
|
-
}
|
|
107552
|
-
return void 0;
|
|
107553
|
-
}
|
|
107554
|
-
return node;
|
|
107534
|
+
return node.isExportEquals ? void 0 : node;
|
|
107555
107535
|
}
|
|
107556
107536
|
function visitExportDeclaration(node) {
|
|
107557
107537
|
if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */) {
|
|
@@ -109921,7 +109901,6 @@ function getModuleTransformer(moduleKind) {
|
|
|
109921
109901
|
case 7 /* ES2022 */:
|
|
109922
109902
|
case 6 /* ES2020 */:
|
|
109923
109903
|
case 5 /* ES2015 */:
|
|
109924
|
-
case 200 /* Preserve */:
|
|
109925
109904
|
return transformECMAScriptModule;
|
|
109926
109905
|
case 4 /* System */:
|
|
109927
109906
|
return transformSystemModule;
|
|
@@ -116682,8 +116661,8 @@ function flattenDiagnosticMessageText(diag2, newLine, indent2 = 0) {
|
|
|
116682
116661
|
function getModeForFileReference(ref, containingFileMode) {
|
|
116683
116662
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
116684
116663
|
}
|
|
116685
|
-
function getModeForResolutionAtIndex(file, index
|
|
116686
|
-
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index)
|
|
116664
|
+
function getModeForResolutionAtIndex(file, index) {
|
|
116665
|
+
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
116687
116666
|
}
|
|
116688
116667
|
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
116689
116668
|
var _a;
|
|
@@ -116695,7 +116674,7 @@ function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
|
116695
116674
|
}
|
|
116696
116675
|
return false;
|
|
116697
116676
|
}
|
|
116698
|
-
function getModeForUsageLocation(file, usage
|
|
116677
|
+
function getModeForUsageLocation(file, usage) {
|
|
116699
116678
|
var _a;
|
|
116700
116679
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
116701
116680
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
@@ -116712,13 +116691,6 @@ function getModeForUsageLocation(file, usage, compilerOptions) {
|
|
|
116712
116691
|
return override;
|
|
116713
116692
|
}
|
|
116714
116693
|
}
|
|
116715
|
-
if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
|
|
116716
|
-
return usage.parent.parent && isImportEqualsDeclaration(usage.parent.parent) || isRequireCall(
|
|
116717
|
-
usage.parent,
|
|
116718
|
-
/*requireStringLiteralLikeArgument*/
|
|
116719
|
-
false
|
|
116720
|
-
) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
116721
|
-
}
|
|
116722
116694
|
if (file.impliedNodeFormat === void 0)
|
|
116723
116695
|
return void 0;
|
|
116724
116696
|
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
@@ -116764,7 +116736,7 @@ function getModuleResolutionName(literal) {
|
|
|
116764
116736
|
}
|
|
116765
116737
|
var moduleResolutionNameAndModeGetter = {
|
|
116766
116738
|
getName: getModuleResolutionName,
|
|
116767
|
-
getMode: (entry, file
|
|
116739
|
+
getMode: (entry, file) => getModeForUsageLocation(file, entry)
|
|
116768
116740
|
};
|
|
116769
116741
|
function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) {
|
|
116770
116742
|
return {
|
|
@@ -116809,7 +116781,7 @@ function loadWithModeAwareCache(entries, containingFile, redirectedReference, op
|
|
|
116809
116781
|
const loader = createLoader(containingFile, redirectedReference, options, host, resolutionCache);
|
|
116810
116782
|
for (const entry of entries) {
|
|
116811
116783
|
const name = loader.nameAndMode.getName(entry);
|
|
116812
|
-
const mode = loader.nameAndMode.getMode(entry, containingSourceFile
|
|
116784
|
+
const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
|
|
116813
116785
|
const key = createModeAwareCacheKey(name, mode);
|
|
116814
116786
|
let result = cache.get(key);
|
|
116815
116787
|
if (!result) {
|
|
@@ -116895,7 +116867,7 @@ function getReferencedFileLocation(program, ref) {
|
|
|
116895
116867
|
switch (kind) {
|
|
116896
116868
|
case 3 /* Import */:
|
|
116897
116869
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
116898
|
-
packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index
|
|
116870
|
+
packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
|
|
116899
116871
|
if (importLiteral.pos === -1)
|
|
116900
116872
|
return { file, packageId, text: importLiteral.text };
|
|
116901
116873
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -117655,7 +117627,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117655
117627
|
for (let i = 0; i < moduleNames.length; i++) {
|
|
117656
117628
|
const moduleName = moduleNames[i];
|
|
117657
117629
|
if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
|
|
117658
|
-
const mode = getModeForUsageLocation(file, moduleName
|
|
117630
|
+
const mode = getModeForUsageLocation(file, moduleName);
|
|
117659
117631
|
const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
|
|
117660
117632
|
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
117661
117633
|
if (isTraceEnabled(options, host)) {
|
|
@@ -117704,7 +117676,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117704
117676
|
return result;
|
|
117705
117677
|
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
117706
117678
|
var _a2;
|
|
117707
|
-
const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName
|
|
117679
|
+
const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
|
|
117708
117680
|
const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
117709
117681
|
if (resolutionToFile && resolvedFile) {
|
|
117710
117682
|
return false;
|
|
@@ -117926,8 +117898,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117926
117898
|
resolutions,
|
|
117927
117899
|
(name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
|
|
117928
117900
|
moduleResolutionIsEqualTo,
|
|
117929
|
-
moduleResolutionNameAndModeGetter
|
|
117930
|
-
oldProgram.getCompilerOptions()
|
|
117901
|
+
moduleResolutionNameAndModeGetter
|
|
117931
117902
|
);
|
|
117932
117903
|
if (resolutionsChanged)
|
|
117933
117904
|
structureIsReused = 1 /* SafeModules */;
|
|
@@ -117940,8 +117911,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117940
117911
|
typeReferenceResolutions,
|
|
117941
117912
|
(name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
|
|
117942
117913
|
typeDirectiveIsEqualTo,
|
|
117943
|
-
typeReferenceResolutionNameAndModeGetter
|
|
117944
|
-
oldProgram.getCompilerOptions()
|
|
117914
|
+
typeReferenceResolutionNameAndModeGetter
|
|
117945
117915
|
);
|
|
117946
117916
|
if (typeReferenceResolutionsChanged)
|
|
117947
117917
|
structureIsReused = 1 /* SafeModules */;
|
|
@@ -118608,7 +118578,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118608
118578
|
false
|
|
118609
118579
|
);
|
|
118610
118580
|
}
|
|
118611
|
-
|
|
118581
|
+
const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options);
|
|
118582
|
+
if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) {
|
|
118612
118583
|
collectDynamicImportOrRequireCalls(file);
|
|
118613
118584
|
}
|
|
118614
118585
|
file.imports = imports || emptyArray;
|
|
@@ -118657,7 +118628,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118657
118628
|
const r = /import|require/g;
|
|
118658
118629
|
while (r.exec(file2.text) !== null) {
|
|
118659
118630
|
const node = getNodeAtPosition(file2, r.lastIndex);
|
|
118660
|
-
if (
|
|
118631
|
+
if (shouldProcessRequires && isRequireCall(
|
|
118661
118632
|
node,
|
|
118662
118633
|
/*requireStringLiteralLikeArgument*/
|
|
118663
118634
|
true
|
|
@@ -119218,7 +119189,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119218
119189
|
for (let index = 0; index < moduleNames.length; index++) {
|
|
119219
119190
|
const resolution = resolutions[index].resolvedModule;
|
|
119220
119191
|
const moduleName = moduleNames[index].text;
|
|
119221
|
-
const mode = getModeForUsageLocation(file, moduleNames[index]
|
|
119192
|
+
const mode = getModeForUsageLocation(file, moduleNames[index]);
|
|
119222
119193
|
resolutionsInFile.set(moduleName, mode, resolutions[index]);
|
|
119223
119194
|
addResolutionDiagnosticsFromResolutionOrCache(file, moduleName, resolutions[index], mode);
|
|
119224
119195
|
if (!resolution) {
|
|
@@ -119498,7 +119469,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119498
119469
|
if (getEmitModuleResolutionKind(options) === 1 /* Classic */) {
|
|
119499
119470
|
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule");
|
|
119500
119471
|
} else if (!hasJsonModuleEmitEnabled(options)) {
|
|
119501
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
119472
|
+
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module");
|
|
119502
119473
|
}
|
|
119503
119474
|
}
|
|
119504
119475
|
if (options.outDir || // there is --outDir specified
|
|
@@ -119562,7 +119533,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119562
119533
|
}
|
|
119563
119534
|
}
|
|
119564
119535
|
if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) {
|
|
119565
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
119536
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports");
|
|
119566
119537
|
}
|
|
119567
119538
|
const moduleKind = getEmitModuleKind(options);
|
|
119568
119539
|
if (options.verbatimModuleSyntax) {
|
|
@@ -119589,8 +119560,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119589
119560
|
if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
119590
119561
|
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions");
|
|
119591
119562
|
}
|
|
119592
|
-
if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)
|
|
119593
|
-
createOptionValueDiagnostic("moduleResolution", Diagnostics.
|
|
119563
|
+
if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) {
|
|
119564
|
+
createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler");
|
|
119594
119565
|
}
|
|
119595
119566
|
if (ModuleKind[moduleKind] && (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) && !(3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
|
|
119596
119567
|
const moduleKindName = ModuleKind[moduleKind];
|
|
@@ -122527,7 +122498,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122527
122498
|
const seenNamesInFile = createModeAwareCache();
|
|
122528
122499
|
for (const entry of entries) {
|
|
122529
122500
|
const name = loader.nameAndMode.getName(entry);
|
|
122530
|
-
const mode = loader.nameAndMode.getMode(entry, containingSourceFile
|
|
122501
|
+
const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
|
|
122531
122502
|
let resolution = resolutionsInFile.get(name, mode);
|
|
122532
122503
|
if (!seenNamesInFile.has(name, mode) && (allModuleAndTypeResolutionsAreInvalidated || unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate
|
|
122533
122504
|
hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) {
|
|
@@ -122568,7 +122539,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122568
122539
|
reusedNames == null ? void 0 : reusedNames.forEach(
|
|
122569
122540
|
(entry) => seenNamesInFile.set(
|
|
122570
122541
|
loader.nameAndMode.getName(entry),
|
|
122571
|
-
loader.nameAndMode.getMode(entry, containingSourceFile
|
|
122542
|
+
loader.nameAndMode.getMode(entry, containingSourceFile),
|
|
122572
122543
|
true
|
|
122573
122544
|
)
|
|
122574
122545
|
);
|