typescript 4.7.0-dev.20220503 → 4.7.0-dev.20220506
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.es2022.d.ts +1 -0
- package/lib/lib.es2022.intl.d.ts +111 -0
- package/lib/lib.es5.d.ts +2 -2
- package/lib/tsc.js +306 -133
- package/lib/tsserver.js +426 -206
- package/lib/tsserverlibrary.d.ts +7 -7
- package/lib/tsserverlibrary.js +426 -206
- package/lib/typescript.d.ts +7 -7
- package/lib/typescript.js +411 -194
- package/lib/typescriptServices.d.ts +7 -7
- package/lib/typescriptServices.js +411 -194
- package/lib/typingsInstaller.js +365 -158
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220506";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -3405,7 +3405,7 @@ var ts;
|
|
|
3405
3405
|
(function (ModuleResolutionKind) {
|
|
3406
3406
|
ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
|
|
3407
3407
|
ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
|
|
3408
|
-
ModuleResolutionKind[ModuleResolutionKind["
|
|
3408
|
+
ModuleResolutionKind[ModuleResolutionKind["Node16"] = 3] = "Node16";
|
|
3409
3409
|
ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
|
|
3410
3410
|
})(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
|
|
3411
3411
|
var ModuleDetectionKind;
|
|
@@ -3448,7 +3448,7 @@ var ts;
|
|
|
3448
3448
|
ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
|
|
3449
3449
|
ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
|
|
3450
3450
|
ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
|
|
3451
|
-
ModuleKind[ModuleKind["
|
|
3451
|
+
ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
|
|
3452
3452
|
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
3453
3453
|
})(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
|
|
3454
3454
|
ts.commentPragmas = {
|
|
@@ -5442,6 +5442,7 @@ var ts;
|
|
|
5442
5442
|
_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, ts.DiagnosticCategory.Error, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
|
|
5443
5443
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
5444
5444
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
5445
|
+
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, ts.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
5445
5446
|
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
|
|
5446
5447
|
The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, ts.DiagnosticCategory.Error, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."),
|
|
5447
5448
|
Global_module_exports_may_only_appear_in_module_files: diag(1314, ts.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."),
|
|
@@ -5453,8 +5454,8 @@ var ts;
|
|
|
5453
5454
|
Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
5454
5455
|
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts.DiagnosticCategory.Error, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
|
|
5455
5456
|
Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, ts.DiagnosticCategory.Error, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
5456
|
-
|
|
5457
|
-
|
|
5457
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),
|
|
5458
|
+
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),
|
|
5458
5459
|
Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
|
|
5459
5460
|
This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
|
|
5460
5461
|
String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
|
|
@@ -5471,7 +5472,7 @@ var ts;
|
|
|
5471
5472
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
|
|
5472
5473
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
|
|
5473
5474
|
Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
5474
|
-
|
|
5475
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
|
|
5475
5476
|
A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
5476
5477
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
5477
5478
|
This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
|
|
@@ -5502,7 +5503,7 @@ var ts;
|
|
|
5502
5503
|
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, ts.DiagnosticCategory.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."),
|
|
5503
5504
|
_0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
5504
5505
|
_0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
5505
|
-
|
|
5506
|
+
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, ts.DiagnosticCategory.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."),
|
|
5506
5507
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.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'."),
|
|
5507
5508
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts.DiagnosticCategory.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'."),
|
|
5508
5509
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -5554,7 +5555,7 @@ var ts;
|
|
|
5554
5555
|
File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
5555
5556
|
The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
5556
5557
|
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, ts.DiagnosticCategory.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."),
|
|
5557
|
-
|
|
5558
|
+
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, ts.DiagnosticCategory.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."),
|
|
5558
5559
|
Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."),
|
|
5559
5560
|
Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
5560
5561
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts.DiagnosticCategory.Error, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -5572,7 +5573,7 @@ var ts;
|
|
|
5572
5573
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.Message, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
5573
5574
|
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
5574
5575
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
5575
|
-
|
|
5576
|
+
Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
5576
5577
|
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
5577
5578
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
5578
5579
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -5583,7 +5584,7 @@ var ts;
|
|
|
5583
5584
|
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
5584
5585
|
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
5585
5586
|
Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
|
|
5586
|
-
|
|
5587
|
+
auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules."),
|
|
5587
5588
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
5588
5589
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
5589
5590
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
|
|
@@ -5592,6 +5593,8 @@ var ts;
|
|
|
5592
5593
|
Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
|
|
5593
5594
|
The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
|
|
5594
5595
|
The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
|
|
5596
|
+
The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
|
|
5597
|
+
The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
|
|
5595
5598
|
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
|
|
5596
5599
|
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
5597
5600
|
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
|
|
@@ -6069,8 +6072,8 @@ var ts;
|
|
|
6069
6072
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, ts.DiagnosticCategory.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'."),
|
|
6070
6073
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
6071
6074
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
6072
|
-
|
|
6073
|
-
|
|
6075
|
+
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, ts.DiagnosticCategory.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."),
|
|
6076
|
+
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.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}'?"),
|
|
6074
6077
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
6075
6078
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
6076
6079
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
@@ -6736,7 +6739,6 @@ var ts;
|
|
|
6736
6739
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
|
|
6737
6740
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
|
|
6738
6741
|
A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
|
|
6739
|
-
JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
|
|
6740
6742
|
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
|
|
6741
6743
|
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
|
|
6742
6744
|
import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
|
|
@@ -11334,7 +11336,7 @@ var ts;
|
|
|
11334
11336
|
}
|
|
11335
11337
|
ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;
|
|
11336
11338
|
function isCommonJSContainingModuleKind(kind) {
|
|
11337
|
-
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.
|
|
11339
|
+
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node16 || kind === ts.ModuleKind.NodeNext;
|
|
11338
11340
|
}
|
|
11339
11341
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
11340
11342
|
return ts.isExternalModule(node) || compilerOptions.isolatedModules || (isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator);
|
|
@@ -14276,6 +14278,13 @@ var ts;
|
|
|
14276
14278
|
".d.ts";
|
|
14277
14279
|
}
|
|
14278
14280
|
ts.getDeclarationEmitExtensionForPath = getDeclarationEmitExtensionForPath;
|
|
14281
|
+
function getPossibleOriginalInputExtensionForExtension(path) {
|
|
14282
|
+
return ts.fileExtensionIsOneOf(path, [".d.mts", ".mjs", ".mts"]) ? [".mts", ".mjs"] :
|
|
14283
|
+
ts.fileExtensionIsOneOf(path, [".d.cts", ".cjs", ".cts"]) ? [".cts", ".cjs"] :
|
|
14284
|
+
ts.fileExtensionIsOneOf(path, [".json.d.ts"]) ? [".json"] :
|
|
14285
|
+
[".tsx", ".ts", ".jsx", ".js"];
|
|
14286
|
+
}
|
|
14287
|
+
ts.getPossibleOriginalInputExtensionForExtension = getPossibleOriginalInputExtensionForExtension;
|
|
14279
14288
|
function outFile(options) {
|
|
14280
14289
|
return options.outFile || options.out;
|
|
14281
14290
|
}
|
|
@@ -15847,7 +15856,7 @@ var ts;
|
|
|
15847
15856
|
checks.push(isFileModuleFromUsingJSXTag);
|
|
15848
15857
|
}
|
|
15849
15858
|
var moduleKind = getEmitModuleKind(options);
|
|
15850
|
-
if (moduleKind === ts.ModuleKind.
|
|
15859
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
15851
15860
|
checks.push(isFileForcedToBeModuleByFormat);
|
|
15852
15861
|
}
|
|
15853
15862
|
var combined_1 = ts.or.apply(void 0, checks);
|
|
@@ -15858,7 +15867,7 @@ var ts;
|
|
|
15858
15867
|
ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
|
|
15859
15868
|
function getEmitScriptTarget(compilerOptions) {
|
|
15860
15869
|
return compilerOptions.target ||
|
|
15861
|
-
(compilerOptions.module === ts.ModuleKind.
|
|
15870
|
+
(compilerOptions.module === ts.ModuleKind.Node16 && 9) ||
|
|
15862
15871
|
(compilerOptions.module === ts.ModuleKind.NodeNext && 99) ||
|
|
15863
15872
|
0;
|
|
15864
15873
|
}
|
|
@@ -15876,8 +15885,8 @@ var ts;
|
|
|
15876
15885
|
case ts.ModuleKind.CommonJS:
|
|
15877
15886
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
15878
15887
|
break;
|
|
15879
|
-
case ts.ModuleKind.
|
|
15880
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
15888
|
+
case ts.ModuleKind.Node16:
|
|
15889
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
15881
15890
|
break;
|
|
15882
15891
|
case ts.ModuleKind.NodeNext:
|
|
15883
15892
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -15902,7 +15911,7 @@ var ts;
|
|
|
15902
15911
|
case ts.ModuleKind.ES2020:
|
|
15903
15912
|
case ts.ModuleKind.ES2022:
|
|
15904
15913
|
case ts.ModuleKind.ESNext:
|
|
15905
|
-
case ts.ModuleKind.
|
|
15914
|
+
case ts.ModuleKind.Node16:
|
|
15906
15915
|
case ts.ModuleKind.NodeNext:
|
|
15907
15916
|
return true;
|
|
15908
15917
|
default:
|
|
@@ -15927,7 +15936,7 @@ var ts;
|
|
|
15927
15936
|
return compilerOptions.esModuleInterop;
|
|
15928
15937
|
}
|
|
15929
15938
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
15930
|
-
case ts.ModuleKind.
|
|
15939
|
+
case ts.ModuleKind.Node16:
|
|
15931
15940
|
case ts.ModuleKind.NodeNext:
|
|
15932
15941
|
return true;
|
|
15933
15942
|
}
|
|
@@ -21062,7 +21071,7 @@ var ts;
|
|
|
21062
21071
|
return node;
|
|
21063
21072
|
}
|
|
21064
21073
|
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
|
|
21065
|
-
var node = baseFactory.createBaseSourceFileNode(305);
|
|
21074
|
+
var node = (source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory.createBaseSourceFileNode(305));
|
|
21066
21075
|
for (var p in source) {
|
|
21067
21076
|
if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p))
|
|
21068
21077
|
continue;
|
|
@@ -25174,7 +25183,7 @@ var ts;
|
|
|
25174
25183
|
function parseIsolatedEntityName(content, languageVersion) {
|
|
25175
25184
|
initializeState("", content, languageVersion, undefined, 1);
|
|
25176
25185
|
nextToken();
|
|
25177
|
-
var entityName = parseEntityName(true
|
|
25186
|
+
var entityName = parseEntityName(true);
|
|
25178
25187
|
var isInvalid = token() === 1 && !parseDiagnostics.length;
|
|
25179
25188
|
clearState();
|
|
25180
25189
|
return isInvalid ? entityName : undefined;
|
|
@@ -26504,7 +26513,7 @@ var ts;
|
|
|
26504
26513
|
}
|
|
26505
26514
|
return createMissingList();
|
|
26506
26515
|
}
|
|
26507
|
-
function parseEntityName(allowReservedWords,
|
|
26516
|
+
function parseEntityName(allowReservedWords, diagnosticMessage) {
|
|
26508
26517
|
var pos = getNodePos();
|
|
26509
26518
|
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
|
|
26510
26519
|
var dotPos = getNodePos();
|
|
@@ -26514,7 +26523,7 @@ var ts;
|
|
|
26514
26523
|
break;
|
|
26515
26524
|
}
|
|
26516
26525
|
dotPos = getNodePos();
|
|
26517
|
-
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords,
|
|
26526
|
+
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, false)), pos);
|
|
26518
26527
|
}
|
|
26519
26528
|
return entity;
|
|
26520
26529
|
}
|
|
@@ -26617,7 +26626,7 @@ var ts;
|
|
|
26617
26626
|
return finishNode(node, pos);
|
|
26618
26627
|
}
|
|
26619
26628
|
function parseEntityNameOfTypeReference() {
|
|
26620
|
-
return parseEntityName(true,
|
|
26629
|
+
return parseEntityName(true, ts.Diagnostics.Type_expected);
|
|
26621
26630
|
}
|
|
26622
26631
|
function parseTypeArgumentsOfTypeReference() {
|
|
26623
26632
|
if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29) {
|
|
@@ -26731,7 +26740,7 @@ var ts;
|
|
|
26731
26740
|
function parseTypeQuery() {
|
|
26732
26741
|
var pos = getNodePos();
|
|
26733
26742
|
parseExpected(112);
|
|
26734
|
-
var entityName = parseEntityName(true
|
|
26743
|
+
var entityName = parseEntityName(true);
|
|
26735
26744
|
var typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined;
|
|
26736
26745
|
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
26737
26746
|
}
|
|
@@ -27566,10 +27575,10 @@ var ts;
|
|
|
27566
27575
|
setDecoratorContext(false);
|
|
27567
27576
|
}
|
|
27568
27577
|
var pos = getNodePos();
|
|
27569
|
-
var expr = parseAssignmentExpressionOrHigher(
|
|
27578
|
+
var expr = parseAssignmentExpressionOrHigher();
|
|
27570
27579
|
var operatorToken;
|
|
27571
27580
|
while ((operatorToken = parseOptionalToken(27))) {
|
|
27572
|
-
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(
|
|
27581
|
+
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);
|
|
27573
27582
|
}
|
|
27574
27583
|
if (saveDecoratorContext) {
|
|
27575
27584
|
setDecoratorContext(true);
|
|
@@ -27577,23 +27586,23 @@ var ts;
|
|
|
27577
27586
|
return expr;
|
|
27578
27587
|
}
|
|
27579
27588
|
function parseInitializer() {
|
|
27580
|
-
return parseOptional(63) ? parseAssignmentExpressionOrHigher(
|
|
27589
|
+
return parseOptional(63) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
27581
27590
|
}
|
|
27582
|
-
function parseAssignmentExpressionOrHigher(
|
|
27591
|
+
function parseAssignmentExpressionOrHigher() {
|
|
27583
27592
|
if (isYieldExpression()) {
|
|
27584
27593
|
return parseYieldExpression();
|
|
27585
27594
|
}
|
|
27586
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(
|
|
27595
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
27587
27596
|
if (arrowExpression) {
|
|
27588
27597
|
return arrowExpression;
|
|
27589
27598
|
}
|
|
27590
27599
|
var pos = getNodePos();
|
|
27591
27600
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
27592
27601
|
if (expr.kind === 79 && token() === 38) {
|
|
27593
|
-
return parseSimpleArrowFunctionExpression(pos, expr,
|
|
27602
|
+
return parseSimpleArrowFunctionExpression(pos, expr, undefined);
|
|
27594
27603
|
}
|
|
27595
27604
|
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
|
|
27596
|
-
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(
|
|
27605
|
+
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
|
|
27597
27606
|
}
|
|
27598
27607
|
return parseConditionalExpressionRest(expr, pos);
|
|
27599
27608
|
}
|
|
@@ -27615,30 +27624,30 @@ var ts;
|
|
|
27615
27624
|
nextToken();
|
|
27616
27625
|
if (!scanner.hasPrecedingLineBreak() &&
|
|
27617
27626
|
(token() === 41 || isStartOfExpression())) {
|
|
27618
|
-
return finishNode(factory.createYieldExpression(parseOptionalToken(41), parseAssignmentExpressionOrHigher(
|
|
27627
|
+
return finishNode(factory.createYieldExpression(parseOptionalToken(41), parseAssignmentExpressionOrHigher()), pos);
|
|
27619
27628
|
}
|
|
27620
27629
|
else {
|
|
27621
27630
|
return finishNode(factory.createYieldExpression(undefined, undefined), pos);
|
|
27622
27631
|
}
|
|
27623
27632
|
}
|
|
27624
|
-
function parseSimpleArrowFunctionExpression(pos, identifier,
|
|
27633
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
27625
27634
|
ts.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
27626
27635
|
var parameter = factory.createParameterDeclaration(undefined, undefined, undefined, identifier, undefined, undefined, undefined);
|
|
27627
27636
|
finishNode(parameter, identifier.pos);
|
|
27628
27637
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
27629
27638
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
27630
|
-
var body = parseArrowFunctionExpressionBody(!!asyncModifier
|
|
27639
|
+
var body = parseArrowFunctionExpressionBody(!!asyncModifier);
|
|
27631
27640
|
var node = factory.createArrowFunction(asyncModifier, undefined, parameters, undefined, equalsGreaterThanToken, body);
|
|
27632
27641
|
return addJSDocComment(finishNode(node, pos));
|
|
27633
27642
|
}
|
|
27634
|
-
function tryParseParenthesizedArrowFunctionExpression(
|
|
27643
|
+
function tryParseParenthesizedArrowFunctionExpression() {
|
|
27635
27644
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
27636
27645
|
if (triState === 0) {
|
|
27637
27646
|
return undefined;
|
|
27638
27647
|
}
|
|
27639
27648
|
return triState === 1 ?
|
|
27640
|
-
parseParenthesizedArrowFunctionExpression(true
|
|
27641
|
-
tryParse(
|
|
27649
|
+
parseParenthesizedArrowFunctionExpression(true) :
|
|
27650
|
+
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
27642
27651
|
}
|
|
27643
27652
|
function isParenthesizedArrowFunctionExpression() {
|
|
27644
27653
|
if (token() === 20 || token() === 29 || token() === 131) {
|
|
@@ -27732,24 +27741,24 @@ var ts;
|
|
|
27732
27741
|
return 2;
|
|
27733
27742
|
}
|
|
27734
27743
|
}
|
|
27735
|
-
function parsePossibleParenthesizedArrowFunctionExpression(
|
|
27744
|
+
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
27736
27745
|
var tokenPos = scanner.getTokenPos();
|
|
27737
27746
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
27738
27747
|
return undefined;
|
|
27739
27748
|
}
|
|
27740
|
-
var result = parseParenthesizedArrowFunctionExpression(false
|
|
27749
|
+
var result = parseParenthesizedArrowFunctionExpression(false);
|
|
27741
27750
|
if (!result) {
|
|
27742
27751
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
27743
27752
|
}
|
|
27744
27753
|
return result;
|
|
27745
27754
|
}
|
|
27746
|
-
function tryParseAsyncSimpleArrowFunctionExpression(
|
|
27755
|
+
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
27747
27756
|
if (token() === 131) {
|
|
27748
27757
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) {
|
|
27749
27758
|
var pos = getNodePos();
|
|
27750
27759
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
27751
27760
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
27752
|
-
return parseSimpleArrowFunctionExpression(pos, expr,
|
|
27761
|
+
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
27753
27762
|
}
|
|
27754
27763
|
}
|
|
27755
27764
|
return undefined;
|
|
@@ -27767,7 +27776,7 @@ var ts;
|
|
|
27767
27776
|
}
|
|
27768
27777
|
return 0;
|
|
27769
27778
|
}
|
|
27770
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity
|
|
27779
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
27771
27780
|
var pos = getNodePos();
|
|
27772
27781
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
27773
27782
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -27795,9 +27804,6 @@ var ts;
|
|
|
27795
27804
|
return undefined;
|
|
27796
27805
|
}
|
|
27797
27806
|
}
|
|
27798
|
-
if (disallowReturnTypeInArrowFunction && token() === 58) {
|
|
27799
|
-
return undefined;
|
|
27800
|
-
}
|
|
27801
27807
|
var type = parseReturnType(58, false);
|
|
27802
27808
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
27803
27809
|
return undefined;
|
|
@@ -27813,12 +27819,12 @@ var ts;
|
|
|
27813
27819
|
var lastToken = token();
|
|
27814
27820
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
27815
27821
|
var body = (lastToken === 38 || lastToken === 18)
|
|
27816
|
-
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier)
|
|
27822
|
+
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))
|
|
27817
27823
|
: parseIdentifier();
|
|
27818
27824
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
27819
27825
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
27820
27826
|
}
|
|
27821
|
-
function parseArrowFunctionExpressionBody(isAsync
|
|
27827
|
+
function parseArrowFunctionExpressionBody(isAsync) {
|
|
27822
27828
|
if (token() === 18) {
|
|
27823
27829
|
return parseFunctionBlock(isAsync ? 2 : 0);
|
|
27824
27830
|
}
|
|
@@ -27832,8 +27838,8 @@ var ts;
|
|
|
27832
27838
|
var savedTopLevel = topLevel;
|
|
27833
27839
|
topLevel = false;
|
|
27834
27840
|
var node = isAsync
|
|
27835
|
-
? doInAwaitContext(
|
|
27836
|
-
: doOutsideOfAwaitContext(
|
|
27841
|
+
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
27842
|
+
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
27837
27843
|
topLevel = savedTopLevel;
|
|
27838
27844
|
return node;
|
|
27839
27845
|
}
|
|
@@ -27843,8 +27849,8 @@ var ts;
|
|
|
27843
27849
|
return leftOperand;
|
|
27844
27850
|
}
|
|
27845
27851
|
var colonToken;
|
|
27846
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext,
|
|
27847
|
-
? parseAssignmentExpressionOrHigher(
|
|
27852
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
|
|
27853
|
+
? parseAssignmentExpressionOrHigher()
|
|
27848
27854
|
: createMissingNode(79, false, ts.Diagnostics._0_expected, ts.tokenToString(58))), pos);
|
|
27849
27855
|
}
|
|
27850
27856
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -28495,13 +28501,13 @@ var ts;
|
|
|
28495
28501
|
function parseSpreadElement() {
|
|
28496
28502
|
var pos = getNodePos();
|
|
28497
28503
|
parseExpected(25);
|
|
28498
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
28504
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
28499
28505
|
return finishNode(factory.createSpreadElement(expression), pos);
|
|
28500
28506
|
}
|
|
28501
28507
|
function parseArgumentOrArrayLiteralElement() {
|
|
28502
28508
|
return token() === 25 ? parseSpreadElement() :
|
|
28503
28509
|
token() === 27 ? finishNode(factory.createOmittedExpression(), getNodePos()) :
|
|
28504
|
-
parseAssignmentExpressionOrHigher(
|
|
28510
|
+
parseAssignmentExpressionOrHigher();
|
|
28505
28511
|
}
|
|
28506
28512
|
function parseArgumentExpression() {
|
|
28507
28513
|
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
|
|
@@ -28519,7 +28525,7 @@ var ts;
|
|
|
28519
28525
|
var pos = getNodePos();
|
|
28520
28526
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
28521
28527
|
if (parseOptionalToken(25)) {
|
|
28522
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
28528
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
28523
28529
|
return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);
|
|
28524
28530
|
}
|
|
28525
28531
|
var decorators = parseDecorators();
|
|
@@ -28542,13 +28548,13 @@ var ts;
|
|
|
28542
28548
|
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58);
|
|
28543
28549
|
if (isShorthandPropertyAssignment) {
|
|
28544
28550
|
var equalsToken = parseOptionalToken(63);
|
|
28545
|
-
var objectAssignmentInitializer = equalsToken ? allowInAnd(
|
|
28551
|
+
var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
|
|
28546
28552
|
node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);
|
|
28547
28553
|
node.equalsToken = equalsToken;
|
|
28548
28554
|
}
|
|
28549
28555
|
else {
|
|
28550
28556
|
parseExpected(58);
|
|
28551
|
-
var initializer = allowInAnd(
|
|
28557
|
+
var initializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
28552
28558
|
node = factory.createPropertyAssignment(name, initializer);
|
|
28553
28559
|
}
|
|
28554
28560
|
node.decorators = decorators;
|
|
@@ -28708,7 +28714,7 @@ var ts;
|
|
|
28708
28714
|
}
|
|
28709
28715
|
var node;
|
|
28710
28716
|
if (awaitToken ? parseExpected(160) : parseOptional(160)) {
|
|
28711
|
-
var expression = allowInAnd(
|
|
28717
|
+
var expression = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
28712
28718
|
parseExpected(21);
|
|
28713
28719
|
node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
28714
28720
|
}
|
|
@@ -29746,7 +29752,7 @@ var ts;
|
|
|
29746
29752
|
var pos = getNodePos();
|
|
29747
29753
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10);
|
|
29748
29754
|
parseExpected(58);
|
|
29749
|
-
var value = parseAssignmentExpressionOrHigher(
|
|
29755
|
+
var value = parseAssignmentExpressionOrHigher();
|
|
29750
29756
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
29751
29757
|
}
|
|
29752
29758
|
function parseAssertClause(skipAssertKeyword) {
|
|
@@ -29796,7 +29802,7 @@ var ts;
|
|
|
29796
29802
|
function parseModuleReference() {
|
|
29797
29803
|
return isExternalModuleReference()
|
|
29798
29804
|
? parseExternalModuleReference()
|
|
29799
|
-
: parseEntityName(false
|
|
29805
|
+
: parseEntityName(false);
|
|
29800
29806
|
}
|
|
29801
29807
|
function parseExternalModuleReference() {
|
|
29802
29808
|
var pos = getNodePos();
|
|
@@ -29940,7 +29946,7 @@ var ts;
|
|
|
29940
29946
|
else {
|
|
29941
29947
|
parseExpected(88);
|
|
29942
29948
|
}
|
|
29943
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
29949
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
29944
29950
|
parseSemicolon();
|
|
29945
29951
|
setAwaitContext(savedAwaitContext);
|
|
29946
29952
|
var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
|
|
@@ -29978,7 +29984,7 @@ var ts;
|
|
|
29978
29984
|
var pos = getNodePos();
|
|
29979
29985
|
var hasBrace = parseOptional(18);
|
|
29980
29986
|
var p2 = getNodePos();
|
|
29981
|
-
var entityName = parseEntityName(false
|
|
29987
|
+
var entityName = parseEntityName(false);
|
|
29982
29988
|
while (token() === 80) {
|
|
29983
29989
|
reScanHashToken();
|
|
29984
29990
|
nextTokenJSDoc();
|
|
@@ -30380,7 +30386,7 @@ var ts;
|
|
|
30380
30386
|
skipWhitespace();
|
|
30381
30387
|
var p2 = getNodePos();
|
|
30382
30388
|
var name = ts.tokenIsIdentifierOrKeyword(token())
|
|
30383
|
-
? parseEntityName(true
|
|
30389
|
+
? parseEntityName(true)
|
|
30384
30390
|
: undefined;
|
|
30385
30391
|
if (name) {
|
|
30386
30392
|
while (token() === 80) {
|
|
@@ -31468,6 +31474,7 @@ var ts;
|
|
|
31468
31474
|
["es2021.intl", "lib.es2021.intl.d.ts"],
|
|
31469
31475
|
["es2022.array", "lib.es2022.array.d.ts"],
|
|
31470
31476
|
["es2022.error", "lib.es2022.error.d.ts"],
|
|
31477
|
+
["es2022.intl", "lib.es2022.intl.d.ts"],
|
|
31471
31478
|
["es2022.object", "lib.es2022.object.d.ts"],
|
|
31472
31479
|
["es2022.string", "lib.es2022.string.d.ts"],
|
|
31473
31480
|
["esnext.array", "lib.es2022.array.d.ts"],
|
|
@@ -31786,7 +31793,7 @@ var ts;
|
|
|
31786
31793
|
es2020: ts.ModuleKind.ES2020,
|
|
31787
31794
|
es2022: ts.ModuleKind.ES2022,
|
|
31788
31795
|
esnext: ts.ModuleKind.ESNext,
|
|
31789
|
-
|
|
31796
|
+
node16: ts.ModuleKind.Node16,
|
|
31790
31797
|
nodenext: ts.ModuleKind.NodeNext,
|
|
31791
31798
|
})),
|
|
31792
31799
|
affectsModuleResolution: true,
|
|
@@ -32135,7 +32142,7 @@ var ts;
|
|
|
32135
32142
|
type: new ts.Map(ts.getEntries({
|
|
32136
32143
|
node: ts.ModuleResolutionKind.NodeJs,
|
|
32137
32144
|
classic: ts.ModuleResolutionKind.Classic,
|
|
32138
|
-
|
|
32145
|
+
node16: ts.ModuleResolutionKind.Node16,
|
|
32139
32146
|
nodenext: ts.ModuleResolutionKind.NodeNext,
|
|
32140
32147
|
})),
|
|
32141
32148
|
affectsModuleResolution: true,
|
|
@@ -32598,7 +32605,7 @@ var ts;
|
|
|
32598
32605
|
affectsModuleResolution: true,
|
|
32599
32606
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
32600
32607
|
category: ts.Diagnostics.Language_and_Environment,
|
|
32601
|
-
defaultValueDescription: ts.Diagnostics.
|
|
32608
|
+
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
32602
32609
|
}
|
|
32603
32610
|
];
|
|
32604
32611
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
@@ -34359,7 +34366,7 @@ var ts;
|
|
|
34359
34366
|
ts.Debug.assert(ts.extensionIsTS(resolved.extension));
|
|
34360
34367
|
return { fileName: resolved.path, packageId: resolved.packageId };
|
|
34361
34368
|
}
|
|
34362
|
-
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) {
|
|
34369
|
+
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, diagnostics, resultFromCache) {
|
|
34363
34370
|
var _a;
|
|
34364
34371
|
if (resultFromCache) {
|
|
34365
34372
|
(_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations);
|
|
@@ -34367,7 +34374,8 @@ var ts;
|
|
|
34367
34374
|
}
|
|
34368
34375
|
return {
|
|
34369
34376
|
resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId },
|
|
34370
|
-
failedLookupLocations: failedLookupLocations
|
|
34377
|
+
failedLookupLocations: failedLookupLocations,
|
|
34378
|
+
resolutionDiagnostics: diagnostics
|
|
34371
34379
|
};
|
|
34372
34380
|
}
|
|
34373
34381
|
function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) {
|
|
@@ -34544,11 +34552,22 @@ var ts;
|
|
|
34544
34552
|
}
|
|
34545
34553
|
var failedLookupLocations = [];
|
|
34546
34554
|
var features = getDefaultNodeResolutionFeatures(options);
|
|
34547
|
-
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
34555
|
+
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
|
|
34548
34556
|
features |= NodeResolutionFeatures.EsmMode;
|
|
34549
34557
|
}
|
|
34550
34558
|
var conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
|
|
34551
|
-
var
|
|
34559
|
+
var diagnostics = [];
|
|
34560
|
+
var moduleResolutionState = {
|
|
34561
|
+
compilerOptions: options,
|
|
34562
|
+
host: host,
|
|
34563
|
+
traceEnabled: traceEnabled,
|
|
34564
|
+
failedLookupLocations: failedLookupLocations,
|
|
34565
|
+
packageJsonInfoCache: cache,
|
|
34566
|
+
features: features,
|
|
34567
|
+
conditions: conditions,
|
|
34568
|
+
requestContainingDirectory: containingDirectory,
|
|
34569
|
+
reportDiagnostic: function (diag) { return void diagnostics.push(diag); },
|
|
34570
|
+
};
|
|
34552
34571
|
var resolved = primaryLookup();
|
|
34553
34572
|
var primary = true;
|
|
34554
34573
|
if (!resolved) {
|
|
@@ -34567,7 +34586,7 @@ var ts;
|
|
|
34567
34586
|
isExternalLibraryImport: pathContainsNodeModules(fileName),
|
|
34568
34587
|
};
|
|
34569
34588
|
}
|
|
34570
|
-
result = { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
|
|
34589
|
+
result = { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations, resolutionDiagnostics: diagnostics };
|
|
34571
34590
|
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName, resolutionMode, result);
|
|
34572
34591
|
if (traceEnabled)
|
|
34573
34592
|
traceResult(result);
|
|
@@ -34631,7 +34650,7 @@ var ts;
|
|
|
34631
34650
|
}
|
|
34632
34651
|
ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
|
|
34633
34652
|
function getDefaultNodeResolutionFeatures(options) {
|
|
34634
|
-
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
34653
|
+
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default :
|
|
34635
34654
|
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
34636
34655
|
NodeResolutionFeatures.None;
|
|
34637
34656
|
}
|
|
@@ -34644,6 +34663,8 @@ var ts;
|
|
|
34644
34663
|
packageJsonInfoCache: cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(),
|
|
34645
34664
|
conditions: ts.emptyArray,
|
|
34646
34665
|
features: NodeResolutionFeatures.None,
|
|
34666
|
+
requestContainingDirectory: containingDirectory,
|
|
34667
|
+
reportDiagnostic: ts.noop
|
|
34647
34668
|
};
|
|
34648
34669
|
return ts.forEachAncestorDirectory(containingDirectory, function (ancestorDirectory) {
|
|
34649
34670
|
if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
@@ -34944,8 +34965,8 @@ var ts;
|
|
|
34944
34965
|
case ts.ModuleKind.CommonJS:
|
|
34945
34966
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
34946
34967
|
break;
|
|
34947
|
-
case ts.ModuleKind.
|
|
34948
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
34968
|
+
case ts.ModuleKind.Node16:
|
|
34969
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
34949
34970
|
break;
|
|
34950
34971
|
case ts.ModuleKind.NodeNext:
|
|
34951
34972
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -34965,8 +34986,8 @@ var ts;
|
|
|
34965
34986
|
}
|
|
34966
34987
|
ts.perfLogger.logStartResolveModule(moduleName);
|
|
34967
34988
|
switch (moduleResolution) {
|
|
34968
|
-
case ts.ModuleResolutionKind.
|
|
34969
|
-
result =
|
|
34989
|
+
case ts.ModuleResolutionKind.Node16:
|
|
34990
|
+
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34970
34991
|
break;
|
|
34971
34992
|
case ts.ModuleResolutionKind.NodeNext:
|
|
34972
34993
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -35124,12 +35145,12 @@ var ts;
|
|
|
35124
35145
|
NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
|
|
35125
35146
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
35126
35147
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
35127
|
-
NodeResolutionFeatures[NodeResolutionFeatures["
|
|
35148
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node16Default"] = 30] = "Node16Default";
|
|
35128
35149
|
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
35129
35150
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
35130
35151
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
35131
|
-
function
|
|
35132
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
35152
|
+
function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35153
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node16Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
35133
35154
|
}
|
|
35134
35155
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35135
35156
|
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -35172,6 +35193,7 @@ var ts;
|
|
|
35172
35193
|
if (compilerOptions.noDtsResolution) {
|
|
35173
35194
|
conditions.pop();
|
|
35174
35195
|
}
|
|
35196
|
+
var diagnostics = [];
|
|
35175
35197
|
var state = {
|
|
35176
35198
|
compilerOptions: compilerOptions,
|
|
35177
35199
|
host: host,
|
|
@@ -35180,9 +35202,11 @@ var ts;
|
|
|
35180
35202
|
packageJsonInfoCache: cache,
|
|
35181
35203
|
features: features,
|
|
35182
35204
|
conditions: conditions,
|
|
35205
|
+
requestContainingDirectory: containingDirectory,
|
|
35206
|
+
reportDiagnostic: function (diag) { return void diagnostics.push(diag); },
|
|
35183
35207
|
};
|
|
35184
35208
|
var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
|
|
35185
|
-
return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);
|
|
35209
|
+
return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, diagnostics, state.resultFromCache);
|
|
35186
35210
|
function tryResolve(extensions) {
|
|
35187
35211
|
var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, true); };
|
|
35188
35212
|
var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state);
|
|
@@ -35324,9 +35348,9 @@ var ts;
|
|
|
35324
35348
|
}
|
|
35325
35349
|
}
|
|
35326
35350
|
function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
|
|
35327
|
-
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && ts.
|
|
35351
|
+
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && ts.fileExtensionIsOneOf(candidate, ts.supportedTSExtensionsFlat)) {
|
|
35328
35352
|
var result = tryFile(candidate, onlyRecordFailures, state);
|
|
35329
|
-
return result !== undefined ? { path: candidate, ext: ts.
|
|
35353
|
+
return result !== undefined ? { path: candidate, ext: ts.tryExtractTSExtension(candidate) } : undefined;
|
|
35330
35354
|
}
|
|
35331
35355
|
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
35332
35356
|
}
|
|
@@ -35443,6 +35467,8 @@ var ts;
|
|
|
35443
35467
|
packageJsonInfoCache: cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(),
|
|
35444
35468
|
conditions: ["node", "require", "types"],
|
|
35445
35469
|
features: features,
|
|
35470
|
+
requestContainingDirectory: packageJsonInfo.packageDirectory,
|
|
35471
|
+
reportDiagnostic: ts.noop
|
|
35446
35472
|
};
|
|
35447
35473
|
var requireResolution = loadNodeModuleFromDirectoryWorker(extensions, packageJsonInfo.packageDirectory, false, requireState, packageJsonInfo.packageJsonContent, packageJsonInfo.versionPaths);
|
|
35448
35474
|
entrypoints = ts.append(entrypoints, requireResolution === null || requireResolution === void 0 ? void 0 : requireResolution.path);
|
|
@@ -35522,6 +35548,8 @@ var ts;
|
|
|
35522
35548
|
packageJsonInfoCache: packageJsonInfoCache,
|
|
35523
35549
|
features: 0,
|
|
35524
35550
|
conditions: [],
|
|
35551
|
+
requestContainingDirectory: undefined,
|
|
35552
|
+
reportDiagnostic: ts.noop
|
|
35525
35553
|
};
|
|
35526
35554
|
var parts = ts.getPathComponents(fileName);
|
|
35527
35555
|
parts.pop();
|
|
@@ -35796,7 +35824,6 @@ var ts;
|
|
|
35796
35824
|
function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
|
|
35797
35825
|
return loadModuleFromTargetImportOrExport;
|
|
35798
35826
|
function loadModuleFromTargetImportOrExport(target, subpath, pattern) {
|
|
35799
|
-
var _a, _b;
|
|
35800
35827
|
if (typeof target === "string") {
|
|
35801
35828
|
if (!pattern && subpath.length > 0 && !ts.endsWith(target, "/")) {
|
|
35802
35829
|
if (state.traceEnabled) {
|
|
@@ -35831,13 +35858,16 @@ var ts;
|
|
|
35831
35858
|
}
|
|
35832
35859
|
return toSearchResult(undefined);
|
|
35833
35860
|
}
|
|
35834
|
-
var finalPath =
|
|
35861
|
+
var finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath);
|
|
35862
|
+
var inputLink = tryLoadInputFileForPath(finalPath, subpath, ts.combinePaths(scope.packageDirectory, "package.json"), isImports);
|
|
35863
|
+
if (inputLink)
|
|
35864
|
+
return inputLink;
|
|
35835
35865
|
return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state)));
|
|
35836
35866
|
}
|
|
35837
35867
|
else if (typeof target === "object" && target !== null) {
|
|
35838
35868
|
if (!Array.isArray(target)) {
|
|
35839
|
-
for (var _i = 0,
|
|
35840
|
-
var key =
|
|
35869
|
+
for (var _i = 0, _a = ts.getOwnKeys(target); _i < _a.length; _i++) {
|
|
35870
|
+
var key = _a[_i];
|
|
35841
35871
|
if (key === "default" || state.conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(state.conditions, key)) {
|
|
35842
35872
|
var subTarget = target[key];
|
|
35843
35873
|
var result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern);
|
|
@@ -35855,8 +35885,8 @@ var ts;
|
|
|
35855
35885
|
}
|
|
35856
35886
|
return toSearchResult(undefined);
|
|
35857
35887
|
}
|
|
35858
|
-
for (var
|
|
35859
|
-
var elem = target_2[
|
|
35888
|
+
for (var _b = 0, target_2 = target; _b < target_2.length; _b++) {
|
|
35889
|
+
var elem = target_2[_b];
|
|
35860
35890
|
var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
|
|
35861
35891
|
if (result) {
|
|
35862
35892
|
return result;
|
|
@@ -35874,6 +35904,94 @@ var ts;
|
|
|
35874
35904
|
trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
35875
35905
|
}
|
|
35876
35906
|
return toSearchResult(undefined);
|
|
35907
|
+
function toAbsolutePath(path) {
|
|
35908
|
+
var _a, _b;
|
|
35909
|
+
if (path === undefined)
|
|
35910
|
+
return path;
|
|
35911
|
+
return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
|
|
35912
|
+
}
|
|
35913
|
+
function combineDirectoryPath(root, dir) {
|
|
35914
|
+
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
35915
|
+
}
|
|
35916
|
+
function useCaseSensitiveFileNames() {
|
|
35917
|
+
return !state.host.useCaseSensitiveFileNames ? true :
|
|
35918
|
+
typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames :
|
|
35919
|
+
state.host.useCaseSensitiveFileNames();
|
|
35920
|
+
}
|
|
35921
|
+
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports) {
|
|
35922
|
+
var _a, _b, _c, _d;
|
|
35923
|
+
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
35924
|
+
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
35925
|
+
&& finalPath.indexOf("/node_modules/") === -1
|
|
35926
|
+
&& (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
|
|
35927
|
+
var getCanonicalFileName = ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames });
|
|
35928
|
+
var commonSourceDirGuesses = [];
|
|
35929
|
+
if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) {
|
|
35930
|
+
var commonDir = toAbsolutePath(ts.getCommonSourceDirectory(state.compilerOptions, function () { return []; }, ((_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
|
|
35931
|
+
commonSourceDirGuesses.push(commonDir);
|
|
35932
|
+
}
|
|
35933
|
+
else if (state.requestContainingDirectory) {
|
|
35934
|
+
var requestingFile_1 = toAbsolutePath(ts.combinePaths(state.requestContainingDirectory, "index.ts"));
|
|
35935
|
+
var commonDir = toAbsolutePath(ts.getCommonSourceDirectory(state.compilerOptions, function () { return [requestingFile_1, toAbsolutePath(packagePath)]; }, ((_d = (_c = state.host).getCurrentDirectory) === null || _d === void 0 ? void 0 : _d.call(_c)) || "", getCanonicalFileName));
|
|
35936
|
+
commonSourceDirGuesses.push(commonDir);
|
|
35937
|
+
var fragment = ts.ensureTrailingDirectorySeparator(commonDir);
|
|
35938
|
+
while (fragment && fragment.length > 1) {
|
|
35939
|
+
var parts = ts.getPathComponents(fragment);
|
|
35940
|
+
parts.pop();
|
|
35941
|
+
var commonDir_1 = ts.getPathFromPathComponents(parts);
|
|
35942
|
+
commonSourceDirGuesses.unshift(commonDir_1);
|
|
35943
|
+
fragment = ts.ensureTrailingDirectorySeparator(commonDir_1);
|
|
35944
|
+
}
|
|
35945
|
+
}
|
|
35946
|
+
if (commonSourceDirGuesses.length > 1) {
|
|
35947
|
+
state.reportDiagnostic(ts.createCompilerDiagnostic(isImports
|
|
35948
|
+
? ts.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate
|
|
35949
|
+
: ts.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, entry === "" ? "." : entry, packagePath));
|
|
35950
|
+
}
|
|
35951
|
+
for (var _i = 0, commonSourceDirGuesses_1 = commonSourceDirGuesses; _i < commonSourceDirGuesses_1.length; _i++) {
|
|
35952
|
+
var commonSourceDirGuess = commonSourceDirGuesses_1[_i];
|
|
35953
|
+
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
35954
|
+
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
35955
|
+
var candidateDir = candidateDirectories_1[_e];
|
|
35956
|
+
if (ts.startsWith(finalPath, candidateDir)) {
|
|
35957
|
+
var pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
35958
|
+
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
35959
|
+
var jsAndDtsExtensions = [".mjs", ".cjs", ".js", ".json", ".d.mts", ".d.cts", ".d.ts"];
|
|
35960
|
+
for (var _f = 0, jsAndDtsExtensions_1 = jsAndDtsExtensions; _f < jsAndDtsExtensions_1.length; _f++) {
|
|
35961
|
+
var ext = jsAndDtsExtensions_1[_f];
|
|
35962
|
+
if (ts.fileExtensionIs(possibleInputBase, ext)) {
|
|
35963
|
+
var inputExts = ts.getPossibleOriginalInputExtensionForExtension(possibleInputBase);
|
|
35964
|
+
for (var _g = 0, inputExts_1 = inputExts; _g < inputExts_1.length; _g++) {
|
|
35965
|
+
var possibleExt = inputExts_1[_g];
|
|
35966
|
+
var possibleInputWithInputExtension = ts.changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
|
35967
|
+
if ((extensions === Extensions.TypeScript && ts.hasJSFileExtension(possibleInputWithInputExtension)) ||
|
|
35968
|
+
(extensions === Extensions.JavaScript && ts.hasTSFileExtension(possibleInputWithInputExtension))) {
|
|
35969
|
+
continue;
|
|
35970
|
+
}
|
|
35971
|
+
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
|
35972
|
+
return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
|
|
35973
|
+
}
|
|
35974
|
+
}
|
|
35975
|
+
}
|
|
35976
|
+
}
|
|
35977
|
+
}
|
|
35978
|
+
}
|
|
35979
|
+
}
|
|
35980
|
+
}
|
|
35981
|
+
return undefined;
|
|
35982
|
+
function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) {
|
|
35983
|
+
var _a, _b;
|
|
35984
|
+
var currentDir = state.compilerOptions.configFile ? ((_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)) || "" : commonSourceDirGuess;
|
|
35985
|
+
var candidateDirectories = [];
|
|
35986
|
+
if (state.compilerOptions.declarationDir) {
|
|
35987
|
+
candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir)));
|
|
35988
|
+
}
|
|
35989
|
+
if (state.compilerOptions.outDir && state.compilerOptions.outDir !== state.compilerOptions.declarationDir) {
|
|
35990
|
+
candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.outDir)));
|
|
35991
|
+
}
|
|
35992
|
+
return candidateDirectories;
|
|
35993
|
+
}
|
|
35994
|
+
}
|
|
35877
35995
|
}
|
|
35878
35996
|
}
|
|
35879
35997
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
@@ -36048,10 +36166,11 @@ var ts;
|
|
|
36048
36166
|
function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
36049
36167
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
36050
36168
|
var failedLookupLocations = [];
|
|
36051
|
-
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [] };
|
|
36052
36169
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
36170
|
+
var diagnostics = [];
|
|
36171
|
+
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [], requestContainingDirectory: containingDirectory, reportDiagnostic: function (diag) { return void diagnostics.push(diag); } };
|
|
36053
36172
|
var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript);
|
|
36054
|
-
return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations, state.resultFromCache);
|
|
36173
|
+
return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations, diagnostics, state.resultFromCache);
|
|
36055
36174
|
function tryResolve(extensions) {
|
|
36056
36175
|
var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state);
|
|
36057
36176
|
if (resolvedUsingSettings) {
|
|
@@ -36087,9 +36206,10 @@ var ts;
|
|
|
36087
36206
|
trace(host, ts.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache);
|
|
36088
36207
|
}
|
|
36089
36208
|
var failedLookupLocations = [];
|
|
36090
|
-
var
|
|
36209
|
+
var diagnostics = [];
|
|
36210
|
+
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: packageJsonInfoCache, features: NodeResolutionFeatures.None, conditions: [], requestContainingDirectory: undefined, reportDiagnostic: function (diag) { return void diagnostics.push(diag); } };
|
|
36091
36211
|
var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, false, undefined, undefined);
|
|
36092
|
-
return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations, state.resultFromCache);
|
|
36212
|
+
return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations, diagnostics, state.resultFromCache);
|
|
36093
36213
|
}
|
|
36094
36214
|
ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache;
|
|
36095
36215
|
function toSearchResult(value) {
|
|
@@ -41700,16 +41820,13 @@ var ts;
|
|
|
41700
41820
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
41701
41821
|
errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference);
|
|
41702
41822
|
}
|
|
41703
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
41823
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
41704
41824
|
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
41705
41825
|
var overrideClauseHost = ts.findAncestor(location, function (l) { return ts.isImportTypeNode(l) || ts.isExportDeclaration(l) || ts.isImportDeclaration(l); });
|
|
41706
41826
|
var overrideClause = overrideClauseHost && ts.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause;
|
|
41707
41827
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext && !ts.getResolutionModeOverrideForClause(overrideClause)) {
|
|
41708
41828
|
error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
|
|
41709
41829
|
}
|
|
41710
|
-
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json") {
|
|
41711
|
-
error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
|
|
41712
|
-
}
|
|
41713
41830
|
}
|
|
41714
41831
|
return getMergedSymbol(sourceFile.symbol);
|
|
41715
41832
|
}
|
|
@@ -41753,7 +41870,7 @@ var ts;
|
|
|
41753
41870
|
var tsExtension = ts.tryExtractTSExtension(moduleReference);
|
|
41754
41871
|
var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
|
|
41755
41872
|
var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
|
|
41756
|
-
var
|
|
41873
|
+
var resolutionIsNode16OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node16 ||
|
|
41757
41874
|
moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
|
|
41758
41875
|
if (tsExtension) {
|
|
41759
41876
|
var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
|
|
@@ -41770,17 +41887,17 @@ var ts;
|
|
|
41770
41887
|
ts.hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
41771
41888
|
error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
41772
41889
|
}
|
|
41773
|
-
else if (mode === ts.ModuleKind.ESNext &&
|
|
41890
|
+
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
41774
41891
|
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
41775
41892
|
var suggestedExt = (_h = suggestedExtensions.find(function (_a) {
|
|
41776
41893
|
var actualExt = _a[0], _importExt = _a[1];
|
|
41777
41894
|
return host.fileExists(absoluteRef_1 + actualExt);
|
|
41778
41895
|
})) === null || _h === void 0 ? void 0 : _h[1];
|
|
41779
41896
|
if (suggestedExt) {
|
|
41780
|
-
error(errorNode, ts.Diagnostics.
|
|
41897
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
41781
41898
|
}
|
|
41782
41899
|
else {
|
|
41783
|
-
error(errorNode, ts.Diagnostics.
|
|
41900
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
|
41784
41901
|
}
|
|
41785
41902
|
}
|
|
41786
41903
|
else {
|
|
@@ -43877,7 +43994,7 @@ var ts;
|
|
|
43877
43994
|
var targetFile = ts.getSourceFileOfModule(chain[0]);
|
|
43878
43995
|
var specifier = void 0;
|
|
43879
43996
|
var assertion = void 0;
|
|
43880
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
43997
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
43881
43998
|
if ((targetFile === null || targetFile === void 0 ? void 0 : targetFile.impliedNodeFormat) === ts.ModuleKind.ESNext && targetFile.impliedNodeFormat !== (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat)) {
|
|
43882
43999
|
specifier = getSpecifierForModuleSymbol(chain[0], context, ts.ModuleKind.ESNext);
|
|
43883
44000
|
assertion = ts.factory.createImportTypeAssertionContainer(ts.factory.createAssertClause(ts.factory.createNodeArray([
|
|
@@ -43890,7 +44007,7 @@ var ts;
|
|
|
43890
44007
|
}
|
|
43891
44008
|
if (!(context.flags & 67108864) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
|
|
43892
44009
|
var oldSpecifier = specifier;
|
|
43893
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
44010
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
43894
44011
|
var swappedMode = (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat) === ts.ModuleKind.ESNext ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
43895
44012
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
43896
44013
|
if (specifier.indexOf("/node_modules/") >= 0) {
|
|
@@ -47934,7 +48051,8 @@ var ts;
|
|
|
47934
48051
|
if (symbol === globalThisSymbol) {
|
|
47935
48052
|
var varsOnly_1 = new ts.Map();
|
|
47936
48053
|
members.forEach(function (p) {
|
|
47937
|
-
|
|
48054
|
+
var _a;
|
|
48055
|
+
if (!(p.flags & 418) && !(p.flags & 512 && ((_a = p.declarations) === null || _a === void 0 ? void 0 : _a.length) && ts.every(p.declarations, ts.isAmbientModule))) {
|
|
47938
48056
|
varsOnly_1.set(p.escapedName, p);
|
|
47939
48057
|
}
|
|
47940
48058
|
});
|
|
@@ -59440,7 +59558,7 @@ var ts;
|
|
|
59440
59558
|
if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
59441
59559
|
var parent = declaration.parent.parent;
|
|
59442
59560
|
if (parent.kind === 254 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 164) {
|
|
59443
|
-
var links = getNodeLinks(
|
|
59561
|
+
var links = getNodeLinks(parent);
|
|
59444
59562
|
if (!(links.flags & 268435456)) {
|
|
59445
59563
|
links.flags |= 268435456;
|
|
59446
59564
|
var parentType = getTypeForBindingElementParent(parent, 0);
|
|
@@ -64409,13 +64527,13 @@ var ts;
|
|
|
64409
64527
|
}
|
|
64410
64528
|
}
|
|
64411
64529
|
function checkImportMetaProperty(node) {
|
|
64412
|
-
if (moduleKind === ts.ModuleKind.
|
|
64530
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
64413
64531
|
if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
64414
64532
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
64415
64533
|
}
|
|
64416
64534
|
}
|
|
64417
64535
|
else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
|
|
64418
|
-
error(node, ts.Diagnostics.
|
|
64536
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
|
|
64419
64537
|
}
|
|
64420
64538
|
var file = ts.getSourceFileOfNode(node);
|
|
64421
64539
|
ts.Debug.assert(!!(file.flags & 4194304), "Containing file is missing import meta node flag.");
|
|
@@ -65247,15 +65365,28 @@ var ts;
|
|
|
65247
65365
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
65248
65366
|
var span = void 0;
|
|
65249
65367
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
65250
|
-
|
|
65251
|
-
span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
65368
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
65252
65369
|
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.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);
|
|
65253
65370
|
diagnostics.add(diagnostic);
|
|
65254
65371
|
}
|
|
65255
|
-
|
|
65256
|
-
|
|
65257
|
-
|
|
65258
|
-
|
|
65372
|
+
switch (moduleKind) {
|
|
65373
|
+
case ts.ModuleKind.Node16:
|
|
65374
|
+
case ts.ModuleKind.NodeNext:
|
|
65375
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
65376
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
65377
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
65378
|
+
break;
|
|
65379
|
+
}
|
|
65380
|
+
case ts.ModuleKind.ES2022:
|
|
65381
|
+
case ts.ModuleKind.ESNext:
|
|
65382
|
+
case ts.ModuleKind.System:
|
|
65383
|
+
if (languageVersion >= 4) {
|
|
65384
|
+
break;
|
|
65385
|
+
}
|
|
65386
|
+
default:
|
|
65387
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
65388
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.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));
|
|
65389
|
+
break;
|
|
65259
65390
|
}
|
|
65260
65391
|
}
|
|
65261
65392
|
}
|
|
@@ -67456,8 +67587,8 @@ var ts;
|
|
|
67456
67587
|
if (node.assertions) {
|
|
67457
67588
|
var override = ts.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
|
|
67458
67589
|
if (override) {
|
|
67459
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
67460
|
-
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.
|
|
67590
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
67591
|
+
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
67461
67592
|
}
|
|
67462
67593
|
}
|
|
67463
67594
|
}
|
|
@@ -68626,7 +68757,7 @@ var ts;
|
|
|
68626
68757
|
});
|
|
68627
68758
|
}
|
|
68628
68759
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
68629
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.
|
|
68760
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
68630
68761
|
return;
|
|
68631
68762
|
}
|
|
68632
68763
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -71076,8 +71207,8 @@ var ts;
|
|
|
71076
71207
|
var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
71077
71208
|
var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
|
|
71078
71209
|
if (validForTypeAssertions && override) {
|
|
71079
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
71080
|
-
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.
|
|
71210
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
71211
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
71081
71212
|
}
|
|
71082
71213
|
return;
|
|
71083
71214
|
}
|
|
@@ -72282,7 +72413,7 @@ var ts;
|
|
|
72282
72413
|
}
|
|
72283
72414
|
if (ts.isDeclaration(node)) {
|
|
72284
72415
|
var symbol = getSymbolOfNode(node);
|
|
72285
|
-
return getTypeOfSymbol(symbol);
|
|
72416
|
+
return symbol ? getTypeOfSymbol(symbol) : errorType;
|
|
72286
72417
|
}
|
|
72287
72418
|
if (isDeclarationNameOrImportPropertyName(node)) {
|
|
72288
72419
|
var symbol = getSymbolAtLocation(node);
|
|
@@ -73969,8 +74100,22 @@ var ts;
|
|
|
73969
74100
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
73970
74101
|
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.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));
|
|
73971
74102
|
}
|
|
73972
|
-
|
|
73973
|
-
|
|
74103
|
+
switch (moduleKind) {
|
|
74104
|
+
case ts.ModuleKind.Node16:
|
|
74105
|
+
case ts.ModuleKind.NodeNext:
|
|
74106
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
74107
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
74108
|
+
break;
|
|
74109
|
+
}
|
|
74110
|
+
case ts.ModuleKind.ES2022:
|
|
74111
|
+
case ts.ModuleKind.ESNext:
|
|
74112
|
+
case ts.ModuleKind.System:
|
|
74113
|
+
if (languageVersion >= 4) {
|
|
74114
|
+
break;
|
|
74115
|
+
}
|
|
74116
|
+
default:
|
|
74117
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.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));
|
|
74118
|
+
break;
|
|
73974
74119
|
}
|
|
73975
74120
|
}
|
|
73976
74121
|
}
|
|
@@ -74602,7 +74747,7 @@ var ts;
|
|
|
74602
74747
|
}
|
|
74603
74748
|
function checkGrammarImportCallExpression(node) {
|
|
74604
74749
|
if (moduleKind === ts.ModuleKind.ES2015) {
|
|
74605
|
-
return grammarErrorOnNode(node, ts.Diagnostics.
|
|
74750
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
|
|
74606
74751
|
}
|
|
74607
74752
|
if (node.typeArguments) {
|
|
74608
74753
|
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);
|
|
@@ -74612,7 +74757,7 @@ var ts;
|
|
|
74612
74757
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
74613
74758
|
if (nodeArguments.length > 1) {
|
|
74614
74759
|
var assertionArgument = nodeArguments[1];
|
|
74615
|
-
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.
|
|
74760
|
+
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
74616
74761
|
}
|
|
74617
74762
|
}
|
|
74618
74763
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
@@ -89386,7 +89531,7 @@ var ts;
|
|
|
89386
89531
|
return ts.transformECMAScriptModule;
|
|
89387
89532
|
case ts.ModuleKind.System:
|
|
89388
89533
|
return ts.transformSystemModule;
|
|
89389
|
-
case ts.ModuleKind.
|
|
89534
|
+
case ts.ModuleKind.Node16:
|
|
89390
89535
|
case ts.ModuleKind.NodeNext:
|
|
89391
89536
|
return ts.transformNodeModule;
|
|
89392
89537
|
default:
|
|
@@ -95709,7 +95854,7 @@ var ts;
|
|
|
95709
95854
|
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
|
|
95710
95855
|
function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) {
|
|
95711
95856
|
switch (ts.getEmitModuleResolutionKind(options)) {
|
|
95712
|
-
case ts.ModuleResolutionKind.
|
|
95857
|
+
case ts.ModuleResolutionKind.Node16:
|
|
95713
95858
|
case ts.ModuleResolutionKind.NodeNext:
|
|
95714
95859
|
return ts.fileExtensionIsOneOf(fileName, [".d.mts", ".mts", ".mjs"]) ? ts.ModuleKind.ESNext :
|
|
95715
95860
|
ts.fileExtensionIsOneOf(fileName, [".d.cts", ".cts", ".cjs"]) ? ts.ModuleKind.CommonJS :
|
|
@@ -95760,7 +95905,6 @@ var ts;
|
|
|
95760
95905
|
ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
|
|
95761
95906
|
ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
|
|
95762
95907
|
ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
|
|
95763
|
-
ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
|
|
95764
95908
|
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
95765
95909
|
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
95766
95910
|
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
@@ -96099,6 +96243,34 @@ var ts;
|
|
|
96099
96243
|
ts.performance.measure("Program", "beforeProgram", "afterProgram");
|
|
96100
96244
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
96101
96245
|
return program;
|
|
96246
|
+
function addResolutionDiagnostics(list) {
|
|
96247
|
+
if (!list)
|
|
96248
|
+
return;
|
|
96249
|
+
for (var _i = 0, list_3 = list; _i < list_3.length; _i++) {
|
|
96250
|
+
var elem = list_3[_i];
|
|
96251
|
+
programDiagnostics.add(elem);
|
|
96252
|
+
}
|
|
96253
|
+
}
|
|
96254
|
+
function pullDiagnosticsFromCache(names, containingFile) {
|
|
96255
|
+
var _a;
|
|
96256
|
+
if (!moduleResolutionCache)
|
|
96257
|
+
return;
|
|
96258
|
+
var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
|
|
96259
|
+
var containingFileMode = !ts.isString(containingFile) ? containingFile.impliedNodeFormat : undefined;
|
|
96260
|
+
var containingDir = ts.getDirectoryPath(containingFileName);
|
|
96261
|
+
var redirectedReference = getRedirectReferenceForResolution(containingFile);
|
|
96262
|
+
var i = 0;
|
|
96263
|
+
for (var _i = 0, names_4 = names; _i < names_4.length; _i++) {
|
|
96264
|
+
var n = names_4[_i];
|
|
96265
|
+
var mode = typeof n === "string" ? getModeForResolutionAtIndex(containingFile, i) : getModeForFileReference(n, containingFileMode);
|
|
96266
|
+
var name = typeof n === "string" ? n : n.fileName;
|
|
96267
|
+
i++;
|
|
96268
|
+
if (ts.isExternalModuleNameRelative(name))
|
|
96269
|
+
continue;
|
|
96270
|
+
var diags = (_a = moduleResolutionCache.getOrCreateCacheForModuleName(name, mode, redirectedReference).get(containingDir)) === null || _a === void 0 ? void 0 : _a.resolutionDiagnostics;
|
|
96271
|
+
addResolutionDiagnostics(diags);
|
|
96272
|
+
}
|
|
96273
|
+
}
|
|
96102
96274
|
function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) {
|
|
96103
96275
|
if (!moduleNames.length)
|
|
96104
96276
|
return ts.emptyArray;
|
|
@@ -96110,6 +96282,7 @@ var ts;
|
|
|
96110
96282
|
ts.performance.mark("afterResolveModule");
|
|
96111
96283
|
ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule");
|
|
96112
96284
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
96285
|
+
pullDiagnosticsFromCache(moduleNames, containingFile);
|
|
96113
96286
|
return result;
|
|
96114
96287
|
}
|
|
96115
96288
|
function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) {
|
|
@@ -97398,8 +97571,8 @@ var ts;
|
|
|
97398
97571
|
var fileName = ts.toFileNameLowerCase(ref.fileName);
|
|
97399
97572
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
97400
97573
|
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
97401
|
-
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
97402
|
-
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.
|
|
97574
|
+
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
97575
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext));
|
|
97403
97576
|
}
|
|
97404
97577
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
97405
97578
|
}
|
|
@@ -97732,7 +97905,7 @@ var ts;
|
|
|
97732
97905
|
}
|
|
97733
97906
|
if (options.resolveJsonModule) {
|
|
97734
97907
|
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
|
|
97735
|
-
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
97908
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 &&
|
|
97736
97909
|
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
97737
97910
|
createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
|
|
97738
97911
|
}
|
|
@@ -99912,8 +100085,8 @@ var ts;
|
|
|
99912
100085
|
!!redirectedReference;
|
|
99913
100086
|
var seenNamesInFile = ts.createModeAwareCache();
|
|
99914
100087
|
var i = 0;
|
|
99915
|
-
for (var _i = 0,
|
|
99916
|
-
var entry =
|
|
100088
|
+
for (var _i = 0, names_5 = names; _i < names_5.length; _i++) {
|
|
100089
|
+
var entry = names_5[_i];
|
|
99917
100090
|
var name = ts.isString(entry) ? entry : entry.fileName.toLowerCase();
|
|
99918
100091
|
var mode = !ts.isString(entry) ? ts.getModeForFileReference(entry, containingSourceFileMode) :
|
|
99919
100092
|
containingSourceFile ? ts.getModeForResolutionAtIndex(containingSourceFile, i) : undefined;
|
|
@@ -100405,7 +100578,7 @@ var ts;
|
|
|
100405
100578
|
}
|
|
100406
100579
|
function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
|
|
100407
100580
|
var _a;
|
|
100408
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
100581
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16
|
|
100409
100582
|
&& ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
100410
100583
|
return false;
|
|
100411
100584
|
}
|
|
@@ -100901,7 +101074,7 @@ var ts;
|
|
|
100901
101074
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
100902
101075
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
100903
101076
|
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
100904
|
-
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
101077
|
+
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
100905
101078
|
var conditions = ["node", overrideMode || importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
100906
101079
|
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
100907
101080
|
? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
|