typescript 4.5.0-dev.20210923 → 4.5.0-dev.20210927
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/cs/diagnosticMessages.generated.json +2 -1
- package/lib/es/diagnosticMessages.generated.json +2 -1
- package/lib/fr/diagnosticMessages.generated.json +2 -1
- package/lib/it/diagnosticMessages.generated.json +2 -1
- package/lib/ja/diagnosticMessages.generated.json +2 -1
- package/lib/ko/diagnosticMessages.generated.json +2 -1
- package/lib/lib.es2021.d.ts +1 -0
- package/lib/lib.es2021.intl.d.ts +9 -0
- package/lib/pl/diagnosticMessages.generated.json +2 -1
- package/lib/pt-br/diagnosticMessages.generated.json +2 -1
- package/lib/ru/diagnosticMessages.generated.json +2 -1
- package/lib/tr/diagnosticMessages.generated.json +2 -1
- package/lib/tsc.js +1278 -386
- package/lib/tsserver.js +1487 -477
- package/lib/tsserverlibrary.d.ts +66 -15
- package/lib/tsserverlibrary.js +1487 -477
- package/lib/typescript.d.ts +64 -13
- package/lib/typescript.js +1482 -471
- package/lib/typescriptServices.d.ts +64 -13
- package/lib/typescriptServices.js +1482 -471
- package/lib/typingsInstaller.js +1413 -428
- package/lib/zh-cn/diagnosticMessages.generated.json +2 -1
- package/lib/zh-tw/diagnosticMessages.generated.json +2 -1
- 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.5";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20210927";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -3259,6 +3259,8 @@ var ts;
|
|
|
3259
3259
|
(function (ModuleResolutionKind) {
|
|
3260
3260
|
ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
|
|
3261
3261
|
ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
|
|
3262
|
+
ModuleResolutionKind[ModuleResolutionKind["Node12"] = 3] = "Node12";
|
|
3263
|
+
ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
|
|
3262
3264
|
})(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
|
|
3263
3265
|
var WatchFileKind;
|
|
3264
3266
|
(function (WatchFileKind) {
|
|
@@ -3293,6 +3295,8 @@ var ts;
|
|
|
3293
3295
|
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
|
|
3294
3296
|
ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
|
|
3295
3297
|
ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
|
|
3298
|
+
ModuleKind[ModuleKind["Node12"] = 100] = "Node12";
|
|
3299
|
+
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
3296
3300
|
})(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
|
|
3297
3301
|
ts.commentPragmas = {
|
|
3298
3302
|
"reference": {
|
|
@@ -5293,7 +5297,7 @@ var ts;
|
|
|
5293
5297
|
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."),
|
|
5294
5298
|
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."),
|
|
5295
5299
|
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."),
|
|
5296
|
-
|
|
5300
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_umd_node12_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),
|
|
5297
5301
|
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext'."),
|
|
5298
5302
|
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."),
|
|
5299
5303
|
Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."),
|
|
@@ -5311,7 +5315,7 @@ var ts;
|
|
|
5311
5315
|
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."),
|
|
5312
5316
|
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}')'?"),
|
|
5313
5317
|
Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
5314
|
-
|
|
5318
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_system_node12_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_system_node12__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', 'system', 'node12', or 'nodenext'."),
|
|
5315
5319
|
A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
5316
5320
|
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."),
|
|
5317
5321
|
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."),
|
|
@@ -5342,7 +5346,7 @@ var ts;
|
|
|
5342
5346
|
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."),
|
|
5343
5347
|
_0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
5344
5348
|
_0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
5345
|
-
|
|
5349
|
+
Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_system_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_esnext_system_or_noden_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
5346
5350
|
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'."),
|
|
5347
5351
|
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'."),
|
|
5348
5352
|
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 `}`?"),
|
|
@@ -5394,7 +5398,7 @@ var ts;
|
|
|
5394
5398
|
File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
5395
5399
|
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:"),
|
|
5396
5400
|
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."),
|
|
5397
|
-
|
|
5401
|
+
Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_system_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_esnext_system_or_nodenex_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
5398
5402
|
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."),
|
|
5399
5403
|
Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
5400
5404
|
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}'?"),
|
|
@@ -5411,6 +5415,9 @@ var ts;
|
|
|
5411
5415
|
_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, ts.DiagnosticCategory.Error, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),
|
|
5412
5416
|
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."),
|
|
5413
5417
|
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"),
|
|
5418
|
+
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"),
|
|
5419
|
+
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
5420
|
+
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: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "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."),
|
|
5414
5421
|
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."),
|
|
5415
5422
|
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."),
|
|
5416
5423
|
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),
|
|
@@ -5475,7 +5482,7 @@ var ts;
|
|
|
5475
5482
|
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
|
|
5476
5483
|
The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
|
|
5477
5484
|
The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
|
|
5478
|
-
|
|
5485
|
+
The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360", "The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),
|
|
5479
5486
|
The_right_hand_side_of_an_in_expression_must_not_be_a_primitive: diag(2361, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361", "The right-hand side of an 'in' expression must not be a primitive."),
|
|
5480
5487
|
The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
|
|
5481
5488
|
The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
|
|
@@ -6280,6 +6287,13 @@ var ts;
|
|
|
6280
6287
|
Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
|
|
6281
6288
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
6282
6289
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
6290
|
+
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
6291
|
+
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
6292
|
+
Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
|
|
6293
|
+
package_json_scope_0_has_no_imports_defined: diag(6273, ts.DiagnosticCategory.Message, "package_json_scope_0_has_no_imports_defined_6273", "package.json scope '{0}' has no imports defined."),
|
|
6294
|
+
package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, ts.DiagnosticCategory.Message, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."),
|
|
6295
|
+
package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, ts.DiagnosticCategory.Message, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"),
|
|
6296
|
+
Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, ts.DiagnosticCategory.Message, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
6283
6297
|
Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
6284
6298
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
6285
6299
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, ts.DiagnosticCategory.Error, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -6539,6 +6553,8 @@ var ts;
|
|
|
6539
6553
|
The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),
|
|
6540
6554
|
yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation: diag(7057, ts.DiagnosticCategory.Error, "yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057", "'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),
|
|
6541
6555
|
If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1: diag(7058, ts.DiagnosticCategory.Error, "If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058", "If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),
|
|
6556
|
+
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."),
|
|
6557
|
+
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."),
|
|
6542
6558
|
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
|
|
6543
6559
|
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."),
|
|
6544
6560
|
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."),
|
|
@@ -8911,7 +8927,7 @@ var ts;
|
|
|
8911
8927
|
}
|
|
8912
8928
|
ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics;
|
|
8913
8929
|
function getDefaultLibFileName(options) {
|
|
8914
|
-
switch (options
|
|
8930
|
+
switch (ts.getEmitScriptTarget(options)) {
|
|
8915
8931
|
case 99:
|
|
8916
8932
|
return "lib.esnext.full.d.ts";
|
|
8917
8933
|
case 8:
|
|
@@ -10030,6 +10046,7 @@ var ts;
|
|
|
10030
10046
|
case 225:
|
|
10031
10047
|
case 212:
|
|
10032
10048
|
case 79:
|
|
10049
|
+
case 80:
|
|
10033
10050
|
case 13:
|
|
10034
10051
|
case 8:
|
|
10035
10052
|
case 9:
|
|
@@ -10597,22 +10614,22 @@ var ts;
|
|
|
10597
10614
|
return node.end - node.pos;
|
|
10598
10615
|
}
|
|
10599
10616
|
ts.getFullWidth = getFullWidth;
|
|
10600
|
-
function getResolvedModule(sourceFile, moduleNameText) {
|
|
10601
|
-
return sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText);
|
|
10617
|
+
function getResolvedModule(sourceFile, moduleNameText, mode) {
|
|
10618
|
+
return sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText, mode);
|
|
10602
10619
|
}
|
|
10603
10620
|
ts.getResolvedModule = getResolvedModule;
|
|
10604
|
-
function setResolvedModule(sourceFile, moduleNameText, resolvedModule) {
|
|
10621
|
+
function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) {
|
|
10605
10622
|
if (!sourceFile.resolvedModules) {
|
|
10606
|
-
sourceFile.resolvedModules =
|
|
10623
|
+
sourceFile.resolvedModules = ts.createModeAwareCache();
|
|
10607
10624
|
}
|
|
10608
|
-
sourceFile.resolvedModules.set(moduleNameText, resolvedModule);
|
|
10625
|
+
sourceFile.resolvedModules.set(moduleNameText, mode, resolvedModule);
|
|
10609
10626
|
}
|
|
10610
10627
|
ts.setResolvedModule = setResolvedModule;
|
|
10611
10628
|
function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) {
|
|
10612
10629
|
if (!sourceFile.resolvedTypeReferenceDirectiveNames) {
|
|
10613
|
-
sourceFile.resolvedTypeReferenceDirectiveNames =
|
|
10630
|
+
sourceFile.resolvedTypeReferenceDirectiveNames = ts.createModeAwareCache();
|
|
10614
10631
|
}
|
|
10615
|
-
sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective);
|
|
10632
|
+
sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, undefined, resolvedTypeReferenceDirective);
|
|
10616
10633
|
}
|
|
10617
10634
|
ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective;
|
|
10618
10635
|
function projectReferenceIsEqualTo(oldRef, newRef) {
|
|
@@ -10644,11 +10661,11 @@ var ts;
|
|
|
10644
10661
|
&& oldResolution.originalPath === newResolution.originalPath;
|
|
10645
10662
|
}
|
|
10646
10663
|
ts.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo;
|
|
10647
|
-
function hasChangesInResolutions(names, newResolutions, oldResolutions, comparer) {
|
|
10664
|
+
function hasChangesInResolutions(names, newResolutions, oldResolutions, oldSourceFile, comparer) {
|
|
10648
10665
|
ts.Debug.assert(names.length === newResolutions.length);
|
|
10649
10666
|
for (var i = 0; i < names.length; i++) {
|
|
10650
10667
|
var newResolution = newResolutions[i];
|
|
10651
|
-
var oldResolution = oldResolutions && oldResolutions.get(names[i]);
|
|
10668
|
+
var oldResolution = oldResolutions && oldResolutions.get(names[i], oldSourceFile && ts.getModeForResolutionAtIndex(oldSourceFile, i));
|
|
10652
10669
|
var changed = oldResolution
|
|
10653
10670
|
? !newResolution || !comparer(oldResolution, newResolution)
|
|
10654
10671
|
: newResolution;
|
|
@@ -11092,8 +11109,11 @@ var ts;
|
|
|
11092
11109
|
return (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return !isExternalModuleAugmentation(d) && !(ts.isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); });
|
|
11093
11110
|
}
|
|
11094
11111
|
ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;
|
|
11112
|
+
function isCommonJSContainingModuleKind(kind) {
|
|
11113
|
+
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node12 || kind === ts.ModuleKind.NodeNext;
|
|
11114
|
+
}
|
|
11095
11115
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
11096
|
-
return ts.isExternalModule(node) || compilerOptions.isolatedModules || ((getEmitModuleKind(compilerOptions)
|
|
11116
|
+
return ts.isExternalModule(node) || compilerOptions.isolatedModules || (isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator);
|
|
11097
11117
|
}
|
|
11098
11118
|
ts.isEffectiveExternalModule = isEffectiveExternalModule;
|
|
11099
11119
|
function isEffectiveStrictModeSourceFile(node, compilerOptions) {
|
|
@@ -12118,6 +12138,8 @@ var ts;
|
|
|
12118
12138
|
node = node.parent;
|
|
12119
12139
|
}
|
|
12120
12140
|
return node.parent.kind === 180 || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node);
|
|
12141
|
+
case 80:
|
|
12142
|
+
return ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 101;
|
|
12121
12143
|
case 79:
|
|
12122
12144
|
if (node.parent.kind === 180 || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node)) {
|
|
12123
12145
|
return true;
|
|
@@ -13475,6 +13497,7 @@ var ts;
|
|
|
13475
13497
|
case 108:
|
|
13476
13498
|
case 106:
|
|
13477
13499
|
case 79:
|
|
13500
|
+
case 80:
|
|
13478
13501
|
case 104:
|
|
13479
13502
|
case 110:
|
|
13480
13503
|
case 95:
|
|
@@ -13948,9 +13971,17 @@ var ts;
|
|
|
13948
13971
|
var path = outputDir
|
|
13949
13972
|
? getSourceFilePathInNewDirWorker(fileName, outputDir, currentDirectory, commonSourceDirectory, getCanonicalFileName)
|
|
13950
13973
|
: fileName;
|
|
13951
|
-
|
|
13974
|
+
var declarationExtension = getDeclarationEmitExtensionForPath(path);
|
|
13975
|
+
return removeFileExtension(path) + declarationExtension;
|
|
13952
13976
|
}
|
|
13953
13977
|
ts.getDeclarationEmitOutputFilePathWorker = getDeclarationEmitOutputFilePathWorker;
|
|
13978
|
+
function getDeclarationEmitExtensionForPath(path) {
|
|
13979
|
+
return ts.fileExtensionIsOneOf(path, [".mjs", ".mts"]) ? ".d.mts" :
|
|
13980
|
+
ts.fileExtensionIsOneOf(path, [".cjs", ".cts"]) ? ".d.cts" :
|
|
13981
|
+
ts.fileExtensionIsOneOf(path, [".json"]) ? ".json.d.ts" :
|
|
13982
|
+
".d.ts";
|
|
13983
|
+
}
|
|
13984
|
+
ts.getDeclarationEmitExtensionForPath = getDeclarationEmitExtensionForPath;
|
|
13954
13985
|
function outFile(options) {
|
|
13955
13986
|
return options.outFile || options.out;
|
|
13956
13987
|
}
|
|
@@ -14592,7 +14623,7 @@ var ts;
|
|
|
14592
14623
|
return symbol && ts.length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 512);
|
|
14593
14624
|
}
|
|
14594
14625
|
function tryExtractTSExtension(fileName) {
|
|
14595
|
-
return ts.find(
|
|
14626
|
+
return ts.find(supportedTSExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); });
|
|
14596
14627
|
}
|
|
14597
14628
|
ts.tryExtractTSExtension = tryExtractTSExtension;
|
|
14598
14629
|
function getExpandedCharCodes(input) {
|
|
@@ -15450,7 +15481,10 @@ var ts;
|
|
|
15450
15481
|
}
|
|
15451
15482
|
ts.getLanguageVariant = getLanguageVariant;
|
|
15452
15483
|
function getEmitScriptTarget(compilerOptions) {
|
|
15453
|
-
return compilerOptions.target ||
|
|
15484
|
+
return compilerOptions.target ||
|
|
15485
|
+
(compilerOptions.module === ts.ModuleKind.Node12 && 7) ||
|
|
15486
|
+
(compilerOptions.module === ts.ModuleKind.NodeNext && 99) ||
|
|
15487
|
+
0;
|
|
15454
15488
|
}
|
|
15455
15489
|
ts.getEmitScriptTarget = getEmitScriptTarget;
|
|
15456
15490
|
function getEmitModuleKind(compilerOptions) {
|
|
@@ -15462,7 +15496,20 @@ var ts;
|
|
|
15462
15496
|
function getEmitModuleResolutionKind(compilerOptions) {
|
|
15463
15497
|
var moduleResolution = compilerOptions.moduleResolution;
|
|
15464
15498
|
if (moduleResolution === undefined) {
|
|
15465
|
-
|
|
15499
|
+
switch (getEmitModuleKind(compilerOptions)) {
|
|
15500
|
+
case ts.ModuleKind.CommonJS:
|
|
15501
|
+
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
15502
|
+
break;
|
|
15503
|
+
case ts.ModuleKind.Node12:
|
|
15504
|
+
moduleResolution = ts.ModuleResolutionKind.Node12;
|
|
15505
|
+
break;
|
|
15506
|
+
case ts.ModuleKind.NodeNext:
|
|
15507
|
+
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
15508
|
+
break;
|
|
15509
|
+
default:
|
|
15510
|
+
moduleResolution = ts.ModuleResolutionKind.Classic;
|
|
15511
|
+
break;
|
|
15512
|
+
}
|
|
15466
15513
|
}
|
|
15467
15514
|
return moduleResolution;
|
|
15468
15515
|
}
|
|
@@ -15492,11 +15539,23 @@ var ts;
|
|
|
15492
15539
|
return !!(getEmitDeclarations(options) && options.declarationMap);
|
|
15493
15540
|
}
|
|
15494
15541
|
ts.getAreDeclarationMapsEnabled = getAreDeclarationMapsEnabled;
|
|
15542
|
+
function getESModuleInterop(compilerOptions) {
|
|
15543
|
+
if (compilerOptions.esModuleInterop !== undefined) {
|
|
15544
|
+
return compilerOptions.esModuleInterop;
|
|
15545
|
+
}
|
|
15546
|
+
switch (getEmitModuleKind(compilerOptions)) {
|
|
15547
|
+
case ts.ModuleKind.Node12:
|
|
15548
|
+
case ts.ModuleKind.NodeNext:
|
|
15549
|
+
return true;
|
|
15550
|
+
}
|
|
15551
|
+
return undefined;
|
|
15552
|
+
}
|
|
15553
|
+
ts.getESModuleInterop = getESModuleInterop;
|
|
15495
15554
|
function getAllowSyntheticDefaultImports(compilerOptions) {
|
|
15496
15555
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
15497
15556
|
return compilerOptions.allowSyntheticDefaultImports !== undefined
|
|
15498
15557
|
? compilerOptions.allowSyntheticDefaultImports
|
|
15499
|
-
: compilerOptions
|
|
15558
|
+
: getESModuleInterop(compilerOptions) ||
|
|
15500
15559
|
moduleKind === ts.ModuleKind.System;
|
|
15501
15560
|
}
|
|
15502
15561
|
ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports;
|
|
@@ -15521,7 +15580,7 @@ var ts;
|
|
|
15521
15580
|
}
|
|
15522
15581
|
ts.getAllowJSCompilerOption = getAllowJSCompilerOption;
|
|
15523
15582
|
function getUseDefineForClassFields(compilerOptions) {
|
|
15524
|
-
return compilerOptions.useDefineForClassFields === undefined ? compilerOptions
|
|
15583
|
+
return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions) === 99 : compilerOptions.useDefineForClassFields;
|
|
15525
15584
|
}
|
|
15526
15585
|
ts.getUseDefineForClassFields = getUseDefineForClassFields;
|
|
15527
15586
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
@@ -15899,48 +15958,51 @@ var ts;
|
|
|
15899
15958
|
}
|
|
15900
15959
|
}
|
|
15901
15960
|
ts.getScriptKindFromFileName = getScriptKindFromFileName;
|
|
15902
|
-
ts.supportedTSExtensions = [".ts", ".tsx", ".d.ts"];
|
|
15903
|
-
ts.
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
ts.
|
|
15907
|
-
|
|
15908
|
-
var
|
|
15961
|
+
ts.supportedTSExtensions = [[".ts", ".tsx", ".d.ts"], [".cts", ".d.cts"], [".mts", ".d.mts"]];
|
|
15962
|
+
ts.supportedTSExtensionsFlat = ts.flatten(ts.supportedTSExtensions);
|
|
15963
|
+
var supportedTSExtensionsWithJson = __spreadArray(__spreadArray([], ts.supportedTSExtensions, true), [[".json"]], false);
|
|
15964
|
+
var supportedTSExtensionsForExtractExtension = [".d.ts", ".d.cts", ".d.mts", ".cts", ".mts", ".ts", ".tsx", ".cts", ".mts"];
|
|
15965
|
+
ts.supportedJSExtensions = [[".js", ".jsx"], [".mjs"], [".cjs"]];
|
|
15966
|
+
ts.supportedJSExtensionsFlat = ts.flatten(ts.supportedJSExtensions);
|
|
15967
|
+
var allSupportedExtensions = [[".ts", ".tsx", ".d.ts", ".js", ".jsx"], [".cts", ".d.cts", ".cjs"], [".mts", ".d.mts", ".mjs"]];
|
|
15968
|
+
var allSupportedExtensionsWithJson = __spreadArray(__spreadArray([], allSupportedExtensions, true), [[".json"]], false);
|
|
15909
15969
|
function getSupportedExtensions(options, extraFileExtensions) {
|
|
15910
15970
|
var needJsExtensions = options && getAllowJSCompilerOption(options);
|
|
15911
15971
|
if (!extraFileExtensions || extraFileExtensions.length === 0) {
|
|
15912
15972
|
return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
|
|
15913
15973
|
}
|
|
15914
|
-
var
|
|
15915
|
-
|
|
15974
|
+
var builtins = needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
|
|
15975
|
+
var flatBuiltins = ts.flatten(builtins);
|
|
15976
|
+
var extensions = __spreadArray(__spreadArray([], builtins, true), ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.indexOf(x.extension) === -1 ? [x.extension] : undefined; }), true);
|
|
15977
|
+
return extensions;
|
|
15916
15978
|
}
|
|
15917
15979
|
ts.getSupportedExtensions = getSupportedExtensions;
|
|
15918
|
-
function
|
|
15980
|
+
function getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions) {
|
|
15919
15981
|
if (!options || !options.resolveJsonModule)
|
|
15920
15982
|
return supportedExtensions;
|
|
15921
15983
|
if (supportedExtensions === allSupportedExtensions)
|
|
15922
15984
|
return allSupportedExtensionsWithJson;
|
|
15923
15985
|
if (supportedExtensions === ts.supportedTSExtensions)
|
|
15924
|
-
return
|
|
15925
|
-
return __spreadArray(__spreadArray([], supportedExtensions, true), [".json"], false);
|
|
15986
|
+
return supportedTSExtensionsWithJson;
|
|
15987
|
+
return __spreadArray(__spreadArray([], supportedExtensions, true), [[".json"]], false);
|
|
15926
15988
|
}
|
|
15927
|
-
ts.
|
|
15989
|
+
ts.getSupportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule;
|
|
15928
15990
|
function isJSLike(scriptKind) {
|
|
15929
15991
|
return scriptKind === 1 || scriptKind === 2;
|
|
15930
15992
|
}
|
|
15931
15993
|
function hasJSFileExtension(fileName) {
|
|
15932
|
-
return ts.some(ts.
|
|
15994
|
+
return ts.some(ts.supportedJSExtensionsFlat, function (extension) { return ts.fileExtensionIs(fileName, extension); });
|
|
15933
15995
|
}
|
|
15934
15996
|
ts.hasJSFileExtension = hasJSFileExtension;
|
|
15935
15997
|
function hasTSFileExtension(fileName) {
|
|
15936
|
-
return ts.some(ts.
|
|
15998
|
+
return ts.some(ts.supportedTSExtensionsFlat, function (extension) { return ts.fileExtensionIs(fileName, extension); });
|
|
15937
15999
|
}
|
|
15938
16000
|
ts.hasTSFileExtension = hasTSFileExtension;
|
|
15939
16001
|
function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) {
|
|
15940
16002
|
if (!fileName)
|
|
15941
16003
|
return false;
|
|
15942
16004
|
var supportedExtensions = getSupportedExtensions(compilerOptions, extraFileExtensions);
|
|
15943
|
-
for (var _i = 0, _a =
|
|
16005
|
+
for (var _i = 0, _a = ts.flatten(getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, supportedExtensions)); _i < _a.length; _i++) {
|
|
15944
16006
|
var extension = _a[_i];
|
|
15945
16007
|
if (ts.fileExtensionIs(fileName, extension)) {
|
|
15946
16008
|
return true;
|
|
@@ -15957,37 +16019,7 @@ var ts;
|
|
|
15957
16019
|
return ts.compareValues(numberOfDirectorySeparators(path1), numberOfDirectorySeparators(path2));
|
|
15958
16020
|
}
|
|
15959
16021
|
ts.compareNumberOfDirectorySeparators = compareNumberOfDirectorySeparators;
|
|
15960
|
-
|
|
15961
|
-
for (var i = supportedExtensions.length - 1; i >= 0; i--) {
|
|
15962
|
-
if (ts.fileExtensionIs(path, supportedExtensions[i])) {
|
|
15963
|
-
return adjustExtensionPriority(i, supportedExtensions);
|
|
15964
|
-
}
|
|
15965
|
-
}
|
|
15966
|
-
return 0;
|
|
15967
|
-
}
|
|
15968
|
-
ts.getExtensionPriority = getExtensionPriority;
|
|
15969
|
-
function adjustExtensionPriority(extensionPriority, supportedExtensions) {
|
|
15970
|
-
if (extensionPriority < 2) {
|
|
15971
|
-
return 0;
|
|
15972
|
-
}
|
|
15973
|
-
else if (extensionPriority < supportedExtensions.length) {
|
|
15974
|
-
return 2;
|
|
15975
|
-
}
|
|
15976
|
-
else {
|
|
15977
|
-
return supportedExtensions.length;
|
|
15978
|
-
}
|
|
15979
|
-
}
|
|
15980
|
-
ts.adjustExtensionPriority = adjustExtensionPriority;
|
|
15981
|
-
function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) {
|
|
15982
|
-
if (extensionPriority < 2) {
|
|
15983
|
-
return 2;
|
|
15984
|
-
}
|
|
15985
|
-
else {
|
|
15986
|
-
return supportedExtensions.length;
|
|
15987
|
-
}
|
|
15988
|
-
}
|
|
15989
|
-
ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority;
|
|
15990
|
-
var extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx", ".json"];
|
|
16022
|
+
var extensionsToRemove = [".d.ts", ".d.mts", ".d.cts", ".mjs", ".mts", ".cjs", ".cts", ".ts", ".js", ".tsx", ".jsx", ".json"];
|
|
15991
16023
|
function removeFileExtension(path) {
|
|
15992
16024
|
for (var _i = 0, extensionsToRemove_1 = extensionsToRemove; _i < extensionsToRemove_1.length; _i++) {
|
|
15993
16025
|
var ext = extensionsToRemove_1[_i];
|
|
@@ -16033,7 +16065,7 @@ var ts;
|
|
|
16033
16065
|
}
|
|
16034
16066
|
ts.positionIsSynthesized = positionIsSynthesized;
|
|
16035
16067
|
function extensionIsTS(ext) {
|
|
16036
|
-
return ext === ".ts" || ext === ".tsx" || ext === ".d.ts";
|
|
16068
|
+
return ext === ".ts" || ext === ".tsx" || ext === ".d.ts" || ext === ".cts" || ext === ".mts" || ext === ".d.mts" || ext === ".d.cts";
|
|
16037
16069
|
}
|
|
16038
16070
|
ts.extensionIsTS = extensionIsTS;
|
|
16039
16071
|
function resolutionExtensionIsTSOrJson(ext) {
|
|
@@ -20435,6 +20467,7 @@ var ts;
|
|
|
20435
20467
|
node.transformFlags =
|
|
20436
20468
|
propagateChildrenFlags(node.statements) |
|
|
20437
20469
|
propagateChildFlags(node.endOfFileToken);
|
|
20470
|
+
node.impliedNodeFormat = source.impliedNodeFormat;
|
|
20438
20471
|
return node;
|
|
20439
20472
|
}
|
|
20440
20473
|
function updateSourceFile(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives) {
|
|
@@ -21682,6 +21715,7 @@ var ts;
|
|
|
21682
21715
|
createExportStarHelper: createExportStarHelper,
|
|
21683
21716
|
createClassPrivateFieldGetHelper: createClassPrivateFieldGetHelper,
|
|
21684
21717
|
createClassPrivateFieldSetHelper: createClassPrivateFieldSetHelper,
|
|
21718
|
+
createClassPrivateFieldInHelper: createClassPrivateFieldInHelper
|
|
21685
21719
|
};
|
|
21686
21720
|
function getUnscopedHelperName(name) {
|
|
21687
21721
|
return ts.setEmitFlags(factory.createIdentifier(name), 4096 | 2);
|
|
@@ -21714,7 +21748,7 @@ var ts;
|
|
|
21714
21748
|
]), location);
|
|
21715
21749
|
}
|
|
21716
21750
|
function createAssignHelper(attributesSegments) {
|
|
21717
|
-
if (context.getCompilerOptions()
|
|
21751
|
+
if (ts.getEmitScriptTarget(context.getCompilerOptions()) >= 2) {
|
|
21718
21752
|
return factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "assign"), undefined, attributesSegments);
|
|
21719
21753
|
}
|
|
21720
21754
|
context.requestEmitHelper(ts.assignHelper);
|
|
@@ -21847,6 +21881,10 @@ var ts;
|
|
|
21847
21881
|
}
|
|
21848
21882
|
return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldSet"), undefined, args);
|
|
21849
21883
|
}
|
|
21884
|
+
function createClassPrivateFieldInHelper(state, receiver) {
|
|
21885
|
+
context.requestEmitHelper(ts.classPrivateFieldInHelper);
|
|
21886
|
+
return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldIn"), undefined, [state, receiver]);
|
|
21887
|
+
}
|
|
21850
21888
|
}
|
|
21851
21889
|
ts.createEmitHelperFactory = createEmitHelperFactory;
|
|
21852
21890
|
function compareEmitHelpers(x, y) {
|
|
@@ -22031,6 +22069,12 @@ var ts;
|
|
|
22031
22069
|
scoped: false,
|
|
22032
22070
|
text: "\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };"
|
|
22033
22071
|
};
|
|
22072
|
+
ts.classPrivateFieldInHelper = {
|
|
22073
|
+
name: "typescript:classPrivateFieldIn",
|
|
22074
|
+
importName: "__classPrivateFieldIn",
|
|
22075
|
+
scoped: false,
|
|
22076
|
+
text: "\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n };"
|
|
22077
|
+
};
|
|
22034
22078
|
var allUnscopedEmitHelpers;
|
|
22035
22079
|
function getAllUnscopedEmitHelpers() {
|
|
22036
22080
|
return allUnscopedEmitHelpers || (allUnscopedEmitHelpers = ts.arrayToMap([
|
|
@@ -22055,6 +22099,7 @@ var ts;
|
|
|
22055
22099
|
ts.exportStarHelper,
|
|
22056
22100
|
ts.classPrivateFieldGetHelper,
|
|
22057
22101
|
ts.classPrivateFieldSetHelper,
|
|
22102
|
+
ts.classPrivateFieldInHelper,
|
|
22058
22103
|
ts.createBindingHelper,
|
|
22059
22104
|
ts.setModuleDefaultHelper
|
|
22060
22105
|
], function (helper) { return helper.name; }));
|
|
@@ -23246,7 +23291,7 @@ var ts;
|
|
|
23246
23291
|
if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
23247
23292
|
var namedBindings = void 0;
|
|
23248
23293
|
var moduleKind = ts.getEmitModuleKind(compilerOptions);
|
|
23249
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && moduleKind <= ts.ModuleKind.ESNext) {
|
|
23294
|
+
if ((moduleKind >= ts.ModuleKind.ES2015 && moduleKind <= ts.ModuleKind.ESNext) || sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
|
|
23250
23295
|
var helpers = ts.getEmitHelpers(sourceFile);
|
|
23251
23296
|
if (helpers) {
|
|
23252
23297
|
var helperNames = [];
|
|
@@ -23291,9 +23336,9 @@ var ts;
|
|
|
23291
23336
|
return externalHelpersModuleName;
|
|
23292
23337
|
}
|
|
23293
23338
|
var moduleKind = ts.getEmitModuleKind(compilerOptions);
|
|
23294
|
-
var create = (hasExportStarsToExportValues || (compilerOptions
|
|
23339
|
+
var create = (hasExportStarsToExportValues || (ts.getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault))
|
|
23295
23340
|
&& moduleKind !== ts.ModuleKind.System
|
|
23296
|
-
&& moduleKind < ts.ModuleKind.ES2015;
|
|
23341
|
+
&& (moduleKind < ts.ModuleKind.ES2015 || node.impliedNodeFormat === ts.ModuleKind.CommonJS);
|
|
23297
23342
|
if (!create) {
|
|
23298
23343
|
var helpers = ts.getEmitHelpers(node);
|
|
23299
23344
|
if (helpers) {
|
|
@@ -27672,6 +27717,8 @@ var ts;
|
|
|
27672
27717
|
break;
|
|
27673
27718
|
case 15:
|
|
27674
27719
|
return parseTemplateExpression(false);
|
|
27720
|
+
case 80:
|
|
27721
|
+
return parsePrivateIdentifier();
|
|
27675
27722
|
}
|
|
27676
27723
|
return parseIdentifier(ts.Diagnostics.Expression_expected);
|
|
27677
27724
|
}
|
|
@@ -30046,6 +30093,7 @@ var ts;
|
|
|
30046
30093
|
updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
|
|
30047
30094
|
var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true, sourceFile.scriptKind);
|
|
30048
30095
|
result.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result.commentDirectives, changeRange.span.start, ts.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks);
|
|
30096
|
+
result.impliedNodeFormat = sourceFile.impliedNodeFormat;
|
|
30049
30097
|
return result;
|
|
30050
30098
|
}
|
|
30051
30099
|
IncrementalParser.updateSourceFile = updateSourceFile;
|
|
@@ -30345,7 +30393,7 @@ var ts;
|
|
|
30345
30393
|
IncrementalParser.createSyntaxCursor = createSyntaxCursor;
|
|
30346
30394
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
30347
30395
|
function isDeclarationFileName(fileName) {
|
|
30348
|
-
return ts.
|
|
30396
|
+
return ts.fileExtensionIsOneOf(fileName, [".d.ts", ".d.mts", ".d.cts"]);
|
|
30349
30397
|
}
|
|
30350
30398
|
ts.isDeclarationFileName = isDeclarationFileName;
|
|
30351
30399
|
function processCommentPragmas(context, sourceText) {
|
|
@@ -30922,7 +30970,9 @@ var ts;
|
|
|
30922
30970
|
es6: ts.ModuleKind.ES2015,
|
|
30923
30971
|
es2015: ts.ModuleKind.ES2015,
|
|
30924
30972
|
es2020: ts.ModuleKind.ES2020,
|
|
30925
|
-
esnext: ts.ModuleKind.ESNext
|
|
30973
|
+
esnext: ts.ModuleKind.ESNext,
|
|
30974
|
+
node12: ts.ModuleKind.Node12,
|
|
30975
|
+
nodenext: ts.ModuleKind.NodeNext,
|
|
30926
30976
|
})),
|
|
30927
30977
|
affectsModuleResolution: true,
|
|
30928
30978
|
affectsEmit: true,
|
|
@@ -31792,7 +31842,7 @@ var ts;
|
|
|
31792
31842
|
};
|
|
31793
31843
|
ts.defaultInitCompilerOptions = {
|
|
31794
31844
|
module: ts.ModuleKind.CommonJS,
|
|
31795
|
-
target:
|
|
31845
|
+
target: 3,
|
|
31796
31846
|
strict: true,
|
|
31797
31847
|
esModuleInterop: true,
|
|
31798
31848
|
forceConsistentCasingInFileNames: true,
|
|
@@ -33132,7 +33182,7 @@ var ts;
|
|
|
33132
33182
|
var wildCardJsonFileMap = new ts.Map();
|
|
33133
33183
|
var validatedFilesSpec = configFileSpecs.validatedFilesSpec, validatedIncludeSpecs = configFileSpecs.validatedIncludeSpecs, validatedExcludeSpecs = configFileSpecs.validatedExcludeSpecs;
|
|
33134
33184
|
var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions);
|
|
33135
|
-
var supportedExtensionsWithJsonIfResolveJsonModule = ts.
|
|
33185
|
+
var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
|
|
33136
33186
|
if (validatedFilesSpec) {
|
|
33137
33187
|
for (var _i = 0, validatedFilesSpec_1 = validatedFilesSpec; _i < validatedFilesSpec_1.length; _i++) {
|
|
33138
33188
|
var fileName = validatedFilesSpec_1[_i];
|
|
@@ -33167,7 +33217,7 @@ var ts;
|
|
|
33167
33217
|
wildcardFileMap.set(key, file);
|
|
33168
33218
|
}
|
|
33169
33219
|
};
|
|
33170
|
-
for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensionsWithJsonIfResolveJsonModule, validatedExcludeSpecs, validatedIncludeSpecs, undefined); _a < _b.length; _a++) {
|
|
33220
|
+
for (var _a = 0, _b = host.readDirectory(basePath, ts.flatten(supportedExtensionsWithJsonIfResolveJsonModule), validatedExcludeSpecs, validatedIncludeSpecs, undefined); _a < _b.length; _a++) {
|
|
33171
33221
|
var file = _b[_a];
|
|
33172
33222
|
_loop_6(file);
|
|
33173
33223
|
}
|
|
@@ -33299,23 +33349,36 @@ var ts;
|
|
|
33299
33349
|
return undefined;
|
|
33300
33350
|
}
|
|
33301
33351
|
function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) {
|
|
33302
|
-
var
|
|
33303
|
-
|
|
33304
|
-
|
|
33305
|
-
|
|
33306
|
-
|
|
33352
|
+
var extensionGroup = ts.forEach(extensions, function (group) { return ts.fileExtensionIsOneOf(file, group) ? group : undefined; });
|
|
33353
|
+
if (!extensionGroup) {
|
|
33354
|
+
return false;
|
|
33355
|
+
}
|
|
33356
|
+
for (var _i = 0, extensionGroup_1 = extensionGroup; _i < extensionGroup_1.length; _i++) {
|
|
33357
|
+
var ext = extensionGroup_1[_i];
|
|
33358
|
+
if (ts.fileExtensionIs(file, ext)) {
|
|
33359
|
+
return false;
|
|
33360
|
+
}
|
|
33361
|
+
var higherPriorityPath = keyMapper(ts.changeExtension(file, ext));
|
|
33307
33362
|
if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) {
|
|
33363
|
+
if (ext === ".d.ts" && (ts.fileExtensionIs(file, ".js") || ts.fileExtensionIs(file, ".jsx"))) {
|
|
33364
|
+
continue;
|
|
33365
|
+
}
|
|
33308
33366
|
return true;
|
|
33309
33367
|
}
|
|
33310
33368
|
}
|
|
33311
33369
|
return false;
|
|
33312
33370
|
}
|
|
33313
33371
|
function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) {
|
|
33314
|
-
var
|
|
33315
|
-
|
|
33316
|
-
|
|
33317
|
-
|
|
33318
|
-
|
|
33372
|
+
var extensionGroup = ts.forEach(extensions, function (group) { return ts.fileExtensionIsOneOf(file, group) ? group : undefined; });
|
|
33373
|
+
if (!extensionGroup) {
|
|
33374
|
+
return;
|
|
33375
|
+
}
|
|
33376
|
+
for (var i = extensionGroup.length - 1; i >= 0; i--) {
|
|
33377
|
+
var ext = extensionGroup[i];
|
|
33378
|
+
if (ts.fileExtensionIs(file, ext)) {
|
|
33379
|
+
return;
|
|
33380
|
+
}
|
|
33381
|
+
var lowerPriorityPath = keyMapper(ts.changeExtension(file, ext));
|
|
33319
33382
|
wildcardFiles.delete(lowerPriorityPath);
|
|
33320
33383
|
}
|
|
33321
33384
|
}
|
|
@@ -33551,7 +33614,7 @@ var ts;
|
|
|
33551
33614
|
}
|
|
33552
33615
|
var containingDirectory = containingFile ? ts.getDirectoryPath(containingFile) : undefined;
|
|
33553
33616
|
var perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : undefined;
|
|
33554
|
-
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName);
|
|
33617
|
+
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName, undefined);
|
|
33555
33618
|
if (result) {
|
|
33556
33619
|
if (traceEnabled) {
|
|
33557
33620
|
trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
|
@@ -33585,7 +33648,7 @@ var ts;
|
|
|
33585
33648
|
}
|
|
33586
33649
|
}
|
|
33587
33650
|
var failedLookupLocations = [];
|
|
33588
|
-
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache };
|
|
33651
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] };
|
|
33589
33652
|
var resolved = primaryLookup();
|
|
33590
33653
|
var primary = true;
|
|
33591
33654
|
if (!resolved) {
|
|
@@ -33605,7 +33668,7 @@ var ts;
|
|
|
33605
33668
|
};
|
|
33606
33669
|
}
|
|
33607
33670
|
result = { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
|
|
33608
|
-
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName, result);
|
|
33671
|
+
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName, undefined, result);
|
|
33609
33672
|
if (traceEnabled)
|
|
33610
33673
|
traceResult(result);
|
|
33611
33674
|
return result;
|
|
@@ -33797,9 +33860,54 @@ var ts;
|
|
|
33797
33860
|
}
|
|
33798
33861
|
function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
|
|
33799
33862
|
var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
33800
|
-
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, function () { return
|
|
33863
|
+
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, function () { return createModeAwareCache(); });
|
|
33801
33864
|
}
|
|
33802
33865
|
}
|
|
33866
|
+
function createModeAwareCache() {
|
|
33867
|
+
var underlying = new ts.Map();
|
|
33868
|
+
var memoizedReverseKeys = new ts.Map();
|
|
33869
|
+
var cache = {
|
|
33870
|
+
get: function (specifier, mode) {
|
|
33871
|
+
return underlying.get(getUnderlyingCacheKey(specifier, mode));
|
|
33872
|
+
},
|
|
33873
|
+
set: function (specifier, mode, value) {
|
|
33874
|
+
underlying.set(getUnderlyingCacheKey(specifier, mode), value);
|
|
33875
|
+
return cache;
|
|
33876
|
+
},
|
|
33877
|
+
delete: function (specifier, mode) {
|
|
33878
|
+
underlying.delete(getUnderlyingCacheKey(specifier, mode));
|
|
33879
|
+
return cache;
|
|
33880
|
+
},
|
|
33881
|
+
has: function (specifier, mode) {
|
|
33882
|
+
return underlying.has(getUnderlyingCacheKey(specifier, mode));
|
|
33883
|
+
},
|
|
33884
|
+
forEach: function (cb) {
|
|
33885
|
+
return underlying.forEach(function (elem, key) {
|
|
33886
|
+
var _a = memoizedReverseKeys.get(key), specifier = _a[0], mode = _a[1];
|
|
33887
|
+
return cb(elem, specifier, mode);
|
|
33888
|
+
});
|
|
33889
|
+
},
|
|
33890
|
+
size: function () {
|
|
33891
|
+
return underlying.size;
|
|
33892
|
+
}
|
|
33893
|
+
};
|
|
33894
|
+
return cache;
|
|
33895
|
+
function getUnderlyingCacheKey(specifier, mode) {
|
|
33896
|
+
var result = mode === undefined ? specifier : mode + "|" + specifier;
|
|
33897
|
+
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
33898
|
+
return result;
|
|
33899
|
+
}
|
|
33900
|
+
}
|
|
33901
|
+
ts.createModeAwareCache = createModeAwareCache;
|
|
33902
|
+
function zipToModeAwareCache(file, keys, values) {
|
|
33903
|
+
ts.Debug.assert(keys.length === values.length);
|
|
33904
|
+
var map = createModeAwareCache();
|
|
33905
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
33906
|
+
map.set(keys[i], ts.getModeForResolutionAtIndex(file, i), values[i]);
|
|
33907
|
+
}
|
|
33908
|
+
return map;
|
|
33909
|
+
}
|
|
33910
|
+
ts.zipToModeAwareCache = zipToModeAwareCache;
|
|
33803
33911
|
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, directoryToModuleNameMap, moduleNameToDirectoryMap) {
|
|
33804
33912
|
var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options)));
|
|
33805
33913
|
moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options));
|
|
@@ -33813,9 +33921,9 @@ var ts;
|
|
|
33813
33921
|
function update(options) {
|
|
33814
33922
|
updateRedirectsMap(options, directoryToModuleNameMap, moduleNameToDirectoryMap);
|
|
33815
33923
|
}
|
|
33816
|
-
function getOrCreateCacheForModuleName(nonRelativeModuleName, redirectedReference) {
|
|
33924
|
+
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
33817
33925
|
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
|
|
33818
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, nonRelativeModuleName, createPerModuleNameCache);
|
|
33926
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
|
|
33819
33927
|
}
|
|
33820
33928
|
function createPerModuleNameCache() {
|
|
33821
33929
|
var directoryPathMap = new ts.Map();
|
|
@@ -33875,13 +33983,15 @@ var ts;
|
|
|
33875
33983
|
}
|
|
33876
33984
|
}
|
|
33877
33985
|
ts.createTypeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache;
|
|
33878
|
-
function resolveModuleNameFromCache(moduleName, containingFile, cache) {
|
|
33986
|
+
function resolveModuleNameFromCache(moduleName, containingFile, cache, mode) {
|
|
33879
33987
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
33880
33988
|
var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);
|
|
33881
|
-
|
|
33989
|
+
if (!perFolderCache)
|
|
33990
|
+
return undefined;
|
|
33991
|
+
return perFolderCache.get(moduleName, mode);
|
|
33882
33992
|
}
|
|
33883
33993
|
ts.resolveModuleNameFromCache = resolveModuleNameFromCache;
|
|
33884
|
-
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
33994
|
+
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
33885
33995
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
33886
33996
|
if (redirectedReference) {
|
|
33887
33997
|
compilerOptions = redirectedReference.commandLine.options;
|
|
@@ -33894,7 +34004,7 @@ var ts;
|
|
|
33894
34004
|
}
|
|
33895
34005
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
33896
34006
|
var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference);
|
|
33897
|
-
var result = perFolderCache && perFolderCache.get(moduleName);
|
|
34007
|
+
var result = perFolderCache && perFolderCache.get(moduleName, resolutionMode);
|
|
33898
34008
|
if (result) {
|
|
33899
34009
|
if (traceEnabled) {
|
|
33900
34010
|
trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -33903,7 +34013,20 @@ var ts;
|
|
|
33903
34013
|
else {
|
|
33904
34014
|
var moduleResolution = compilerOptions.moduleResolution;
|
|
33905
34015
|
if (moduleResolution === undefined) {
|
|
33906
|
-
|
|
34016
|
+
switch (ts.getEmitModuleKind(compilerOptions)) {
|
|
34017
|
+
case ts.ModuleKind.CommonJS:
|
|
34018
|
+
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
34019
|
+
break;
|
|
34020
|
+
case ts.ModuleKind.Node12:
|
|
34021
|
+
moduleResolution = ts.ModuleResolutionKind.Node12;
|
|
34022
|
+
break;
|
|
34023
|
+
case ts.ModuleKind.NodeNext:
|
|
34024
|
+
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
34025
|
+
break;
|
|
34026
|
+
default:
|
|
34027
|
+
moduleResolution = ts.ModuleResolutionKind.Classic;
|
|
34028
|
+
break;
|
|
34029
|
+
}
|
|
33907
34030
|
if (traceEnabled) {
|
|
33908
34031
|
trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]);
|
|
33909
34032
|
}
|
|
@@ -33915,6 +34038,12 @@ var ts;
|
|
|
33915
34038
|
}
|
|
33916
34039
|
ts.perfLogger.logStartResolveModule(moduleName);
|
|
33917
34040
|
switch (moduleResolution) {
|
|
34041
|
+
case ts.ModuleResolutionKind.Node12:
|
|
34042
|
+
result = node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34043
|
+
break;
|
|
34044
|
+
case ts.ModuleResolutionKind.NodeNext:
|
|
34045
|
+
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34046
|
+
break;
|
|
33918
34047
|
case ts.ModuleResolutionKind.NodeJs:
|
|
33919
34048
|
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
33920
34049
|
break;
|
|
@@ -33928,9 +34057,9 @@ var ts;
|
|
|
33928
34057
|
ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
|
|
33929
34058
|
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
33930
34059
|
if (perFolderCache) {
|
|
33931
|
-
perFolderCache.set(moduleName, result);
|
|
34060
|
+
perFolderCache.set(moduleName, resolutionMode, result);
|
|
33932
34061
|
if (!ts.isExternalModuleNameRelative(moduleName)) {
|
|
33933
|
-
cache.getOrCreateCacheForModuleName(moduleName, redirectedReference).set(containingDirectory, result);
|
|
34062
|
+
cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
33934
34063
|
}
|
|
33935
34064
|
}
|
|
33936
34065
|
}
|
|
@@ -34064,22 +34193,51 @@ var ts;
|
|
|
34064
34193
|
return tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;
|
|
34065
34194
|
}
|
|
34066
34195
|
ts.tryResolveJSModule = tryResolveJSModule;
|
|
34196
|
+
var NodeResolutionFeatures;
|
|
34197
|
+
(function (NodeResolutionFeatures) {
|
|
34198
|
+
NodeResolutionFeatures[NodeResolutionFeatures["None"] = 0] = "None";
|
|
34199
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Imports"] = 2] = "Imports";
|
|
34200
|
+
NodeResolutionFeatures[NodeResolutionFeatures["SelfName"] = 4] = "SelfName";
|
|
34201
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
|
|
34202
|
+
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
34203
|
+
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
34204
|
+
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
34205
|
+
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
34206
|
+
function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
34207
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34208
|
+
}
|
|
34209
|
+
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
34210
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34211
|
+
}
|
|
34212
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
34213
|
+
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
34214
|
+
var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
|
|
34215
|
+
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions, redirectedReference);
|
|
34216
|
+
}
|
|
34067
34217
|
var jsOnlyExtensions = [Extensions.JavaScript];
|
|
34068
34218
|
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
|
|
34069
34219
|
var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
|
|
34070
34220
|
var tsconfigExtensions = [Extensions.TSConfig];
|
|
34071
34221
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
34072
|
-
return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
|
|
34222
|
+
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
|
|
34073
34223
|
}
|
|
34074
34224
|
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) {
|
|
34075
|
-
return nodeModuleNameResolverWorker(moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, lookupConfig ? tsconfigExtensions : (compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions), redirectedReference);
|
|
34225
|
+
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, lookupConfig ? tsconfigExtensions : (compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions), redirectedReference);
|
|
34076
34226
|
}
|
|
34077
34227
|
ts.nodeModuleNameResolver = nodeModuleNameResolver;
|
|
34078
|
-
function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
|
|
34228
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
|
|
34079
34229
|
var _a, _b;
|
|
34080
34230
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
34081
34231
|
var failedLookupLocations = [];
|
|
34082
|
-
var state = {
|
|
34232
|
+
var state = {
|
|
34233
|
+
compilerOptions: compilerOptions,
|
|
34234
|
+
host: host,
|
|
34235
|
+
traceEnabled: traceEnabled,
|
|
34236
|
+
failedLookupLocations: failedLookupLocations,
|
|
34237
|
+
packageJsonInfoCache: cache,
|
|
34238
|
+
features: features,
|
|
34239
|
+
conditions: features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"]
|
|
34240
|
+
};
|
|
34083
34241
|
var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
|
|
34084
34242
|
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);
|
|
34085
34243
|
function tryResolve(extensions) {
|
|
@@ -34089,10 +34247,19 @@ var ts;
|
|
|
34089
34247
|
return toSearchResult({ resolved: resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
|
|
34090
34248
|
}
|
|
34091
34249
|
if (!ts.isExternalModuleNameRelative(moduleName)) {
|
|
34092
|
-
|
|
34093
|
-
|
|
34250
|
+
var resolved_1;
|
|
34251
|
+
if (features & NodeResolutionFeatures.Imports && ts.startsWith(moduleName, "#")) {
|
|
34252
|
+
resolved_1 = loadModuleFromImports(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
|
|
34253
|
+
}
|
|
34254
|
+
if (!resolved_1 && features & NodeResolutionFeatures.SelfName) {
|
|
34255
|
+
resolved_1 = loadModuleFromSelfNameReference(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
|
|
34256
|
+
}
|
|
34257
|
+
if (!resolved_1) {
|
|
34258
|
+
if (traceEnabled) {
|
|
34259
|
+
trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]);
|
|
34260
|
+
}
|
|
34261
|
+
resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
|
|
34094
34262
|
}
|
|
34095
|
-
var resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
|
|
34096
34263
|
if (!resolved_1)
|
|
34097
34264
|
return undefined;
|
|
34098
34265
|
var resolvedValue = resolved_1.value;
|
|
@@ -34182,22 +34349,35 @@ var ts;
|
|
|
34182
34349
|
function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
34183
34350
|
if (extensions === Extensions.Json || extensions === Extensions.TSConfig) {
|
|
34184
34351
|
var extensionLess = ts.tryRemoveExtension(candidate, ".json");
|
|
34185
|
-
|
|
34352
|
+
var extension = extensionLess ? candidate.substring(extensionLess.length) : "";
|
|
34353
|
+
return (extensionLess === undefined && extensions === Extensions.Json) ? undefined : tryAddingExtensions(extensionLess || candidate, extensions, extension, onlyRecordFailures, state);
|
|
34186
34354
|
}
|
|
34187
|
-
|
|
34188
|
-
|
|
34189
|
-
|
|
34355
|
+
if (!(state.features & NodeResolutionFeatures.EsmMode)) {
|
|
34356
|
+
var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state);
|
|
34357
|
+
if (resolvedByAddingExtension) {
|
|
34358
|
+
return resolvedByAddingExtension;
|
|
34359
|
+
}
|
|
34190
34360
|
}
|
|
34191
|
-
|
|
34361
|
+
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
34362
|
+
}
|
|
34363
|
+
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
34364
|
+
if (ts.hasJSFileExtension(candidate) || (ts.fileExtensionIs(candidate, ".json") && state.compilerOptions.resolveJsonModule)) {
|
|
34192
34365
|
var extensionless = ts.removeFileExtension(candidate);
|
|
34366
|
+
var extension = candidate.substring(extensionless.length);
|
|
34193
34367
|
if (state.traceEnabled) {
|
|
34194
|
-
var extension = candidate.substring(extensionless.length);
|
|
34195
34368
|
trace(state.host, ts.Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension);
|
|
34196
34369
|
}
|
|
34197
|
-
return tryAddingExtensions(extensionless, extensions, onlyRecordFailures, state);
|
|
34370
|
+
return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
|
|
34371
|
+
}
|
|
34372
|
+
}
|
|
34373
|
+
function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
|
|
34374
|
+
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && ts.fileExtensionIsOneOf(candidate, [".d.ts", ".d.cts", ".d.mts"])) {
|
|
34375
|
+
var result = tryFile(candidate, onlyRecordFailures, state);
|
|
34376
|
+
return result !== undefined ? { path: candidate, ext: ts.forEach([".d.ts", ".d.cts", ".d.mts"], function (e) { return ts.fileExtensionIs(candidate, e) ? e : undefined; }) } : undefined;
|
|
34198
34377
|
}
|
|
34378
|
+
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
34199
34379
|
}
|
|
34200
|
-
function tryAddingExtensions(candidate, extensions, onlyRecordFailures, state) {
|
|
34380
|
+
function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
|
|
34201
34381
|
if (!onlyRecordFailures) {
|
|
34202
34382
|
var directory = ts.getDirectoryPath(candidate);
|
|
34203
34383
|
if (directory) {
|
|
@@ -34206,11 +34386,51 @@ var ts;
|
|
|
34206
34386
|
}
|
|
34207
34387
|
switch (extensions) {
|
|
34208
34388
|
case Extensions.DtsOnly:
|
|
34209
|
-
|
|
34389
|
+
switch (originalExtension) {
|
|
34390
|
+
case ".mjs":
|
|
34391
|
+
case ".mts":
|
|
34392
|
+
case ".d.mts":
|
|
34393
|
+
return tryExtension(".d.mts");
|
|
34394
|
+
case ".cjs":
|
|
34395
|
+
case ".cts":
|
|
34396
|
+
case ".d.cts":
|
|
34397
|
+
return tryExtension(".d.cts");
|
|
34398
|
+
case ".json":
|
|
34399
|
+
candidate += ".json";
|
|
34400
|
+
return tryExtension(".d.ts");
|
|
34401
|
+
default: return tryExtension(".d.ts");
|
|
34402
|
+
}
|
|
34210
34403
|
case Extensions.TypeScript:
|
|
34211
|
-
|
|
34404
|
+
switch (originalExtension) {
|
|
34405
|
+
case ".mjs":
|
|
34406
|
+
case ".mts":
|
|
34407
|
+
case ".d.mts":
|
|
34408
|
+
return tryExtension(".mts") || tryExtension(".d.mts");
|
|
34409
|
+
case ".cjs":
|
|
34410
|
+
case ".cts":
|
|
34411
|
+
case ".d.cts":
|
|
34412
|
+
return tryExtension(".cts") || tryExtension(".d.cts");
|
|
34413
|
+
case ".json":
|
|
34414
|
+
candidate += ".json";
|
|
34415
|
+
return tryExtension(".d.ts");
|
|
34416
|
+
default:
|
|
34417
|
+
return tryExtension(".ts") || tryExtension(".tsx") || tryExtension(".d.ts");
|
|
34418
|
+
}
|
|
34212
34419
|
case Extensions.JavaScript:
|
|
34213
|
-
|
|
34420
|
+
switch (originalExtension) {
|
|
34421
|
+
case ".mjs":
|
|
34422
|
+
case ".mts":
|
|
34423
|
+
case ".d.mts":
|
|
34424
|
+
return tryExtension(".mjs");
|
|
34425
|
+
case ".cjs":
|
|
34426
|
+
case ".cts":
|
|
34427
|
+
case ".d.cts":
|
|
34428
|
+
return tryExtension(".cjs");
|
|
34429
|
+
case ".json":
|
|
34430
|
+
return tryExtension(".json");
|
|
34431
|
+
default:
|
|
34432
|
+
return tryExtension(".js") || tryExtension(".jsx");
|
|
34433
|
+
}
|
|
34214
34434
|
case Extensions.TSConfig:
|
|
34215
34435
|
case Extensions.Json:
|
|
34216
34436
|
return tryExtension(".json");
|
|
@@ -34244,6 +34464,28 @@ var ts;
|
|
|
34244
34464
|
var versionPaths = packageInfo && packageInfo.versionPaths;
|
|
34245
34465
|
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
34246
34466
|
}
|
|
34467
|
+
function getPackageScopeForPath(fileName, packageJsonInfoCache, host, options) {
|
|
34468
|
+
var state = {
|
|
34469
|
+
host: host,
|
|
34470
|
+
compilerOptions: options,
|
|
34471
|
+
traceEnabled: isTraceEnabled(options, host),
|
|
34472
|
+
failedLookupLocations: [],
|
|
34473
|
+
packageJsonInfoCache: packageJsonInfoCache,
|
|
34474
|
+
features: 0,
|
|
34475
|
+
conditions: [],
|
|
34476
|
+
};
|
|
34477
|
+
var parts = ts.getPathComponents(fileName);
|
|
34478
|
+
parts.pop();
|
|
34479
|
+
while (parts.length > 0) {
|
|
34480
|
+
var pkg = getPackageJsonInfo(ts.getPathFromPathComponents(parts), false, state);
|
|
34481
|
+
if (pkg) {
|
|
34482
|
+
return pkg;
|
|
34483
|
+
}
|
|
34484
|
+
parts.pop();
|
|
34485
|
+
}
|
|
34486
|
+
return undefined;
|
|
34487
|
+
}
|
|
34488
|
+
ts.getPackageScopeForPath = getPackageScopeForPath;
|
|
34247
34489
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
34248
34490
|
var _a, _b, _c;
|
|
34249
34491
|
var host = state.host, traceEnabled = state.traceEnabled;
|
|
@@ -34285,6 +34527,7 @@ var ts;
|
|
|
34285
34527
|
state.failedLookupLocations.push(packageJsonPath);
|
|
34286
34528
|
}
|
|
34287
34529
|
}
|
|
34530
|
+
ts.getPackageJsonInfo = getPackageJsonInfo;
|
|
34288
34531
|
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
|
|
34289
34532
|
var packageFile;
|
|
34290
34533
|
if (jsonContent) {
|
|
@@ -34336,7 +34579,9 @@ var ts;
|
|
|
34336
34579
|
var packageFileResult = packageFile && removeIgnoredPackageId(loader(extensions, packageFile, onlyRecordFailuresForPackageFile, state));
|
|
34337
34580
|
if (packageFileResult)
|
|
34338
34581
|
return packageFileResult;
|
|
34339
|
-
|
|
34582
|
+
if (!(state.features & NodeResolutionFeatures.EsmMode)) {
|
|
34583
|
+
return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
|
|
34584
|
+
}
|
|
34340
34585
|
}
|
|
34341
34586
|
function resolvedIfExtensionMatches(extensions, path) {
|
|
34342
34587
|
var ext = ts.tryGetExtensionFromPath(path);
|
|
@@ -34363,6 +34608,221 @@ var ts;
|
|
|
34363
34608
|
return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };
|
|
34364
34609
|
}
|
|
34365
34610
|
ts.parsePackageName = parsePackageName;
|
|
34611
|
+
function allKeysStartWithDot(obj) {
|
|
34612
|
+
return ts.every(ts.getOwnKeys(obj), function (k) { return ts.startsWith(k, "."); });
|
|
34613
|
+
}
|
|
34614
|
+
function noKeyStartsWithDot(obj) {
|
|
34615
|
+
return !ts.some(ts.getOwnKeys(obj), function (k) { return ts.startsWith(k, "."); });
|
|
34616
|
+
}
|
|
34617
|
+
function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
34618
|
+
var _a, _b;
|
|
34619
|
+
var useCaseSensitiveFileNames = typeof state.host.useCaseSensitiveFileNames === "function" ? state.host.useCaseSensitiveFileNames() : state.host.useCaseSensitiveFileNames;
|
|
34620
|
+
var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
|
34621
|
+
var scope = getPackageScopeForPath(directoryPath, state.packageJsonInfoCache, state.host, state.compilerOptions);
|
|
34622
|
+
if (!scope || !scope.packageJsonContent.exports) {
|
|
34623
|
+
return undefined;
|
|
34624
|
+
}
|
|
34625
|
+
var parts = ts.getPathComponents(moduleName);
|
|
34626
|
+
if (scope.packageJsonContent.name !== parts[1]) {
|
|
34627
|
+
return undefined;
|
|
34628
|
+
}
|
|
34629
|
+
var trailingParts = parts.slice(2);
|
|
34630
|
+
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
34631
|
+
}
|
|
34632
|
+
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
34633
|
+
if (!scope.packageJsonContent.exports) {
|
|
34634
|
+
return undefined;
|
|
34635
|
+
}
|
|
34636
|
+
if (subpath === ".") {
|
|
34637
|
+
var mainExport = void 0;
|
|
34638
|
+
if (typeof scope.packageJsonContent.exports === "string" || Array.isArray(scope.packageJsonContent.exports) || (typeof scope.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.packageJsonContent.exports))) {
|
|
34639
|
+
mainExport = scope.packageJsonContent.exports;
|
|
34640
|
+
}
|
|
34641
|
+
else if (ts.hasProperty(scope.packageJsonContent.exports, ".")) {
|
|
34642
|
+
mainExport = scope.packageJsonContent.exports["."];
|
|
34643
|
+
}
|
|
34644
|
+
if (mainExport) {
|
|
34645
|
+
var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, false);
|
|
34646
|
+
return loadModuleFromTargetImportOrExport(mainExport, "", false);
|
|
34647
|
+
}
|
|
34648
|
+
}
|
|
34649
|
+
else if (allKeysStartWithDot(scope.packageJsonContent.exports)) {
|
|
34650
|
+
if (typeof scope.packageJsonContent.exports !== "object") {
|
|
34651
|
+
if (state.traceEnabled) {
|
|
34652
|
+
trace(state.host, ts.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory);
|
|
34653
|
+
}
|
|
34654
|
+
return toSearchResult(undefined);
|
|
34655
|
+
}
|
|
34656
|
+
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.packageJsonContent.exports, scope, false);
|
|
34657
|
+
if (result) {
|
|
34658
|
+
return result;
|
|
34659
|
+
}
|
|
34660
|
+
}
|
|
34661
|
+
if (state.traceEnabled) {
|
|
34662
|
+
trace(state.host, ts.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory);
|
|
34663
|
+
}
|
|
34664
|
+
return toSearchResult(undefined);
|
|
34665
|
+
}
|
|
34666
|
+
function loadModuleFromImports(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
34667
|
+
var _a, _b;
|
|
34668
|
+
if (moduleName === "#" || ts.startsWith(moduleName, "#/")) {
|
|
34669
|
+
if (state.traceEnabled) {
|
|
34670
|
+
trace(state.host, ts.Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName);
|
|
34671
|
+
}
|
|
34672
|
+
return toSearchResult(undefined);
|
|
34673
|
+
}
|
|
34674
|
+
var useCaseSensitiveFileNames = typeof state.host.useCaseSensitiveFileNames === "function" ? state.host.useCaseSensitiveFileNames() : state.host.useCaseSensitiveFileNames;
|
|
34675
|
+
var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
|
34676
|
+
var scope = getPackageScopeForPath(directoryPath, state.packageJsonInfoCache, state.host, state.compilerOptions);
|
|
34677
|
+
if (!scope) {
|
|
34678
|
+
if (state.traceEnabled) {
|
|
34679
|
+
trace(state.host, ts.Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath);
|
|
34680
|
+
}
|
|
34681
|
+
return toSearchResult(undefined);
|
|
34682
|
+
}
|
|
34683
|
+
if (!scope.packageJsonContent.imports) {
|
|
34684
|
+
if (state.traceEnabled) {
|
|
34685
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory);
|
|
34686
|
+
}
|
|
34687
|
+
return toSearchResult(undefined);
|
|
34688
|
+
}
|
|
34689
|
+
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.packageJsonContent.imports, scope, true);
|
|
34690
|
+
if (result) {
|
|
34691
|
+
return result;
|
|
34692
|
+
}
|
|
34693
|
+
if (state.traceEnabled) {
|
|
34694
|
+
trace(state.host, ts.Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, moduleName, scope.packageDirectory);
|
|
34695
|
+
}
|
|
34696
|
+
return toSearchResult(undefined);
|
|
34697
|
+
}
|
|
34698
|
+
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
34699
|
+
var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
34700
|
+
if (!ts.endsWith(moduleName, ts.directorySeparator) && moduleName.indexOf("*") === -1 && ts.hasProperty(lookupTable, moduleName)) {
|
|
34701
|
+
var target = lookupTable[moduleName];
|
|
34702
|
+
return loadModuleFromTargetImportOrExport(target, "", false);
|
|
34703
|
+
}
|
|
34704
|
+
var expandingKeys = ts.sort(ts.filter(ts.getOwnKeys(lookupTable), function (k) { return k.indexOf("*") !== -1 || ts.endsWith(k, "/"); }), function (a, b) { return a.length - b.length; });
|
|
34705
|
+
for (var _i = 0, expandingKeys_1 = expandingKeys; _i < expandingKeys_1.length; _i++) {
|
|
34706
|
+
var potentialTarget = expandingKeys_1[_i];
|
|
34707
|
+
if (state.features & NodeResolutionFeatures.ExportsPatternTrailers && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
34708
|
+
var target = lookupTable[potentialTarget];
|
|
34709
|
+
var starPos = potentialTarget.indexOf("*");
|
|
34710
|
+
var subpath = moduleName.substring(potentialTarget.substring(0, starPos).length, moduleName.length - (potentialTarget.length - 1 - starPos));
|
|
34711
|
+
return loadModuleFromTargetImportOrExport(target, subpath, true);
|
|
34712
|
+
}
|
|
34713
|
+
else if (ts.endsWith(potentialTarget, "*") && ts.startsWith(moduleName, potentialTarget.substring(0, potentialTarget.length - 1))) {
|
|
34714
|
+
var target = lookupTable[potentialTarget];
|
|
34715
|
+
var subpath = moduleName.substring(potentialTarget.length - 1);
|
|
34716
|
+
return loadModuleFromTargetImportOrExport(target, subpath, true);
|
|
34717
|
+
}
|
|
34718
|
+
else if (ts.startsWith(moduleName, potentialTarget)) {
|
|
34719
|
+
var target = lookupTable[potentialTarget];
|
|
34720
|
+
var subpath = moduleName.substring(potentialTarget.length);
|
|
34721
|
+
return loadModuleFromTargetImportOrExport(target, subpath, false);
|
|
34722
|
+
}
|
|
34723
|
+
}
|
|
34724
|
+
function matchesPatternWithTrailer(target, name) {
|
|
34725
|
+
if (ts.endsWith(target, "*"))
|
|
34726
|
+
return false;
|
|
34727
|
+
var starPos = target.indexOf("*");
|
|
34728
|
+
if (starPos === -1)
|
|
34729
|
+
return false;
|
|
34730
|
+
return ts.startsWith(name, target.substring(0, starPos)) && ts.endsWith(name, target.substring(starPos + 1));
|
|
34731
|
+
}
|
|
34732
|
+
}
|
|
34733
|
+
function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
|
|
34734
|
+
return loadModuleFromTargetImportOrExport;
|
|
34735
|
+
function loadModuleFromTargetImportOrExport(target, subpath, pattern) {
|
|
34736
|
+
var _a, _b;
|
|
34737
|
+
if (typeof target === "string") {
|
|
34738
|
+
if (!pattern && subpath.length > 0 && !ts.endsWith(target, "/")) {
|
|
34739
|
+
if (state.traceEnabled) {
|
|
34740
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
34741
|
+
}
|
|
34742
|
+
return toSearchResult(undefined);
|
|
34743
|
+
}
|
|
34744
|
+
if (!ts.startsWith(target, "./")) {
|
|
34745
|
+
if (isImports && !ts.startsWith(target, "../") && !ts.startsWith(target, "/") && !ts.isRootedDiskPath(target)) {
|
|
34746
|
+
var combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath;
|
|
34747
|
+
var result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions], redirectedReference);
|
|
34748
|
+
return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : undefined);
|
|
34749
|
+
}
|
|
34750
|
+
if (state.traceEnabled) {
|
|
34751
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
34752
|
+
}
|
|
34753
|
+
return toSearchResult(undefined);
|
|
34754
|
+
}
|
|
34755
|
+
var parts = ts.pathIsRelative(target) ? ts.getPathComponents(target).slice(1) : ts.getPathComponents(target);
|
|
34756
|
+
var partsAfterFirst = parts.slice(1);
|
|
34757
|
+
if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
|
|
34758
|
+
if (state.traceEnabled) {
|
|
34759
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
34760
|
+
}
|
|
34761
|
+
return toSearchResult(undefined);
|
|
34762
|
+
}
|
|
34763
|
+
var resolvedTarget = ts.combinePaths(scope.packageDirectory, target);
|
|
34764
|
+
var subpathParts = ts.getPathComponents(subpath);
|
|
34765
|
+
if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) {
|
|
34766
|
+
if (state.traceEnabled) {
|
|
34767
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
34768
|
+
}
|
|
34769
|
+
return toSearchResult(undefined);
|
|
34770
|
+
}
|
|
34771
|
+
var finalPath = ts.getNormalizedAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
34772
|
+
return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state)));
|
|
34773
|
+
}
|
|
34774
|
+
else if (typeof target === "object" && target !== null) {
|
|
34775
|
+
if (!Array.isArray(target)) {
|
|
34776
|
+
for (var _i = 0, _c = ts.getOwnKeys(target); _i < _c.length; _i++) {
|
|
34777
|
+
var key = _c[_i];
|
|
34778
|
+
if (key === "default" || state.conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(state.conditions, key)) {
|
|
34779
|
+
var subTarget = target[key];
|
|
34780
|
+
var result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern);
|
|
34781
|
+
if (result) {
|
|
34782
|
+
return result;
|
|
34783
|
+
}
|
|
34784
|
+
}
|
|
34785
|
+
}
|
|
34786
|
+
return undefined;
|
|
34787
|
+
}
|
|
34788
|
+
else {
|
|
34789
|
+
if (!ts.length(target)) {
|
|
34790
|
+
if (state.traceEnabled) {
|
|
34791
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
34792
|
+
}
|
|
34793
|
+
return toSearchResult(undefined);
|
|
34794
|
+
}
|
|
34795
|
+
for (var _d = 0, target_1 = target; _d < target_1.length; _d++) {
|
|
34796
|
+
var elem = target_1[_d];
|
|
34797
|
+
var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
|
|
34798
|
+
if (result) {
|
|
34799
|
+
return result;
|
|
34800
|
+
}
|
|
34801
|
+
}
|
|
34802
|
+
}
|
|
34803
|
+
}
|
|
34804
|
+
else if (target === null) {
|
|
34805
|
+
if (state.traceEnabled) {
|
|
34806
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.packageDirectory, moduleName);
|
|
34807
|
+
}
|
|
34808
|
+
return toSearchResult(undefined);
|
|
34809
|
+
}
|
|
34810
|
+
if (state.traceEnabled) {
|
|
34811
|
+
trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
34812
|
+
}
|
|
34813
|
+
return toSearchResult(undefined);
|
|
34814
|
+
}
|
|
34815
|
+
function isApplicableVersionedTypesKey(conditions, key) {
|
|
34816
|
+
if (conditions.indexOf("types") === -1)
|
|
34817
|
+
return false;
|
|
34818
|
+
if (!ts.startsWith(key, "types@"))
|
|
34819
|
+
return false;
|
|
34820
|
+
var range = ts.VersionRange.tryParse(key.substring("types@".length));
|
|
34821
|
+
if (!range)
|
|
34822
|
+
return false;
|
|
34823
|
+
return range.test(ts.version);
|
|
34824
|
+
}
|
|
34825
|
+
}
|
|
34366
34826
|
function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
34367
34827
|
return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, false, cache, redirectedReference);
|
|
34368
34828
|
}
|
|
@@ -34370,24 +34830,24 @@ var ts;
|
|
|
34370
34830
|
return loadModuleFromNearestNodeModulesDirectoryWorker(Extensions.DtsOnly, moduleName, directory, state, true, undefined, undefined);
|
|
34371
34831
|
}
|
|
34372
34832
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34373
|
-
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);
|
|
34833
|
+
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? undefined : state.features & NodeResolutionFeatures.EsmMode ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS, redirectedReference);
|
|
34374
34834
|
return ts.forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) {
|
|
34375
34835
|
if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
34376
34836
|
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
|
|
34377
34837
|
if (resolutionFromCache) {
|
|
34378
34838
|
return resolutionFromCache;
|
|
34379
34839
|
}
|
|
34380
|
-
return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly));
|
|
34840
|
+
return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
|
|
34381
34841
|
}
|
|
34382
34842
|
});
|
|
34383
34843
|
}
|
|
34384
|
-
function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly) {
|
|
34844
|
+
function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34385
34845
|
var nodeModulesFolder = ts.combinePaths(directory, "node_modules");
|
|
34386
34846
|
var nodeModulesFolderExists = ts.directoryProbablyExists(nodeModulesFolder, state.host);
|
|
34387
34847
|
if (!nodeModulesFolderExists && state.traceEnabled) {
|
|
34388
34848
|
trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder);
|
|
34389
34849
|
}
|
|
34390
|
-
var packageResult = typesScopeOnly ? undefined : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state);
|
|
34850
|
+
var packageResult = typesScopeOnly ? undefined : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference);
|
|
34391
34851
|
if (packageResult) {
|
|
34392
34852
|
return packageResult;
|
|
34393
34853
|
}
|
|
@@ -34400,26 +34860,32 @@ var ts;
|
|
|
34400
34860
|
}
|
|
34401
34861
|
nodeModulesAtTypesExists = false;
|
|
34402
34862
|
}
|
|
34403
|
-
return loadModuleFromSpecificNodeModulesDirectory(Extensions.DtsOnly, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, state);
|
|
34863
|
+
return loadModuleFromSpecificNodeModulesDirectory(Extensions.DtsOnly, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, state, cache, redirectedReference);
|
|
34404
34864
|
}
|
|
34405
34865
|
}
|
|
34406
|
-
function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state) {
|
|
34866
|
+
function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
|
|
34407
34867
|
var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
|
|
34408
34868
|
var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
|
|
34409
|
-
if (
|
|
34410
|
-
|
|
34411
|
-
|
|
34412
|
-
|
|
34869
|
+
if (!(state.features & NodeResolutionFeatures.Exports)) {
|
|
34870
|
+
if (packageInfo) {
|
|
34871
|
+
var fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state);
|
|
34872
|
+
if (fromFile) {
|
|
34873
|
+
return noPackageId(fromFile);
|
|
34874
|
+
}
|
|
34875
|
+
var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths);
|
|
34876
|
+
return withPackageId(packageInfo, fromDirectory);
|
|
34413
34877
|
}
|
|
34414
|
-
var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths);
|
|
34415
|
-
return withPackageId(packageInfo, fromDirectory);
|
|
34416
34878
|
}
|
|
34879
|
+
var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
|
|
34417
34880
|
var loader = function (extensions, candidate, onlyRecordFailures, state) {
|
|
34881
|
+
var _a;
|
|
34882
|
+
if (packageInfo && packageInfo.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
34883
|
+
return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
34884
|
+
}
|
|
34418
34885
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
34419
34886
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
34420
34887
|
return withPackageId(packageInfo, pathAndExtension);
|
|
34421
34888
|
};
|
|
34422
|
-
var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
|
|
34423
34889
|
if (rest !== "") {
|
|
34424
34890
|
var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
|
|
34425
34891
|
packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -34512,7 +34978,7 @@ var ts;
|
|
|
34512
34978
|
function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
34513
34979
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
34514
34980
|
var failedLookupLocations = [];
|
|
34515
|
-
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache };
|
|
34981
|
+
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [] };
|
|
34516
34982
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
34517
34983
|
var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript);
|
|
34518
34984
|
return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations, state.resultFromCache);
|
|
@@ -34522,7 +34988,7 @@ var ts;
|
|
|
34522
34988
|
return { value: resolvedUsingSettings };
|
|
34523
34989
|
}
|
|
34524
34990
|
if (!ts.isExternalModuleNameRelative(moduleName)) {
|
|
34525
|
-
var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);
|
|
34991
|
+
var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName(moduleName, undefined, redirectedReference);
|
|
34526
34992
|
var resolved_3 = ts.forEachAncestorDirectory(containingDirectory, function (directory) {
|
|
34527
34993
|
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache_1, moduleName, directory, state);
|
|
34528
34994
|
if (resolutionFromCache) {
|
|
@@ -34551,8 +35017,8 @@ var ts;
|
|
|
34551
35017
|
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);
|
|
34552
35018
|
}
|
|
34553
35019
|
var failedLookupLocations = [];
|
|
34554
|
-
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: packageJsonInfoCache };
|
|
34555
|
-
var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, false);
|
|
35020
|
+
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: packageJsonInfoCache, features: NodeResolutionFeatures.None, conditions: [] };
|
|
35021
|
+
var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, false, undefined, undefined);
|
|
34556
35022
|
return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations, state.resultFromCache);
|
|
34557
35023
|
}
|
|
34558
35024
|
ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache;
|
|
@@ -36405,7 +36871,7 @@ var ts;
|
|
|
36405
36871
|
}
|
|
36406
36872
|
}
|
|
36407
36873
|
function checkStrictModeLabeledStatement(node) {
|
|
36408
|
-
if (inStrictMode && options
|
|
36874
|
+
if (inStrictMode && ts.getEmitScriptTarget(options) >= 2) {
|
|
36409
36875
|
if (ts.isDeclarationStatement(node.statement) || ts.isVariableStatement(node.statement)) {
|
|
36410
36876
|
errorOnFirstToken(node.label, ts.Diagnostics.A_label_is_not_allowed_here);
|
|
36411
36877
|
}
|
|
@@ -37563,7 +38029,7 @@ var ts;
|
|
|
37563
38029
|
host.getSourceFiles().forEach(function (sf) {
|
|
37564
38030
|
if (!sf.resolvedModules)
|
|
37565
38031
|
return;
|
|
37566
|
-
|
|
38032
|
+
sf.resolvedModules.forEach(function (r) {
|
|
37567
38033
|
if (r && r.packageId)
|
|
37568
38034
|
map.set(r.packageId.name, r.extension === ".d.ts" || !!map.get(r.packageId.name));
|
|
37569
38035
|
});
|
|
@@ -37959,10 +38425,13 @@ var ts;
|
|
|
37959
38425
|
var undefinedProperties = new ts.Map();
|
|
37960
38426
|
var unknownSymbol = createSymbol(4, "unknown");
|
|
37961
38427
|
var resolvingSymbol = createSymbol(0, "__resolving__");
|
|
38428
|
+
var unresolvedSymbols = new ts.Map();
|
|
38429
|
+
var errorTypes = new ts.Map();
|
|
37962
38430
|
var anyType = createIntrinsicType(1, "any");
|
|
37963
38431
|
var autoType = createIntrinsicType(1, "any");
|
|
37964
38432
|
var wildcardType = createIntrinsicType(1, "any");
|
|
37965
38433
|
var errorType = createIntrinsicType(1, "error");
|
|
38434
|
+
var unresolvedType = createIntrinsicType(1, "unresolved");
|
|
37966
38435
|
var nonInferrableAnyType = createIntrinsicType(1, "any", 131072);
|
|
37967
38436
|
var intrinsicMarkerType = createIntrinsicType(1, "intrinsic");
|
|
37968
38437
|
var unknownType = createIntrinsicType(2, "unknown");
|
|
@@ -38623,7 +39092,7 @@ var ts;
|
|
|
38623
39092
|
return !isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage, false);
|
|
38624
39093
|
}
|
|
38625
39094
|
else if (ts.isParameterPropertyDeclaration(declaration, declaration.parent)) {
|
|
38626
|
-
return !(compilerOptions
|
|
39095
|
+
return !(ts.getEmitScriptTarget(compilerOptions) === 99 && useDefineForClassFields
|
|
38627
39096
|
&& ts.getContainingClass(declaration) === ts.getContainingClass(usage)
|
|
38628
39097
|
&& isUsedInFunctionOrInstanceProperty(usage, declaration));
|
|
38629
39098
|
}
|
|
@@ -38639,7 +39108,7 @@ var ts;
|
|
|
38639
39108
|
return true;
|
|
38640
39109
|
}
|
|
38641
39110
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
38642
|
-
if (compilerOptions
|
|
39111
|
+
if (ts.getEmitScriptTarget(compilerOptions) === 99 && useDefineForClassFields
|
|
38643
39112
|
&& ts.getContainingClass(declaration)
|
|
38644
39113
|
&& (ts.isPropertyDeclaration(declaration) || ts.isParameterPropertyDeclaration(declaration, declaration.parent))) {
|
|
38645
39114
|
return !isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage, true);
|
|
@@ -38794,7 +39263,7 @@ var ts;
|
|
|
38794
39263
|
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, issueSuggestions);
|
|
38795
39264
|
}
|
|
38796
39265
|
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, issueSuggestions) {
|
|
38797
|
-
var _a;
|
|
39266
|
+
var _a, _b, _c;
|
|
38798
39267
|
var originalLocation = location;
|
|
38799
39268
|
var result;
|
|
38800
39269
|
var lastLocation;
|
|
@@ -38847,7 +39316,7 @@ var ts;
|
|
|
38847
39316
|
break;
|
|
38848
39317
|
isInExternalModule = true;
|
|
38849
39318
|
case 260:
|
|
38850
|
-
var moduleExports = getSymbolOfNode(location).exports || emptySymbols;
|
|
39319
|
+
var moduleExports = ((_a = getSymbolOfNode(location)) === null || _a === void 0 ? void 0 : _a.exports) || emptySymbols;
|
|
38851
39320
|
if (location.kind === 303 || (ts.isModuleDeclaration(location) && location.flags & 8388608 && !ts.isGlobalScopeAugmentation(location))) {
|
|
38852
39321
|
if (result = moduleExports.get("default")) {
|
|
38853
39322
|
var localSymbol = ts.getLocalSymbolForExportDefault(result);
|
|
@@ -38864,7 +39333,7 @@ var ts;
|
|
|
38864
39333
|
}
|
|
38865
39334
|
}
|
|
38866
39335
|
if (name !== "default" && (result = lookup(moduleExports, name, meaning & 2623475))) {
|
|
38867
|
-
if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !((
|
|
39336
|
+
if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !((_b = result.declarations) === null || _b === void 0 ? void 0 : _b.some(ts.isJSDocTypeAlias))) {
|
|
38868
39337
|
result = undefined;
|
|
38869
39338
|
}
|
|
38870
39339
|
else {
|
|
@@ -38873,7 +39342,7 @@ var ts;
|
|
|
38873
39342
|
}
|
|
38874
39343
|
break;
|
|
38875
39344
|
case 259:
|
|
38876
|
-
if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) {
|
|
39345
|
+
if (result = lookup(((_c = getSymbolOfNode(location)) === null || _c === void 0 ? void 0 : _c.exports) || emptySymbols, name, meaning & 8)) {
|
|
38877
39346
|
break loop;
|
|
38878
39347
|
}
|
|
38879
39348
|
break;
|
|
@@ -38930,7 +39399,7 @@ var ts;
|
|
|
38930
39399
|
}
|
|
38931
39400
|
break;
|
|
38932
39401
|
case 213:
|
|
38933
|
-
if (compilerOptions
|
|
39402
|
+
if (ts.getEmitScriptTarget(compilerOptions) >= 2) {
|
|
38934
39403
|
break;
|
|
38935
39404
|
}
|
|
38936
39405
|
case 168:
|
|
@@ -39072,7 +39541,7 @@ var ts;
|
|
|
39072
39541
|
return undefined;
|
|
39073
39542
|
}
|
|
39074
39543
|
if (nameNotFoundMessage) {
|
|
39075
|
-
if (propertyWithInvalidInitializer && !(compilerOptions
|
|
39544
|
+
if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 && useDefineForClassFields)) {
|
|
39076
39545
|
var propertyName = propertyWithInvalidInitializer.name;
|
|
39077
39546
|
error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), diagnosticName(nameArg));
|
|
39078
39547
|
return undefined;
|
|
@@ -39569,7 +40038,7 @@ var ts;
|
|
|
39569
40038
|
if (!ts.isIdentifier(name)) {
|
|
39570
40039
|
return undefined;
|
|
39571
40040
|
}
|
|
39572
|
-
var suppressInteropError = name.escapedText === "default" && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions
|
|
40041
|
+
var suppressInteropError = name.escapedText === "default" && !!(compilerOptions.allowSyntheticDefaultImports || ts.getESModuleInterop(compilerOptions));
|
|
39573
40042
|
var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, false, suppressInteropError);
|
|
39574
40043
|
if (targetSymbol) {
|
|
39575
40044
|
if (name.escapedText) {
|
|
@@ -39645,18 +40114,18 @@ var ts;
|
|
|
39645
40114
|
}
|
|
39646
40115
|
function reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) {
|
|
39647
40116
|
if (moduleKind >= ts.ModuleKind.ES2015) {
|
|
39648
|
-
var message = compilerOptions
|
|
40117
|
+
var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_a_default_import :
|
|
39649
40118
|
ts.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
|
|
39650
40119
|
error(name, message, declarationName);
|
|
39651
40120
|
}
|
|
39652
40121
|
else {
|
|
39653
40122
|
if (ts.isInJSFile(node)) {
|
|
39654
|
-
var message = compilerOptions
|
|
40123
|
+
var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import :
|
|
39655
40124
|
ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
|
|
39656
40125
|
error(name, message, declarationName);
|
|
39657
40126
|
}
|
|
39658
40127
|
else {
|
|
39659
|
-
var message = compilerOptions
|
|
40128
|
+
var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import :
|
|
39660
40129
|
ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
|
|
39661
40130
|
error(name, message, declarationName, declarationName, moduleName);
|
|
39662
40131
|
}
|
|
@@ -40034,6 +40503,7 @@ var ts;
|
|
|
40034
40503
|
: undefined;
|
|
40035
40504
|
}
|
|
40036
40505
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
|
|
40506
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40037
40507
|
if (isForAugmentation === void 0) { isForAugmentation = false; }
|
|
40038
40508
|
if (ts.startsWith(moduleReference, "@types/")) {
|
|
40039
40509
|
var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
@@ -40045,7 +40515,15 @@ var ts;
|
|
|
40045
40515
|
return ambientModule;
|
|
40046
40516
|
}
|
|
40047
40517
|
var currentSourceFile = ts.getSourceFileOfNode(location);
|
|
40048
|
-
var
|
|
40518
|
+
var contextSpecifier = ts.isStringLiteralLike(location)
|
|
40519
|
+
? location
|
|
40520
|
+
: ((_a = ts.findAncestor(location, ts.isImportCall)) === null || _a === void 0 ? void 0 : _a.arguments[0]) ||
|
|
40521
|
+
((_b = ts.findAncestor(location, ts.isImportDeclaration)) === null || _b === void 0 ? void 0 : _b.moduleSpecifier) ||
|
|
40522
|
+
((_c = ts.findAncestor(location, ts.isExternalModuleImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.moduleReference.expression) ||
|
|
40523
|
+
((_d = ts.findAncestor(location, ts.isExportDeclaration)) === null || _d === void 0 ? void 0 : _d.moduleSpecifier) ||
|
|
40524
|
+
((_e = (ts.isModuleDeclaration(location) ? location : location.parent && ts.isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)) === null || _e === void 0 ? void 0 : _e.name) ||
|
|
40525
|
+
((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
|
|
40526
|
+
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : undefined);
|
|
40049
40527
|
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
40050
40528
|
var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
40051
40529
|
if (sourceFile) {
|
|
@@ -40053,6 +40531,12 @@ var ts;
|
|
|
40053
40531
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
40054
40532
|
errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference);
|
|
40055
40533
|
}
|
|
40534
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
40535
|
+
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
40536
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
|
|
40537
|
+
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);
|
|
40538
|
+
}
|
|
40539
|
+
}
|
|
40056
40540
|
return getMergedSymbol(sourceFile.symbol);
|
|
40057
40541
|
}
|
|
40058
40542
|
if (moduleNotFoundError) {
|
|
@@ -40097,15 +40581,14 @@ var ts;
|
|
|
40097
40581
|
var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
|
|
40098
40582
|
var importSourceWithoutExtension = ts.removeExtension(moduleReference, tsExtension);
|
|
40099
40583
|
var replacedImportSource = importSourceWithoutExtension;
|
|
40100
|
-
|
|
40101
|
-
|
|
40102
|
-
replacedImportSource += ".js";
|
|
40584
|
+
if (moduleKind >= ts.ModuleKind.ES2015) {
|
|
40585
|
+
replacedImportSource += tsExtension === ".mts" ? ".mjs" : tsExtension === ".cts" ? ".cjs" : ".js";
|
|
40103
40586
|
}
|
|
40104
40587
|
error(errorNode, diag, tsExtension, replacedImportSource);
|
|
40105
40588
|
}
|
|
40106
40589
|
else if (!compilerOptions.resolveJsonModule &&
|
|
40107
40590
|
ts.fileExtensionIs(moduleReference, ".json") &&
|
|
40108
|
-
ts.getEmitModuleResolutionKind(compilerOptions)
|
|
40591
|
+
ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic &&
|
|
40109
40592
|
ts.hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
40110
40593
|
error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
40111
40594
|
}
|
|
@@ -40172,7 +40655,7 @@ var ts;
|
|
|
40172
40655
|
error(referencingLocation, ts.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
|
|
40173
40656
|
return symbol;
|
|
40174
40657
|
}
|
|
40175
|
-
if (compilerOptions
|
|
40658
|
+
if (ts.getESModuleInterop(compilerOptions)) {
|
|
40176
40659
|
var referenceParent = referencingLocation.parent;
|
|
40177
40660
|
if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||
|
|
40178
40661
|
ts.isImportCall(referenceParent)) {
|
|
@@ -40942,7 +41425,7 @@ var ts;
|
|
|
40942
41425
|
var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | (noTruncation ? 1 : 0), writer);
|
|
40943
41426
|
if (typeNode === undefined)
|
|
40944
41427
|
return ts.Debug.fail("should always get typenode");
|
|
40945
|
-
var options = { removeComments:
|
|
41428
|
+
var options = { removeComments: type !== unresolvedType };
|
|
40946
41429
|
var printer = ts.createPrinter(options);
|
|
40947
41430
|
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
40948
41431
|
printer.writeNode(4, typeNode, sourceFile, writer);
|
|
@@ -41021,6 +41504,7 @@ var ts;
|
|
|
41021
41504
|
isSourceOfProjectReferenceRedirect: function (fileName) { return host.isSourceOfProjectReferenceRedirect(fileName); },
|
|
41022
41505
|
fileExists: function (fileName) { return host.fileExists(fileName); },
|
|
41023
41506
|
getFileIncludeReasons: function () { return host.getFileIncludeReasons(); },
|
|
41507
|
+
readFile: host.readFile ? (function (fileName) { return host.readFile(fileName); }) : undefined,
|
|
41024
41508
|
} : undefined },
|
|
41025
41509
|
encounteredError: false,
|
|
41026
41510
|
reportedDiagnostic: false,
|
|
@@ -41086,6 +41570,12 @@ var ts;
|
|
|
41086
41570
|
type = getReducedType(type);
|
|
41087
41571
|
}
|
|
41088
41572
|
if (type.flags & 1) {
|
|
41573
|
+
if (type.aliasSymbol) {
|
|
41574
|
+
return ts.factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
41575
|
+
}
|
|
41576
|
+
if (type === unresolvedType) {
|
|
41577
|
+
return ts.addSyntheticLeadingComment(ts.factory.createKeywordTypeNode(130), 3, "unresolved");
|
|
41578
|
+
}
|
|
41089
41579
|
context.approximateLength += 3;
|
|
41090
41580
|
return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 138 : 130);
|
|
41091
41581
|
}
|
|
@@ -42101,6 +42591,10 @@ var ts;
|
|
|
42101
42591
|
}
|
|
42102
42592
|
return specifier;
|
|
42103
42593
|
}
|
|
42594
|
+
function symbolToEntityNameNode(symbol) {
|
|
42595
|
+
var identifier = ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(symbol.escapedName));
|
|
42596
|
+
return symbol.parent ? ts.factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
42597
|
+
}
|
|
42104
42598
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
42105
42599
|
var chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384));
|
|
42106
42600
|
var isTypeOf = meaning === 111551;
|
|
@@ -42108,7 +42602,7 @@ var ts;
|
|
|
42108
42602
|
var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined;
|
|
42109
42603
|
var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context);
|
|
42110
42604
|
var specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
42111
|
-
if (!(context.flags & 67108864) && ts.getEmitModuleResolutionKind(compilerOptions)
|
|
42605
|
+
if (!(context.flags & 67108864) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
|
|
42112
42606
|
context.encounteredError = true;
|
|
42113
42607
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
42114
42608
|
context.tracker.reportLikelyUnsafeImportRequiredError(specifier);
|
|
@@ -42325,7 +42819,7 @@ var ts;
|
|
|
42325
42819
|
if (nameType) {
|
|
42326
42820
|
if (nameType.flags & 384) {
|
|
42327
42821
|
var name = "" + nameType.value;
|
|
42328
|
-
if (!ts.isIdentifierText(name, compilerOptions
|
|
42822
|
+
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
42329
42823
|
return ts.factory.createStringLiteral(name, !!singleQuote);
|
|
42330
42824
|
}
|
|
42331
42825
|
if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
@@ -42339,7 +42833,7 @@ var ts;
|
|
|
42339
42833
|
}
|
|
42340
42834
|
}
|
|
42341
42835
|
function createPropertyNameNodeForIdentifierOrLiteral(name, stringNamed, singleQuote) {
|
|
42342
|
-
return ts.isIdentifierText(name, compilerOptions
|
|
42836
|
+
return ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) ? ts.factory.createIdentifier(name) :
|
|
42343
42837
|
!stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
|
|
42344
42838
|
ts.factory.createStringLiteral(name, !!singleQuote);
|
|
42345
42839
|
}
|
|
@@ -42364,7 +42858,7 @@ var ts;
|
|
|
42364
42858
|
return !(ts.getObjectFlags(type) & 4) || !ts.isTypeReferenceNode(existing) || ts.length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
42365
42859
|
}
|
|
42366
42860
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
42367
|
-
if (type
|
|
42861
|
+
if (!isErrorType(type) && enclosingDeclaration) {
|
|
42368
42862
|
var declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
42369
42863
|
if (declWithExistingAnnotation && !ts.isFunctionLikeDeclaration(declWithExistingAnnotation) && !ts.isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
42370
42864
|
var existing = ts.getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
@@ -42386,7 +42880,7 @@ var ts;
|
|
|
42386
42880
|
return result;
|
|
42387
42881
|
}
|
|
42388
42882
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
42389
|
-
if (type
|
|
42883
|
+
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
42390
42884
|
var annotation = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
|
|
42391
42885
|
if (!!ts.findAncestor(annotation, function (n) { return n === context.enclosingDeclaration; }) && annotation) {
|
|
42392
42886
|
var annotated = getTypeFromTypeNode(annotation);
|
|
@@ -42479,7 +42973,7 @@ var ts;
|
|
|
42479
42973
|
return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(undefined, undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols), undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(130));
|
|
42480
42974
|
}
|
|
42481
42975
|
}
|
|
42482
|
-
if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(
|
|
42976
|
+
if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(node, 788968, true))) {
|
|
42483
42977
|
return ts.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
|
|
42484
42978
|
}
|
|
42485
42979
|
if (ts.isLiteralImportTypeNode(node)) {
|
|
@@ -43081,6 +43575,26 @@ var ts;
|
|
|
43081
43575
|
context.enclosingDeclaration = oldEnclosing;
|
|
43082
43576
|
addResult(ts.setTextRange(ts.factory.createClassDeclaration(undefined, undefined, localName, typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures, true), staticMembers, true), constructors, true), publicProperties, true), privateProperties, true)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags);
|
|
43083
43577
|
}
|
|
43578
|
+
function getSomeTargetNameFromDeclarations(declarations) {
|
|
43579
|
+
return ts.firstDefined(declarations, function (d) {
|
|
43580
|
+
if (ts.isImportSpecifier(d) || ts.isExportSpecifier(d)) {
|
|
43581
|
+
return ts.idText(d.propertyName || d.name);
|
|
43582
|
+
}
|
|
43583
|
+
if (ts.isBinaryExpression(d) || ts.isExportAssignment(d)) {
|
|
43584
|
+
var expression = ts.isExportAssignment(d) ? d.expression : d.right;
|
|
43585
|
+
if (ts.isPropertyAccessExpression(expression)) {
|
|
43586
|
+
return ts.idText(expression.name);
|
|
43587
|
+
}
|
|
43588
|
+
}
|
|
43589
|
+
if (isAliasSymbolDeclaration(d)) {
|
|
43590
|
+
var name = ts.getNameOfDeclaration(d);
|
|
43591
|
+
if (name && ts.isIdentifier(name)) {
|
|
43592
|
+
return ts.idText(name);
|
|
43593
|
+
}
|
|
43594
|
+
}
|
|
43595
|
+
return undefined;
|
|
43596
|
+
});
|
|
43597
|
+
}
|
|
43084
43598
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
43085
43599
|
var _a, _b, _c, _d, _e;
|
|
43086
43600
|
var node = getDeclarationOfAliasSymbol(symbol);
|
|
@@ -43090,8 +43604,8 @@ var ts;
|
|
|
43090
43604
|
if (!target) {
|
|
43091
43605
|
return;
|
|
43092
43606
|
}
|
|
43093
|
-
var verbatimTargetName = ts.unescapeLeadingUnderscores(target.escapedName);
|
|
43094
|
-
if (verbatimTargetName === "export=" && (compilerOptions
|
|
43607
|
+
var verbatimTargetName = ts.isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || ts.unescapeLeadingUnderscores(target.escapedName);
|
|
43608
|
+
if (verbatimTargetName === "export=" && (ts.getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) {
|
|
43095
43609
|
verbatimTargetName = "default";
|
|
43096
43610
|
}
|
|
43097
43611
|
var targetName = getInternalSymbolName(target, verbatimTargetName);
|
|
@@ -43518,7 +44032,7 @@ var ts;
|
|
|
43518
44032
|
if (nameType) {
|
|
43519
44033
|
if (nameType.flags & 384) {
|
|
43520
44034
|
var name = "" + nameType.value;
|
|
43521
|
-
if (!ts.isIdentifierText(name, compilerOptions
|
|
44035
|
+
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
43522
44036
|
return "\"" + ts.escapeString(name, 34) + "\"";
|
|
43523
44037
|
}
|
|
43524
44038
|
if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
@@ -43774,6 +44288,9 @@ var ts;
|
|
|
43774
44288
|
function isTypeAny(type) {
|
|
43775
44289
|
return type && (type.flags & 1) !== 0;
|
|
43776
44290
|
}
|
|
44291
|
+
function isErrorType(type) {
|
|
44292
|
+
return type === errorType || !!(type.flags & 1 && type.aliasSymbol);
|
|
44293
|
+
}
|
|
43777
44294
|
function getTypeForBindingElementParent(node) {
|
|
43778
44295
|
var symbol = getSymbolOfNode(node);
|
|
43779
44296
|
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
|
|
@@ -44230,7 +44747,7 @@ var ts;
|
|
|
44230
44747
|
if (!declaredType) {
|
|
44231
44748
|
return type;
|
|
44232
44749
|
}
|
|
44233
|
-
else if (declaredType
|
|
44750
|
+
else if (!isErrorType(declaredType) && !isErrorType(type) && !isTypeIdenticalTo(declaredType, type)) {
|
|
44234
44751
|
errorNextVariableOrPropertyDeclarationMustHaveSameType(undefined, declaredType, declaration, type);
|
|
44235
44752
|
}
|
|
44236
44753
|
}
|
|
@@ -45023,7 +45540,7 @@ var ts;
|
|
|
45023
45540
|
for (var _b = 0, implementsTypeNodes_1 = implementsTypeNodes; _b < implementsTypeNodes_1.length; _b++) {
|
|
45024
45541
|
var node = implementsTypeNodes_1[_b];
|
|
45025
45542
|
var implementsType = getTypeFromTypeNode(node);
|
|
45026
|
-
if (implementsType
|
|
45543
|
+
if (!isErrorType(implementsType)) {
|
|
45027
45544
|
if (resolvedImplementsTypes === ts.emptyArray) {
|
|
45028
45545
|
resolvedImplementsTypes = [implementsType];
|
|
45029
45546
|
}
|
|
@@ -45097,7 +45614,7 @@ var ts;
|
|
|
45097
45614
|
}
|
|
45098
45615
|
baseType = getReturnTypeOfSignature(constructors[0]);
|
|
45099
45616
|
}
|
|
45100
|
-
if (baseType
|
|
45617
|
+
if (isErrorType(baseType)) {
|
|
45101
45618
|
return type.resolvedBaseTypes = ts.emptyArray;
|
|
45102
45619
|
}
|
|
45103
45620
|
var reducedBaseType = getReducedType(baseType);
|
|
@@ -45144,7 +45661,7 @@ var ts;
|
|
|
45144
45661
|
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
|
|
45145
45662
|
var node = _c[_b];
|
|
45146
45663
|
var baseType = getReducedType(getTypeFromTypeNode(node));
|
|
45147
|
-
if (baseType
|
|
45664
|
+
if (!isErrorType(baseType)) {
|
|
45148
45665
|
if (isValidBaseType(baseType)) {
|
|
45149
45666
|
if (type !== baseType && !hasBaseType(baseType, type)) {
|
|
45150
45667
|
if (type.resolvedBaseTypes === ts.emptyArray) {
|
|
@@ -46722,7 +47239,7 @@ var ts;
|
|
|
46722
47239
|
for (var _i = 0, _c = containingType.types; _i < _c.length; _i++) {
|
|
46723
47240
|
var current = _c[_i];
|
|
46724
47241
|
var type = getApparentType(current);
|
|
46725
|
-
if (!(type
|
|
47242
|
+
if (!(isErrorType(type) || type.flags & 131072)) {
|
|
46726
47243
|
var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
|
|
46727
47244
|
var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
|
|
46728
47245
|
if (prop) {
|
|
@@ -47557,7 +48074,7 @@ var ts;
|
|
|
47557
48074
|
}
|
|
47558
48075
|
else {
|
|
47559
48076
|
var type = getTypeFromTypeNode(constraintDeclaration);
|
|
47560
|
-
if (type.flags & 1 && type
|
|
48077
|
+
if (type.flags & 1 && !isErrorType(type)) {
|
|
47561
48078
|
type = constraintDeclaration.parent.parent.kind === 194 ? keyofConstraintType : unknownType;
|
|
47562
48079
|
}
|
|
47563
48080
|
typeParameter.constraint = type;
|
|
@@ -47711,6 +48228,18 @@ var ts;
|
|
|
47711
48228
|
return instantiation;
|
|
47712
48229
|
}
|
|
47713
48230
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
48231
|
+
if (ts.getCheckFlags(symbol) & 1048576) {
|
|
48232
|
+
var typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
48233
|
+
var id = getAliasId(symbol, typeArguments);
|
|
48234
|
+
var errorType_1 = errorTypes.get(id);
|
|
48235
|
+
if (!errorType_1) {
|
|
48236
|
+
errorType_1 = createIntrinsicType(1, "error");
|
|
48237
|
+
errorType_1.aliasSymbol = symbol;
|
|
48238
|
+
errorType_1.aliasTypeArguments = typeArguments;
|
|
48239
|
+
errorTypes.set(id, errorType_1);
|
|
48240
|
+
}
|
|
48241
|
+
return errorType_1;
|
|
48242
|
+
}
|
|
47714
48243
|
var type = getDeclaredTypeOfSymbol(symbol);
|
|
47715
48244
|
var typeParameters = getSymbolLinks(symbol).typeParameters;
|
|
47716
48245
|
if (typeParameters) {
|
|
@@ -47745,11 +48274,37 @@ var ts;
|
|
|
47745
48274
|
}
|
|
47746
48275
|
return undefined;
|
|
47747
48276
|
}
|
|
47748
|
-
function
|
|
47749
|
-
|
|
48277
|
+
function getSymbolPath(symbol) {
|
|
48278
|
+
return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
|
|
48279
|
+
}
|
|
48280
|
+
function getUnresolvedSymbolForEntityName(name) {
|
|
48281
|
+
var identifier = name.kind === 160 ? name.right :
|
|
48282
|
+
name.kind === 205 ? name.name :
|
|
48283
|
+
name;
|
|
48284
|
+
var text = identifier.escapedText;
|
|
48285
|
+
if (text) {
|
|
48286
|
+
var parentSymbol = name.kind === 160 ? getUnresolvedSymbolForEntityName(name.left) :
|
|
48287
|
+
name.kind === 205 ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
48288
|
+
undefined;
|
|
48289
|
+
var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
|
|
48290
|
+
var result = unresolvedSymbols.get(path);
|
|
48291
|
+
if (!result) {
|
|
48292
|
+
unresolvedSymbols.set(path, result = createSymbol(524288, text, 1048576));
|
|
48293
|
+
result.parent = parentSymbol;
|
|
48294
|
+
result.declaredType = unresolvedType;
|
|
48295
|
+
}
|
|
48296
|
+
return result;
|
|
48297
|
+
}
|
|
48298
|
+
return unknownSymbol;
|
|
48299
|
+
}
|
|
48300
|
+
function resolveTypeReferenceName(typeReference, meaning, ignoreErrors) {
|
|
48301
|
+
var name = getTypeReferenceName(typeReference);
|
|
48302
|
+
if (!name) {
|
|
47750
48303
|
return unknownSymbol;
|
|
47751
48304
|
}
|
|
47752
|
-
|
|
48305
|
+
var symbol = resolveEntityName(name, meaning, ignoreErrors);
|
|
48306
|
+
return symbol && symbol !== unknownSymbol ? symbol :
|
|
48307
|
+
ignoreErrors ? unknownSymbol : getUnresolvedSymbolForEntityName(name);
|
|
47753
48308
|
}
|
|
47754
48309
|
function getTypeReferenceType(node, symbol) {
|
|
47755
48310
|
if (symbol === unknownSymbol) {
|
|
@@ -47772,7 +48327,7 @@ var ts;
|
|
|
47772
48327
|
return jsdocType;
|
|
47773
48328
|
}
|
|
47774
48329
|
else {
|
|
47775
|
-
resolveTypeReferenceName(
|
|
48330
|
+
resolveTypeReferenceName(node, 788968);
|
|
47776
48331
|
return getTypeOfSymbol(symbol);
|
|
47777
48332
|
}
|
|
47778
48333
|
}
|
|
@@ -47906,18 +48461,18 @@ var ts;
|
|
|
47906
48461
|
if (isJSDocTypeReference(node)) {
|
|
47907
48462
|
type = getIntendedTypeFromJSDocTypeReference(node);
|
|
47908
48463
|
if (!type) {
|
|
47909
|
-
symbol = resolveTypeReferenceName(
|
|
48464
|
+
symbol = resolveTypeReferenceName(node, meaning, true);
|
|
47910
48465
|
if (symbol === unknownSymbol) {
|
|
47911
|
-
symbol = resolveTypeReferenceName(
|
|
48466
|
+
symbol = resolveTypeReferenceName(node, meaning | 111551);
|
|
47912
48467
|
}
|
|
47913
48468
|
else {
|
|
47914
|
-
resolveTypeReferenceName(
|
|
48469
|
+
resolveTypeReferenceName(node, meaning);
|
|
47915
48470
|
}
|
|
47916
48471
|
type = getTypeReferenceType(node, symbol);
|
|
47917
48472
|
}
|
|
47918
48473
|
}
|
|
47919
48474
|
if (!type) {
|
|
47920
|
-
symbol = resolveTypeReferenceName(
|
|
48475
|
+
symbol = resolveTypeReferenceName(node, meaning);
|
|
47921
48476
|
type = getTypeReferenceType(node, symbol);
|
|
47922
48477
|
}
|
|
47923
48478
|
links.resolvedSymbol = symbol;
|
|
@@ -48152,7 +48707,7 @@ var ts;
|
|
|
48152
48707
|
function mayResolveTypeAlias(node) {
|
|
48153
48708
|
switch (node.kind) {
|
|
48154
48709
|
case 177:
|
|
48155
|
-
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node
|
|
48710
|
+
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968).flags & 524288);
|
|
48156
48711
|
case 180:
|
|
48157
48712
|
return true;
|
|
48158
48713
|
case 192:
|
|
@@ -48402,8 +48957,6 @@ var ts;
|
|
|
48402
48957
|
}
|
|
48403
48958
|
if (!(flags & 131072)) {
|
|
48404
48959
|
includes |= flags & 205258751;
|
|
48405
|
-
if (flags & 469499904)
|
|
48406
|
-
includes |= 262144;
|
|
48407
48960
|
if (type === wildcardType)
|
|
48408
48961
|
includes |= 8388608;
|
|
48409
48962
|
if (!strictNullChecks && flags & 98304) {
|
|
@@ -48685,11 +49238,17 @@ var ts;
|
|
|
48685
49238
|
if (type === wildcardType)
|
|
48686
49239
|
includes |= 8388608;
|
|
48687
49240
|
}
|
|
48688
|
-
else if (
|
|
48689
|
-
if (
|
|
48690
|
-
includes |=
|
|
49241
|
+
else if (strictNullChecks || !(flags & 98304)) {
|
|
49242
|
+
if (exactOptionalPropertyTypes && type === missingType) {
|
|
49243
|
+
includes |= 262144;
|
|
49244
|
+
type = undefinedType;
|
|
49245
|
+
}
|
|
49246
|
+
if (!typeSet.has(type.id.toString())) {
|
|
49247
|
+
if (type.flags & 109440 && includes & 109440) {
|
|
49248
|
+
includes |= 67108864;
|
|
49249
|
+
}
|
|
49250
|
+
typeSet.set(type.id.toString(), type);
|
|
48691
49251
|
}
|
|
48692
|
-
typeSet.set(type.id.toString(), type);
|
|
48693
49252
|
}
|
|
48694
49253
|
includes |= flags & 205258751;
|
|
48695
49254
|
}
|
|
@@ -48753,14 +49312,13 @@ var ts;
|
|
|
48753
49312
|
}
|
|
48754
49313
|
return false;
|
|
48755
49314
|
}
|
|
48756
|
-
function
|
|
48757
|
-
|
|
48758
|
-
|
|
48759
|
-
|
|
48760
|
-
|
|
48761
|
-
return
|
|
49315
|
+
function eachIsUnionContaining(types, flag) {
|
|
49316
|
+
return ts.every(types, function (t) { return !!(t.flags & 1048576) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
|
|
49317
|
+
}
|
|
49318
|
+
function removeFromEach(types, flag) {
|
|
49319
|
+
for (var i = 0; i < types.length; i++) {
|
|
49320
|
+
types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
|
|
48762
49321
|
}
|
|
48763
|
-
return false;
|
|
48764
49322
|
}
|
|
48765
49323
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
48766
49324
|
var unionTypes;
|
|
@@ -48840,6 +49398,9 @@ var ts;
|
|
|
48840
49398
|
if (includes & 16777216 && includes & 524288) {
|
|
48841
49399
|
ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
|
|
48842
49400
|
}
|
|
49401
|
+
if (includes & 262144) {
|
|
49402
|
+
typeSet[typeSet.indexOf(undefinedType)] = missingType;
|
|
49403
|
+
}
|
|
48843
49404
|
if (typeSet.length === 0) {
|
|
48844
49405
|
return unknownType;
|
|
48845
49406
|
}
|
|
@@ -48853,10 +49414,13 @@ var ts;
|
|
|
48853
49414
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
48854
49415
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
48855
49416
|
}
|
|
48856
|
-
else if (
|
|
48857
|
-
|
|
49417
|
+
else if (eachIsUnionContaining(typeSet, 32768)) {
|
|
49418
|
+
var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
|
|
49419
|
+
removeFromEach(typeSet, 32768);
|
|
49420
|
+
result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments);
|
|
48858
49421
|
}
|
|
48859
|
-
else if (
|
|
49422
|
+
else if (eachIsUnionContaining(typeSet, 65536)) {
|
|
49423
|
+
removeFromEach(typeSet, 65536);
|
|
48860
49424
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1, aliasSymbol, aliasTypeArguments);
|
|
48861
49425
|
}
|
|
48862
49426
|
else {
|
|
@@ -50419,7 +50983,7 @@ var ts;
|
|
|
50419
50983
|
var mappedTypeVariable = instantiateType(typeVariable, mapper);
|
|
50420
50984
|
if (typeVariable !== mappedTypeVariable) {
|
|
50421
50985
|
return mapTypeWithAlias(getReducedType(mappedTypeVariable), function (t) {
|
|
50422
|
-
if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && t
|
|
50986
|
+
if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && !isErrorType(t)) {
|
|
50423
50987
|
if (!type.declaration.nameType) {
|
|
50424
50988
|
if (isArrayType(t)) {
|
|
50425
50989
|
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
|
|
@@ -50455,7 +51019,7 @@ var ts;
|
|
|
50455
51019
|
}
|
|
50456
51020
|
function instantiateMappedArrayType(arrayType, mappedType, mapper) {
|
|
50457
51021
|
var elementType = instantiateMappedTypeTemplate(mappedType, numberType, true, mapper);
|
|
50458
|
-
return elementType
|
|
51022
|
+
return isErrorType(elementType) ? errorType :
|
|
50459
51023
|
createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType)));
|
|
50460
51024
|
}
|
|
50461
51025
|
function instantiateMappedTupleType(tupleType, mappedType, mapper) {
|
|
@@ -51557,7 +52121,7 @@ var ts;
|
|
|
51557
52121
|
if (path.length === 0) {
|
|
51558
52122
|
path = "" + str;
|
|
51559
52123
|
}
|
|
51560
|
-
else if (ts.isIdentifierText(str, compilerOptions
|
|
52124
|
+
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
|
|
51561
52125
|
path = path + "." + str;
|
|
51562
52126
|
}
|
|
51563
52127
|
else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
@@ -51844,7 +52408,7 @@ var ts;
|
|
|
51844
52408
|
var targetTypes = target.types;
|
|
51845
52409
|
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
51846
52410
|
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
51847
|
-
if (intrinsicAttributes
|
|
52411
|
+
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
51848
52412
|
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
51849
52413
|
return result;
|
|
51850
52414
|
}
|
|
@@ -56646,6 +57210,9 @@ var ts;
|
|
|
56646
57210
|
case 102:
|
|
56647
57211
|
return narrowTypeByInstanceof(type, expr, assumeTrue);
|
|
56648
57212
|
case 101:
|
|
57213
|
+
if (ts.isPrivateIdentifier(expr.left)) {
|
|
57214
|
+
return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
|
|
57215
|
+
}
|
|
56649
57216
|
var target = getReferenceCandidate(expr.right);
|
|
56650
57217
|
var leftType = getTypeOfNode(expr.left);
|
|
56651
57218
|
if (leftType.flags & 128) {
|
|
@@ -56672,6 +57239,22 @@ var ts;
|
|
|
56672
57239
|
}
|
|
56673
57240
|
return type;
|
|
56674
57241
|
}
|
|
57242
|
+
function narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue) {
|
|
57243
|
+
var target = getReferenceCandidate(expr.right);
|
|
57244
|
+
if (!isMatchingReference(reference, target)) {
|
|
57245
|
+
return type;
|
|
57246
|
+
}
|
|
57247
|
+
ts.Debug.assertNode(expr.left, ts.isPrivateIdentifier);
|
|
57248
|
+
var symbol = getSymbolForPrivateIdentifierExpression(expr.left);
|
|
57249
|
+
if (symbol === undefined) {
|
|
57250
|
+
return type;
|
|
57251
|
+
}
|
|
57252
|
+
var classSymbol = symbol.parent;
|
|
57253
|
+
var targetType = ts.hasStaticModifier(ts.Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration"))
|
|
57254
|
+
? getTypeOfSymbol(classSymbol)
|
|
57255
|
+
: getDeclaredTypeOfSymbol(classSymbol);
|
|
57256
|
+
return getNarrowedType(type, targetType, assumeTrue, isTypeDerivedFrom);
|
|
57257
|
+
}
|
|
56675
57258
|
function narrowTypeByOptionalChainContainment(type, operator, value, assumeTrue) {
|
|
56676
57259
|
var equalsOperator = operator === 34 || operator === 36;
|
|
56677
57260
|
var nullableFlags = operator === 34 || operator === 35 ? 98304 : 32768;
|
|
@@ -58323,7 +58906,7 @@ var ts;
|
|
|
58323
58906
|
var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType);
|
|
58324
58907
|
propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType);
|
|
58325
58908
|
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
|
|
58326
|
-
if (intrinsicAttribs
|
|
58909
|
+
if (!isErrorType(intrinsicAttribs)) {
|
|
58327
58910
|
propsType = intersectTypes(intrinsicAttribs, propsType);
|
|
58328
58911
|
}
|
|
58329
58912
|
return propsType;
|
|
@@ -58405,7 +58988,7 @@ var ts;
|
|
|
58405
58988
|
else {
|
|
58406
58989
|
var apparentAttributesType = attributesType;
|
|
58407
58990
|
var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context);
|
|
58408
|
-
if (intrinsicClassAttribs
|
|
58991
|
+
if (!isErrorType(intrinsicClassAttribs)) {
|
|
58409
58992
|
var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
|
|
58410
58993
|
var hostClassType = getReturnTypeOfSignature(sig);
|
|
58411
58994
|
apparentAttributesType = intersectTypes(typeParams
|
|
@@ -58413,7 +58996,7 @@ var ts;
|
|
|
58413
58996
|
: intrinsicClassAttribs, apparentAttributesType);
|
|
58414
58997
|
}
|
|
58415
58998
|
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
|
|
58416
|
-
if (intrinsicAttribs
|
|
58999
|
+
if (!isErrorType(intrinsicAttribs)) {
|
|
58417
59000
|
apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);
|
|
58418
59001
|
}
|
|
58419
59002
|
return apparentAttributesType;
|
|
@@ -58809,7 +59392,7 @@ var ts;
|
|
|
58809
59392
|
checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl);
|
|
58810
59393
|
}
|
|
58811
59394
|
offset = propertiesArray.length;
|
|
58812
|
-
if (spread
|
|
59395
|
+
if (isErrorType(spread)) {
|
|
58813
59396
|
continue;
|
|
58814
59397
|
}
|
|
58815
59398
|
spread = getSpreadType(spread, mergedType, node.symbol, objectFlags, inConstContext);
|
|
@@ -58857,7 +59440,7 @@ var ts;
|
|
|
58857
59440
|
}
|
|
58858
59441
|
}
|
|
58859
59442
|
}
|
|
58860
|
-
if (spread
|
|
59443
|
+
if (isErrorType(spread)) {
|
|
58861
59444
|
return errorType;
|
|
58862
59445
|
}
|
|
58863
59446
|
if (spread !== emptyObjectType) {
|
|
@@ -59082,7 +59665,7 @@ var ts;
|
|
|
59082
59665
|
var links = getNodeLinks(node);
|
|
59083
59666
|
if (!links.resolvedSymbol) {
|
|
59084
59667
|
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node);
|
|
59085
|
-
if (intrinsicElementsType
|
|
59668
|
+
if (!isErrorType(intrinsicElementsType)) {
|
|
59086
59669
|
if (!ts.isIdentifier(node.tagName))
|
|
59087
59670
|
return ts.Debug.fail();
|
|
59088
59671
|
var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText);
|
|
@@ -59214,7 +59797,7 @@ var ts;
|
|
|
59214
59797
|
}
|
|
59215
59798
|
function getIntrinsicAttributesTypeFromStringLiteralType(type, location) {
|
|
59216
59799
|
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location);
|
|
59217
|
-
if (intrinsicElementsType
|
|
59800
|
+
if (!isErrorType(intrinsicElementsType)) {
|
|
59218
59801
|
var stringLiteralTypeName = type.value;
|
|
59219
59802
|
var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
|
|
59220
59803
|
if (intrinsicProp) {
|
|
@@ -59275,7 +59858,7 @@ var ts;
|
|
|
59275
59858
|
}
|
|
59276
59859
|
function getJsxElementClassTypeAt(location) {
|
|
59277
59860
|
var type = getJsxType(JsxNames.ElementClass, location);
|
|
59278
|
-
if (type
|
|
59861
|
+
if (isErrorType(type))
|
|
59279
59862
|
return undefined;
|
|
59280
59863
|
return type;
|
|
59281
59864
|
}
|
|
@@ -59508,7 +60091,7 @@ var ts;
|
|
|
59508
60091
|
}
|
|
59509
60092
|
function checkNonNullNonVoidType(type, node) {
|
|
59510
60093
|
var nonNullType = checkNonNullType(type, node);
|
|
59511
|
-
if (nonNullType
|
|
60094
|
+
if (nonNullType.flags & 16384) {
|
|
59512
60095
|
error(node, ts.Diagnostics.Object_is_possibly_undefined);
|
|
59513
60096
|
}
|
|
59514
60097
|
return nonNullType;
|
|
@@ -59542,6 +60125,36 @@ var ts;
|
|
|
59542
60125
|
}
|
|
59543
60126
|
}
|
|
59544
60127
|
}
|
|
60128
|
+
function checkGrammarPrivateIdentifierExpression(privId) {
|
|
60129
|
+
if (!ts.getContainingClass(privId)) {
|
|
60130
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
60131
|
+
}
|
|
60132
|
+
if (!ts.isExpressionNode(privId)) {
|
|
60133
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.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);
|
|
60134
|
+
}
|
|
60135
|
+
if (!getSymbolForPrivateIdentifierExpression(privId)) {
|
|
60136
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
|
|
60137
|
+
}
|
|
60138
|
+
return false;
|
|
60139
|
+
}
|
|
60140
|
+
function checkPrivateIdentifierExpression(privId) {
|
|
60141
|
+
checkGrammarPrivateIdentifierExpression(privId);
|
|
60142
|
+
var symbol = getSymbolForPrivateIdentifierExpression(privId);
|
|
60143
|
+
if (symbol) {
|
|
60144
|
+
markPropertyAsReferenced(symbol, undefined, false);
|
|
60145
|
+
}
|
|
60146
|
+
return anyType;
|
|
60147
|
+
}
|
|
60148
|
+
function getSymbolForPrivateIdentifierExpression(privId) {
|
|
60149
|
+
if (!ts.isExpressionNode(privId)) {
|
|
60150
|
+
return undefined;
|
|
60151
|
+
}
|
|
60152
|
+
var links = getNodeLinks(privId);
|
|
60153
|
+
if (links.resolvedSymbol === undefined) {
|
|
60154
|
+
links.resolvedSymbol = lookupSymbolForPrivateIdentifierDeclaration(privId.escapedText, privId);
|
|
60155
|
+
}
|
|
60156
|
+
return links.resolvedSymbol;
|
|
60157
|
+
}
|
|
59545
60158
|
function getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) {
|
|
59546
60159
|
return getPropertyOfType(leftType, lexicallyScopedIdentifier.escapedName);
|
|
59547
60160
|
}
|
|
@@ -59599,7 +60212,7 @@ var ts;
|
|
|
59599
60212
|
if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && ts.isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) {
|
|
59600
60213
|
grammarErrorOnNode(right, ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, ts.idText(right));
|
|
59601
60214
|
}
|
|
59602
|
-
if ((lexicallyScopedSymbol === null || lexicallyScopedSymbol === void 0 ? void 0 : lexicallyScopedSymbol.valueDeclaration) && (compilerOptions
|
|
60215
|
+
if ((lexicallyScopedSymbol === null || lexicallyScopedSymbol === void 0 ? void 0 : lexicallyScopedSymbol.valueDeclaration) && (ts.getEmitScriptTarget(compilerOptions) === 99 && !useDefineForClassFields)) {
|
|
59603
60216
|
var lexicalClass_1 = ts.getContainingClass(lexicallyScopedSymbol.valueDeclaration);
|
|
59604
60217
|
var parentStaticFieldInitializer = ts.findAncestor(node, function (n) {
|
|
59605
60218
|
if (n === lexicalClass_1)
|
|
@@ -59618,7 +60231,7 @@ var ts;
|
|
|
59618
60231
|
}
|
|
59619
60232
|
if (isAnyLike) {
|
|
59620
60233
|
if (lexicallyScopedSymbol) {
|
|
59621
|
-
return apparentType;
|
|
60234
|
+
return isErrorType(apparentType) ? errorType : apparentType;
|
|
59622
60235
|
}
|
|
59623
60236
|
if (!ts.getContainingClass(right)) {
|
|
59624
60237
|
grammarErrorOnNode(right, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -59641,7 +60254,8 @@ var ts;
|
|
|
59641
60254
|
if (ts.isIdentifier(left) && parentSymbol) {
|
|
59642
60255
|
markAliasReferenced(parentSymbol, node);
|
|
59643
60256
|
}
|
|
59644
|
-
return apparentType;
|
|
60257
|
+
return isErrorType(apparentType) ? errorType : apparentType;
|
|
60258
|
+
;
|
|
59645
60259
|
}
|
|
59646
60260
|
prop = getPropertyOfType(apparentType, right.escapedText);
|
|
59647
60261
|
}
|
|
@@ -60044,14 +60658,14 @@ var ts;
|
|
|
60044
60658
|
return isPropertyAccessible(node, node.kind === 205 && node.expression.kind === 106, false, type, property);
|
|
60045
60659
|
}
|
|
60046
60660
|
function isValidPropertyAccessWithType(node, isSuper, propertyName, type) {
|
|
60047
|
-
if (
|
|
60661
|
+
if (isTypeAny(type)) {
|
|
60048
60662
|
return true;
|
|
60049
60663
|
}
|
|
60050
60664
|
var prop = getPropertyOfType(type, propertyName);
|
|
60051
60665
|
return !!prop && isPropertyAccessible(node, isSuper, false, type, prop);
|
|
60052
60666
|
}
|
|
60053
60667
|
function isPropertyAccessible(node, isSuper, isWrite, containingType, property) {
|
|
60054
|
-
if (
|
|
60668
|
+
if (isTypeAny(containingType)) {
|
|
60055
60669
|
return true;
|
|
60056
60670
|
}
|
|
60057
60671
|
if (property.valueDeclaration && ts.isPrivateIdentifierClassElementDeclaration(property.valueDeclaration)) {
|
|
@@ -60110,7 +60724,7 @@ var ts;
|
|
|
60110
60724
|
var objectType = ts.getAssignmentTargetKind(node) !== 0 || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;
|
|
60111
60725
|
var indexExpression = node.argumentExpression;
|
|
60112
60726
|
var indexType = checkExpression(indexExpression);
|
|
60113
|
-
if (objectType
|
|
60727
|
+
if (isErrorType(objectType) || objectType === silentNeverType) {
|
|
60114
60728
|
return objectType;
|
|
60115
60729
|
}
|
|
60116
60730
|
if (isConstEnumObjectType(objectType) && !ts.isStringLiteralLike(indexExpression)) {
|
|
@@ -60315,7 +60929,7 @@ var ts;
|
|
|
60315
60929
|
return inferJsxTypeArguments(node, signature, checkMode, context);
|
|
60316
60930
|
}
|
|
60317
60931
|
if (node.kind !== 164) {
|
|
60318
|
-
var contextualType = getContextualType(node, 8);
|
|
60932
|
+
var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 : 0);
|
|
60319
60933
|
if (contextualType) {
|
|
60320
60934
|
var outerContext = getInferenceContext(node);
|
|
60321
60935
|
var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1));
|
|
@@ -61121,7 +61735,7 @@ var ts;
|
|
|
61121
61735
|
}
|
|
61122
61736
|
return anySignature;
|
|
61123
61737
|
}
|
|
61124
|
-
if (superType
|
|
61738
|
+
if (!isErrorType(superType)) {
|
|
61125
61739
|
var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
|
|
61126
61740
|
if (baseTypeNode) {
|
|
61127
61741
|
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
|
|
@@ -61147,13 +61761,13 @@ var ts;
|
|
|
61147
61761
|
return silentNeverSignature;
|
|
61148
61762
|
}
|
|
61149
61763
|
var apparentType = getApparentType(funcType);
|
|
61150
|
-
if (apparentType
|
|
61764
|
+
if (isErrorType(apparentType)) {
|
|
61151
61765
|
return resolveErrorCall(node);
|
|
61152
61766
|
}
|
|
61153
61767
|
var callSignatures = getSignaturesOfType(apparentType, 0);
|
|
61154
61768
|
var numConstructSignatures = getSignaturesOfType(apparentType, 1).length;
|
|
61155
61769
|
if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) {
|
|
61156
|
-
if (funcType
|
|
61770
|
+
if (!isErrorType(funcType) && node.typeArguments) {
|
|
61157
61771
|
error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);
|
|
61158
61772
|
}
|
|
61159
61773
|
return resolveUntypedCall(node);
|
|
@@ -61203,7 +61817,7 @@ var ts;
|
|
|
61203
61817
|
return silentNeverSignature;
|
|
61204
61818
|
}
|
|
61205
61819
|
expressionType = getApparentType(expressionType);
|
|
61206
|
-
if (expressionType
|
|
61820
|
+
if (isErrorType(expressionType)) {
|
|
61207
61821
|
return resolveErrorCall(node);
|
|
61208
61822
|
}
|
|
61209
61823
|
if (isTypeAny(expressionType)) {
|
|
@@ -61392,7 +62006,7 @@ var ts;
|
|
|
61392
62006
|
function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) {
|
|
61393
62007
|
var tagType = checkExpression(node.tag);
|
|
61394
62008
|
var apparentType = getApparentType(tagType);
|
|
61395
|
-
if (apparentType
|
|
62009
|
+
if (isErrorType(apparentType)) {
|
|
61396
62010
|
return resolveErrorCall(node);
|
|
61397
62011
|
}
|
|
61398
62012
|
var callSignatures = getSignaturesOfType(apparentType, 0);
|
|
@@ -61431,7 +62045,7 @@ var ts;
|
|
|
61431
62045
|
function resolveDecorator(node, candidatesOutArray, checkMode) {
|
|
61432
62046
|
var funcType = checkExpression(node.expression);
|
|
61433
62047
|
var apparentType = getApparentType(funcType);
|
|
61434
|
-
if (apparentType
|
|
62048
|
+
if (isErrorType(apparentType)) {
|
|
61435
62049
|
return resolveErrorCall(node);
|
|
61436
62050
|
}
|
|
61437
62051
|
var callSignatures = getSignaturesOfType(apparentType, 0);
|
|
@@ -61481,7 +62095,7 @@ var ts;
|
|
|
61481
62095
|
}
|
|
61482
62096
|
var exprTypes = checkExpression(node.tagName);
|
|
61483
62097
|
var apparentType = getApparentType(exprTypes);
|
|
61484
|
-
if (apparentType
|
|
62098
|
+
if (isErrorType(apparentType)) {
|
|
61485
62099
|
return resolveErrorCall(node);
|
|
61486
62100
|
}
|
|
61487
62101
|
var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node);
|
|
@@ -61761,7 +62375,7 @@ var ts;
|
|
|
61761
62375
|
}
|
|
61762
62376
|
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) {
|
|
61763
62377
|
var _a;
|
|
61764
|
-
if (allowSyntheticDefaultImports && type && type
|
|
62378
|
+
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
61765
62379
|
var synthType = type;
|
|
61766
62380
|
if (!synthType.syntheticType) {
|
|
61767
62381
|
var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
@@ -61821,6 +62435,12 @@ var ts;
|
|
|
61821
62435
|
return getReturnTypeOfSignature(signature);
|
|
61822
62436
|
}
|
|
61823
62437
|
function checkAssertion(node) {
|
|
62438
|
+
if (node.kind === 210) {
|
|
62439
|
+
var file = ts.getSourceFileOfNode(node);
|
|
62440
|
+
if (file && ts.fileExtensionIsOneOf(file.fileName, [".cts", ".mts"])) {
|
|
62441
|
+
grammarErrorOnNode(node, ts.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
|
|
62442
|
+
}
|
|
62443
|
+
}
|
|
61824
62444
|
return checkAssertionWorker(node, node.type, node.expression);
|
|
61825
62445
|
}
|
|
61826
62446
|
function isValidConstAssertionArgument(node) {
|
|
@@ -61864,7 +62484,7 @@ var ts;
|
|
|
61864
62484
|
checkSourceElement(type);
|
|
61865
62485
|
exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(exprType));
|
|
61866
62486
|
var targetType = getTypeFromTypeNode(type);
|
|
61867
|
-
if (produceDiagnostics && targetType
|
|
62487
|
+
if (produceDiagnostics && !isErrorType(targetType)) {
|
|
61868
62488
|
var widenedType = getWidenedType(exprType);
|
|
61869
62489
|
if (!isTypeComparableTo(targetType, widenedType)) {
|
|
61870
62490
|
checkTypeComparableTo(exprType, targetType, errNode, ts.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first);
|
|
@@ -61897,7 +62517,7 @@ var ts;
|
|
|
61897
62517
|
return getGlobalImportMetaExpressionType();
|
|
61898
62518
|
case 103:
|
|
61899
62519
|
var type = checkNewTargetMetaProperty(node);
|
|
61900
|
-
return type
|
|
62520
|
+
return isErrorType(type) ? errorType : createNewTargetExpressionType(type);
|
|
61901
62521
|
default:
|
|
61902
62522
|
ts.Debug.assertNever(node.keywordToken);
|
|
61903
62523
|
}
|
|
@@ -61919,7 +62539,14 @@ var ts;
|
|
|
61919
62539
|
}
|
|
61920
62540
|
function checkImportMetaProperty(node) {
|
|
61921
62541
|
if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) {
|
|
61922
|
-
|
|
62542
|
+
if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
62543
|
+
if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
62544
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
62545
|
+
}
|
|
62546
|
+
}
|
|
62547
|
+
else {
|
|
62548
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_system_node12_or_nodenext);
|
|
62549
|
+
}
|
|
61923
62550
|
}
|
|
61924
62551
|
var file = ts.getSourceFileOfNode(node);
|
|
61925
62552
|
ts.Debug.assert(!!(file.flags & 2097152), "Containing file is missing import meta node flag.");
|
|
@@ -62746,9 +63373,9 @@ var ts;
|
|
|
62746
63373
|
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);
|
|
62747
63374
|
diagnostics.add(diagnostic);
|
|
62748
63375
|
}
|
|
62749
|
-
if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) || languageVersion < 4) {
|
|
63376
|
+
if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
|
|
62750
63377
|
span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
62751
|
-
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.
|
|
63378
|
+
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher);
|
|
62752
63379
|
diagnostics.add(diagnostic);
|
|
62753
63380
|
}
|
|
62754
63381
|
}
|
|
@@ -62772,7 +63399,7 @@ var ts;
|
|
|
62772
63399
|
}
|
|
62773
63400
|
var operandType = checkExpression(node.expression);
|
|
62774
63401
|
var awaitedType = checkAwaitedType(operandType, true, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
62775
|
-
if (awaitedType === operandType && awaitedType
|
|
63402
|
+
if (awaitedType === operandType && !isErrorType(awaitedType) && !(operandType.flags & 3)) {
|
|
62776
63403
|
addErrorOrSuggestion(false, ts.createDiagnosticForNode(node, ts.Diagnostics.await_has_no_effect_on_the_type_of_this_expression));
|
|
62777
63404
|
}
|
|
62778
63405
|
return awaitedType;
|
|
@@ -62910,12 +63537,23 @@ var ts;
|
|
|
62910
63537
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
62911
63538
|
return silentNeverType;
|
|
62912
63539
|
}
|
|
62913
|
-
|
|
62914
|
-
|
|
62915
|
-
|
|
62916
|
-
|
|
62917
|
-
|
|
63540
|
+
if (ts.isPrivateIdentifier(left)) {
|
|
63541
|
+
if (languageVersion < 99) {
|
|
63542
|
+
checkExternalEmitHelpers(left, 2097152);
|
|
63543
|
+
}
|
|
63544
|
+
if (!getNodeLinks(left).resolvedSymbol && ts.getContainingClass(left)) {
|
|
63545
|
+
var isUncheckedJS = isUncheckedJSSuggestion(left, rightType.symbol, true);
|
|
63546
|
+
reportNonexistentProperty(left, rightType, isUncheckedJS);
|
|
63547
|
+
}
|
|
63548
|
+
}
|
|
63549
|
+
else {
|
|
63550
|
+
leftType = checkNonNullType(leftType, left);
|
|
63551
|
+
if (!(allTypesAssignableToKind(leftType, 402653316 | 296 | 12288) ||
|
|
63552
|
+
isTypeAssignableToKind(leftType, 4194304 | 134217728 | 268435456 | 262144))) {
|
|
63553
|
+
error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol);
|
|
63554
|
+
}
|
|
62918
63555
|
}
|
|
63556
|
+
rightType = checkNonNullType(rightType, right);
|
|
62919
63557
|
var rightTypeConstraint = getConstraintOfType(rightType);
|
|
62920
63558
|
if (!allTypesAssignableToKind(rightType, 67108864 | 58982400) ||
|
|
62921
63559
|
rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 | 58982400) ||
|
|
@@ -63344,7 +63982,7 @@ var ts;
|
|
|
63344
63982
|
resultType = stringType;
|
|
63345
63983
|
}
|
|
63346
63984
|
else if (isTypeAny(leftType) || isTypeAny(rightType)) {
|
|
63347
|
-
resultType = leftType
|
|
63985
|
+
resultType = isErrorType(leftType) || isErrorType(rightType) ? errorType : anyType;
|
|
63348
63986
|
}
|
|
63349
63987
|
if (resultType && !checkForDisallowedESSymbolOperand(operator)) {
|
|
63350
63988
|
return resultType;
|
|
@@ -64035,6 +64673,8 @@ var ts;
|
|
|
64035
64673
|
switch (kind) {
|
|
64036
64674
|
case 79:
|
|
64037
64675
|
return checkIdentifier(node, checkMode);
|
|
64676
|
+
case 80:
|
|
64677
|
+
return checkPrivateIdentifierExpression(node);
|
|
64038
64678
|
case 108:
|
|
64039
64679
|
return checkThisExpression(node);
|
|
64040
64680
|
case 106:
|
|
@@ -64563,7 +65203,7 @@ var ts;
|
|
|
64563
65203
|
if (classExtendsNull) {
|
|
64564
65204
|
error(superCall, ts.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
64565
65205
|
}
|
|
64566
|
-
var superCallShouldBeFirst = (compilerOptions
|
|
65206
|
+
var superCallShouldBeFirst = (ts.getEmitScriptTarget(compilerOptions) !== 99 || !useDefineForClassFields) &&
|
|
64567
65207
|
(ts.some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) ||
|
|
64568
65208
|
ts.some(node.parameters, function (p) { return ts.hasSyntacticModifier(p, 16476); }));
|
|
64569
65209
|
if (superCallShouldBeFirst) {
|
|
@@ -64661,7 +65301,7 @@ var ts;
|
|
|
64661
65301
|
}
|
|
64662
65302
|
function getTypeParametersForTypeReference(node) {
|
|
64663
65303
|
var type = getTypeFromTypeReference(node);
|
|
64664
|
-
if (type
|
|
65304
|
+
if (!isErrorType(type)) {
|
|
64665
65305
|
var symbol = getNodeLinks(node).resolvedSymbol;
|
|
64666
65306
|
if (symbol) {
|
|
64667
65307
|
return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters ||
|
|
@@ -64677,7 +65317,7 @@ var ts;
|
|
|
64677
65317
|
}
|
|
64678
65318
|
ts.forEach(node.typeArguments, checkSourceElement);
|
|
64679
65319
|
var type = getTypeFromTypeReference(node);
|
|
64680
|
-
if (type
|
|
65320
|
+
if (!isErrorType(type)) {
|
|
64681
65321
|
if (node.typeArguments && produceDiagnostics) {
|
|
64682
65322
|
var typeParameters = getTypeParametersForTypeReference(node);
|
|
64683
65323
|
if (typeParameters) {
|
|
@@ -65302,7 +65942,7 @@ var ts;
|
|
|
65302
65942
|
function checkAsyncFunctionReturnType(node, returnTypeNode) {
|
|
65303
65943
|
var returnType = getTypeFromTypeNode(returnTypeNode);
|
|
65304
65944
|
if (languageVersion >= 2) {
|
|
65305
|
-
if (returnType
|
|
65945
|
+
if (isErrorType(returnType)) {
|
|
65306
65946
|
return;
|
|
65307
65947
|
}
|
|
65308
65948
|
var globalPromiseType = getGlobalPromiseType(true);
|
|
@@ -65313,7 +65953,7 @@ var ts;
|
|
|
65313
65953
|
}
|
|
65314
65954
|
else {
|
|
65315
65955
|
markTypeNodeAsReferenced(returnTypeNode);
|
|
65316
|
-
if (returnType
|
|
65956
|
+
if (isErrorType(returnType)) {
|
|
65317
65957
|
return;
|
|
65318
65958
|
}
|
|
65319
65959
|
var promiseConstructorName = ts.getEntityNameFromTypeNode(returnTypeNode);
|
|
@@ -65323,7 +65963,7 @@ var ts;
|
|
|
65323
65963
|
}
|
|
65324
65964
|
var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 111551, true);
|
|
65325
65965
|
var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
|
|
65326
|
-
if (promiseConstructorType
|
|
65966
|
+
if (isErrorType(promiseConstructorType)) {
|
|
65327
65967
|
if (promiseConstructorName.kind === 79 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) {
|
|
65328
65968
|
error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
|
65329
65969
|
}
|
|
@@ -66010,7 +66650,7 @@ var ts;
|
|
|
66010
66650
|
});
|
|
66011
66651
|
}
|
|
66012
66652
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
66013
|
-
if (moduleKind >= ts.ModuleKind.ES2015) {
|
|
66653
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node12 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
66014
66654
|
return;
|
|
66015
66655
|
}
|
|
66016
66656
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -66232,7 +66872,7 @@ var ts;
|
|
|
66232
66872
|
}
|
|
66233
66873
|
else {
|
|
66234
66874
|
var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
|
|
66235
|
-
if (type
|
|
66875
|
+
if (!isErrorType(type) && !isErrorType(declarationType) &&
|
|
66236
66876
|
!isTypeIdenticalTo(type, declarationType) &&
|
|
66237
66877
|
!(symbol.flags & 67108864)) {
|
|
66238
66878
|
errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType);
|
|
@@ -67235,8 +67875,8 @@ var ts;
|
|
|
67235
67875
|
}
|
|
67236
67876
|
}
|
|
67237
67877
|
function checkClassNameCollisionWithObject(name) {
|
|
67238
|
-
if (languageVersion
|
|
67239
|
-
&& moduleKind < ts.ModuleKind.ES2015) {
|
|
67878
|
+
if (languageVersion >= 1 && name.escapedText === "Object"
|
|
67879
|
+
&& (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(name).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
67240
67880
|
error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]);
|
|
67241
67881
|
}
|
|
67242
67882
|
}
|
|
@@ -67432,7 +68072,7 @@ var ts;
|
|
|
67432
68072
|
checkTypeReferenceNode(typeRefNode);
|
|
67433
68073
|
if (produceDiagnostics) {
|
|
67434
68074
|
var t = getReducedType(getTypeFromTypeNode(typeRefNode));
|
|
67435
|
-
if (t
|
|
68075
|
+
if (!isErrorType(t)) {
|
|
67436
68076
|
if (isValidBaseType(t)) {
|
|
67437
68077
|
var genericDiag = t.symbol && t.symbol.flags & 32 ?
|
|
67438
68078
|
ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :
|
|
@@ -68293,8 +68933,8 @@ var ts;
|
|
|
68293
68933
|
checkAliasSymbol(node);
|
|
68294
68934
|
if (node.kind === 269 &&
|
|
68295
68935
|
ts.idText(node.propertyName || node.name) === "default" &&
|
|
68296
|
-
compilerOptions
|
|
68297
|
-
moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) {
|
|
68936
|
+
ts.getESModuleInterop(compilerOptions) &&
|
|
68937
|
+
moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
68298
68938
|
checkExternalEmitHelpers(node, 131072);
|
|
68299
68939
|
}
|
|
68300
68940
|
}
|
|
@@ -68325,7 +68965,7 @@ var ts;
|
|
|
68325
68965
|
if (importClause.namedBindings) {
|
|
68326
68966
|
if (importClause.namedBindings.kind === 267) {
|
|
68327
68967
|
checkImportBinding(importClause.namedBindings);
|
|
68328
|
-
if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions
|
|
68968
|
+
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && ts.getESModuleInterop(compilerOptions)) {
|
|
68329
68969
|
checkExternalEmitHelpers(node, 65536);
|
|
68330
68970
|
}
|
|
68331
68971
|
}
|
|
@@ -68368,7 +69008,7 @@ var ts;
|
|
|
68368
69008
|
}
|
|
68369
69009
|
}
|
|
68370
69010
|
else {
|
|
68371
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && !node.isTypeOnly && !(node.flags & 8388608)) {
|
|
69011
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags & 8388608)) {
|
|
68372
69012
|
grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
68373
69013
|
}
|
|
68374
69014
|
}
|
|
@@ -68382,7 +69022,7 @@ var ts;
|
|
|
68382
69022
|
grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers);
|
|
68383
69023
|
}
|
|
68384
69024
|
if (node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause) && ts.length(node.exportClause.elements) && languageVersion === 0) {
|
|
68385
|
-
checkExternalEmitHelpers(node,
|
|
69025
|
+
checkExternalEmitHelpers(node, 4194304);
|
|
68386
69026
|
}
|
|
68387
69027
|
checkGrammarExportDeclaration(node);
|
|
68388
69028
|
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
|
|
@@ -68403,9 +69043,9 @@ var ts;
|
|
|
68403
69043
|
else if (node.exportClause) {
|
|
68404
69044
|
checkAliasSymbol(node.exportClause);
|
|
68405
69045
|
}
|
|
68406
|
-
if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) {
|
|
69046
|
+
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
68407
69047
|
if (node.exportClause) {
|
|
68408
|
-
if (compilerOptions
|
|
69048
|
+
if (ts.getESModuleInterop(compilerOptions)) {
|
|
68409
69049
|
checkExternalEmitHelpers(node, 65536);
|
|
68410
69050
|
}
|
|
68411
69051
|
}
|
|
@@ -68486,9 +69126,9 @@ var ts;
|
|
|
68486
69126
|
}
|
|
68487
69127
|
}
|
|
68488
69128
|
else {
|
|
68489
|
-
if (compilerOptions
|
|
69129
|
+
if (ts.getESModuleInterop(compilerOptions) &&
|
|
68490
69130
|
moduleKind !== ts.ModuleKind.System &&
|
|
68491
|
-
moduleKind < ts.ModuleKind.ES2015 &&
|
|
69131
|
+
(moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) &&
|
|
68492
69132
|
ts.idText(node.propertyName || node.name) === "default") {
|
|
68493
69133
|
checkExternalEmitHelpers(node, 131072);
|
|
68494
69134
|
}
|
|
@@ -68543,7 +69183,7 @@ var ts;
|
|
|
68543
69183
|
grammarErrorOnNode(node.expression, ts.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
68544
69184
|
}
|
|
68545
69185
|
if (node.isExportEquals && !(node.flags & 8388608)) {
|
|
68546
|
-
if (moduleKind >= ts.ModuleKind.ES2015) {
|
|
69186
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.CommonJS) {
|
|
68547
69187
|
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
68548
69188
|
}
|
|
68549
69189
|
else if (moduleKind === ts.ModuleKind.System) {
|
|
@@ -69262,6 +69902,9 @@ var ts;
|
|
|
69262
69902
|
}
|
|
69263
69903
|
return result;
|
|
69264
69904
|
}
|
|
69905
|
+
else if (ts.isPrivateIdentifier(name)) {
|
|
69906
|
+
return getSymbolForPrivateIdentifierExpression(name);
|
|
69907
|
+
}
|
|
69265
69908
|
else if (name.kind === 205 || name.kind === 160) {
|
|
69266
69909
|
var links = getNodeLinks(name);
|
|
69267
69910
|
if (links.resolvedSymbol) {
|
|
@@ -69284,7 +69927,8 @@ var ts;
|
|
|
69284
69927
|
}
|
|
69285
69928
|
else if (isTypeReferenceIdentifier(name)) {
|
|
69286
69929
|
var meaning = name.parent.kind === 177 ? 788968 : 1920;
|
|
69287
|
-
|
|
69930
|
+
var symbol = resolveEntityName(name, meaning, false, true);
|
|
69931
|
+
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
|
|
69288
69932
|
}
|
|
69289
69933
|
if (name.parent.kind === 176) {
|
|
69290
69934
|
return resolveEntityName(name, 1);
|
|
@@ -69486,7 +70130,7 @@ var ts;
|
|
|
69486
70130
|
var symbol = getSymbolAtLocation(node);
|
|
69487
70131
|
if (symbol) {
|
|
69488
70132
|
var declaredType = getDeclaredTypeOfSymbol(symbol);
|
|
69489
|
-
return declaredType
|
|
70133
|
+
return !isErrorType(declaredType) ? declaredType : getTypeOfSymbol(symbol);
|
|
69490
70134
|
}
|
|
69491
70135
|
}
|
|
69492
70136
|
if (ts.isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
|
|
@@ -69894,7 +70538,7 @@ var ts;
|
|
|
69894
70538
|
return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;
|
|
69895
70539
|
}
|
|
69896
70540
|
var type = getDeclaredTypeOfSymbol(typeSymbol);
|
|
69897
|
-
if (type
|
|
70541
|
+
if (isErrorType(type)) {
|
|
69898
70542
|
return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;
|
|
69899
70543
|
}
|
|
69900
70544
|
else if (type.flags & 3) {
|
|
@@ -70362,7 +71006,7 @@ var ts;
|
|
|
70362
71006
|
var helpersModule = resolveHelpersModule(sourceFile, location);
|
|
70363
71007
|
if (helpersModule !== unknownSymbol) {
|
|
70364
71008
|
var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers;
|
|
70365
|
-
for (var helper = 1; helper <=
|
|
71009
|
+
for (var helper = 1; helper <= 4194304; helper <<= 1) {
|
|
70366
71010
|
if (uncheckedHelpers & helper) {
|
|
70367
71011
|
var name = getHelperName(helper);
|
|
70368
71012
|
var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 111551);
|
|
@@ -70414,7 +71058,8 @@ var ts;
|
|
|
70414
71058
|
case 262144: return "__makeTemplateObject";
|
|
70415
71059
|
case 524288: return "__classPrivateFieldGet";
|
|
70416
71060
|
case 1048576: return "__classPrivateFieldSet";
|
|
70417
|
-
case 2097152: return "
|
|
71061
|
+
case 2097152: return "__classPrivateFieldIn";
|
|
71062
|
+
case 4194304: return "__createBinding";
|
|
70418
71063
|
default: return ts.Debug.fail("Unrecognized helper");
|
|
70419
71064
|
}
|
|
70420
71065
|
}
|
|
@@ -70838,6 +71483,11 @@ var ts;
|
|
|
70838
71483
|
if (!ts.isArrowFunction(node)) {
|
|
70839
71484
|
return false;
|
|
70840
71485
|
}
|
|
71486
|
+
if (node.typeParameters && !(ts.length(node.typeParameters) > 1 || node.typeParameters.hasTrailingComma || node.typeParameters[0].constraint)) {
|
|
71487
|
+
if (file && ts.fileExtensionIsOneOf(file.fileName, [".mts", ".cts"])) {
|
|
71488
|
+
grammarErrorOnNode(node.typeParameters[0], ts.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);
|
|
71489
|
+
}
|
|
71490
|
+
}
|
|
70841
71491
|
var equalsGreaterThanToken = node.equalsGreaterThanToken;
|
|
70842
71492
|
var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line;
|
|
70843
71493
|
var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line;
|
|
@@ -71150,8 +71800,8 @@ var ts;
|
|
|
71150
71800
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
71151
71801
|
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));
|
|
71152
71802
|
}
|
|
71153
|
-
if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) || languageVersion < 4) {
|
|
71154
|
-
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.
|
|
71803
|
+
if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
|
|
71804
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
|
|
71155
71805
|
}
|
|
71156
71806
|
}
|
|
71157
71807
|
}
|
|
@@ -71468,8 +72118,7 @@ var ts;
|
|
|
71468
72118
|
: ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
|
|
71469
72119
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
71470
72120
|
}
|
|
71471
|
-
|
|
71472
|
-
if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System &&
|
|
72121
|
+
if ((moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && moduleKind !== ts.ModuleKind.System &&
|
|
71473
72122
|
!(node.parent.parent.flags & 8388608) && ts.hasSyntacticModifier(node.parent.parent, 1)) {
|
|
71474
72123
|
checkESModuleMarker(node.name);
|
|
71475
72124
|
}
|
|
@@ -71766,7 +72415,7 @@ var ts;
|
|
|
71766
72415
|
}
|
|
71767
72416
|
function checkGrammarImportCallExpression(node) {
|
|
71768
72417
|
if (moduleKind === ts.ModuleKind.ES2015) {
|
|
71769
|
-
return grammarErrorOnNode(node, ts.Diagnostics.
|
|
72418
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_umd_node12_or_nodenext);
|
|
71770
72419
|
}
|
|
71771
72420
|
if (node.typeArguments) {
|
|
71772
72421
|
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_cannot_have_type_arguments);
|
|
@@ -75532,7 +76181,7 @@ var ts;
|
|
|
75532
76181
|
function transformSourceFile(node) {
|
|
75533
76182
|
var options = context.getCompilerOptions();
|
|
75534
76183
|
if (node.isDeclarationFile
|
|
75535
|
-
|| useDefineForClassFields && options
|
|
76184
|
+
|| useDefineForClassFields && ts.getEmitScriptTarget(options) === 99) {
|
|
75536
76185
|
return node;
|
|
75537
76186
|
}
|
|
75538
76187
|
var visited = ts.visitEachChild(node, visitor, context);
|
|
@@ -75622,8 +76271,25 @@ var ts;
|
|
|
75622
76271
|
if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
75623
76272
|
return node;
|
|
75624
76273
|
}
|
|
76274
|
+
if (ts.isStatement(node.parent)) {
|
|
76275
|
+
return node;
|
|
76276
|
+
}
|
|
75625
76277
|
return ts.setOriginalNode(factory.createIdentifier(""), node);
|
|
75626
76278
|
}
|
|
76279
|
+
function visitPrivateIdentifierInInExpression(node) {
|
|
76280
|
+
if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
76281
|
+
return node;
|
|
76282
|
+
}
|
|
76283
|
+
var privId = node.left;
|
|
76284
|
+
ts.Debug.assertNode(privId, ts.isPrivateIdentifier);
|
|
76285
|
+
ts.Debug.assert(node.operatorToken.kind === 101);
|
|
76286
|
+
var info = accessPrivateIdentifier(privId);
|
|
76287
|
+
if (info) {
|
|
76288
|
+
var receiver = ts.visitNode(node.right, visitor, ts.isExpression);
|
|
76289
|
+
return ts.setOriginalNode(context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node);
|
|
76290
|
+
}
|
|
76291
|
+
return ts.visitEachChild(node, visitor, context);
|
|
76292
|
+
}
|
|
75627
76293
|
function classElementVisitor(node) {
|
|
75628
76294
|
switch (node.kind) {
|
|
75629
76295
|
case 170:
|
|
@@ -75966,6 +76632,9 @@ var ts;
|
|
|
75966
76632
|
}
|
|
75967
76633
|
}
|
|
75968
76634
|
}
|
|
76635
|
+
if (node.operatorToken.kind === 101 && ts.isPrivateIdentifier(node.left)) {
|
|
76636
|
+
return visitPrivateIdentifierInInExpression(node);
|
|
76637
|
+
}
|
|
75969
76638
|
return ts.visitEachChild(node, visitor, context);
|
|
75970
76639
|
}
|
|
75971
76640
|
function createPrivateIdentifierAssignment(info, receiver, right, operator) {
|
|
@@ -78398,7 +79067,7 @@ var ts;
|
|
|
78398
79067
|
objectProperties = factory.createNull();
|
|
78399
79068
|
}
|
|
78400
79069
|
else {
|
|
78401
|
-
var target = compilerOptions
|
|
79070
|
+
var target = ts.getEmitScriptTarget(compilerOptions);
|
|
78402
79071
|
if (target && target >= 5) {
|
|
78403
79072
|
objectProperties = factory.createObjectLiteralExpression(ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) {
|
|
78404
79073
|
return isSpread ? ts.map(attrs, transformJsxSpreadAttributeToSpreadAssignment) : ts.map(attrs, transformJsxAttributeToObjectLiteralElement);
|
|
@@ -78547,7 +79216,8 @@ var ts;
|
|
|
78547
79216
|
}
|
|
78548
79217
|
}
|
|
78549
79218
|
function visitJsxExpression(node) {
|
|
78550
|
-
|
|
79219
|
+
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
79220
|
+
return node.dotDotDotToken ? factory.createSpreadElement(expression) : expression;
|
|
78551
79221
|
}
|
|
78552
79222
|
}
|
|
78553
79223
|
ts.transformJsx = transformJsx;
|
|
@@ -82823,7 +83493,7 @@ var ts;
|
|
|
82823
83493
|
case 348:
|
|
82824
83494
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
82825
83495
|
case 207:
|
|
82826
|
-
if (ts.isImportCall(node)) {
|
|
83496
|
+
if (ts.isImportCall(node) && currentSourceFile.impliedNodeFormat === undefined) {
|
|
82827
83497
|
return visitImportCallExpression(node);
|
|
82828
83498
|
}
|
|
82829
83499
|
break;
|
|
@@ -82994,7 +83664,7 @@ var ts;
|
|
|
82994
83664
|
}
|
|
82995
83665
|
}
|
|
82996
83666
|
var promise = factory.createNewExpression(factory.createIdentifier("Promise"), undefined, [func]);
|
|
82997
|
-
if (compilerOptions
|
|
83667
|
+
if (ts.getESModuleInterop(compilerOptions)) {
|
|
82998
83668
|
return factory.createCallExpression(factory.createPropertyAccessExpression(promise, factory.createIdentifier("then")), undefined, [emitHelpers().createImportStarCallbackHelper()]);
|
|
82999
83669
|
}
|
|
83000
83670
|
return promise;
|
|
@@ -83002,7 +83672,7 @@ var ts;
|
|
|
83002
83672
|
function createImportCallExpressionCommonJS(arg, containsLexicalThis) {
|
|
83003
83673
|
var promiseResolveCall = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Promise"), "resolve"), undefined, []);
|
|
83004
83674
|
var requireCall = factory.createCallExpression(factory.createIdentifier("require"), undefined, arg ? [arg] : []);
|
|
83005
|
-
if (compilerOptions
|
|
83675
|
+
if (ts.getESModuleInterop(compilerOptions)) {
|
|
83006
83676
|
requireCall = emitHelpers().createImportStarHelper(requireCall);
|
|
83007
83677
|
}
|
|
83008
83678
|
var func;
|
|
@@ -83018,7 +83688,7 @@ var ts;
|
|
|
83018
83688
|
return factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), undefined, [func]);
|
|
83019
83689
|
}
|
|
83020
83690
|
function getHelperExpressionForExport(node, innerExpr) {
|
|
83021
|
-
if (!compilerOptions
|
|
83691
|
+
if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864) {
|
|
83022
83692
|
return innerExpr;
|
|
83023
83693
|
}
|
|
83024
83694
|
if (ts.getExportNeedsImportStarHelper(node)) {
|
|
@@ -83027,7 +83697,7 @@ var ts;
|
|
|
83027
83697
|
return innerExpr;
|
|
83028
83698
|
}
|
|
83029
83699
|
function getHelperExpressionForImport(node, innerExpr) {
|
|
83030
|
-
if (!compilerOptions
|
|
83700
|
+
if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864) {
|
|
83031
83701
|
return innerExpr;
|
|
83032
83702
|
}
|
|
83033
83703
|
if (ts.getImportNeedsImportStarHelper(node)) {
|
|
@@ -83126,7 +83796,7 @@ var ts;
|
|
|
83126
83796
|
statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createCreateBindingHelper(generatedName, factory.createStringLiteralFromNode(specifier.propertyName || specifier.name), specifier.propertyName ? factory.createStringLiteralFromNode(specifier.name) : undefined)), specifier), specifier));
|
|
83127
83797
|
}
|
|
83128
83798
|
else {
|
|
83129
|
-
var exportNeedsImportDefault = !!compilerOptions
|
|
83799
|
+
var exportNeedsImportDefault = !!ts.getESModuleInterop(compilerOptions) &&
|
|
83130
83800
|
!(ts.getEmitFlags(node) & 67108864) &&
|
|
83131
83801
|
ts.idText(specifier.propertyName || specifier.name) === "default";
|
|
83132
83802
|
var exportedValue = factory.createPropertyAccessExpression(exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name);
|
|
@@ -84469,7 +85139,10 @@ var ts;
|
|
|
84469
85139
|
(function (ts) {
|
|
84470
85140
|
function transformECMAScriptModule(context) {
|
|
84471
85141
|
var factory = context.factory, emitHelpers = context.getEmitHelperFactory;
|
|
85142
|
+
var host = context.getEmitHost();
|
|
85143
|
+
var resolver = context.getEmitResolver();
|
|
84472
85144
|
var compilerOptions = context.getCompilerOptions();
|
|
85145
|
+
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
|
|
84473
85146
|
var previousOnEmitNode = context.onEmitNode;
|
|
84474
85147
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
84475
85148
|
context.onEmitNode = onEmitNode;
|
|
@@ -84477,13 +85150,21 @@ var ts;
|
|
|
84477
85150
|
context.enableEmitNotification(303);
|
|
84478
85151
|
context.enableSubstitution(79);
|
|
84479
85152
|
var helperNameSubstitutions;
|
|
85153
|
+
var currentSourceFile;
|
|
85154
|
+
var importRequireStatements;
|
|
84480
85155
|
return ts.chainBundle(context, transformSourceFile);
|
|
84481
85156
|
function transformSourceFile(node) {
|
|
84482
85157
|
if (node.isDeclarationFile) {
|
|
84483
85158
|
return node;
|
|
84484
85159
|
}
|
|
84485
85160
|
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
|
|
85161
|
+
currentSourceFile = node;
|
|
85162
|
+
importRequireStatements = undefined;
|
|
84486
85163
|
var result = updateExternalModule(node);
|
|
85164
|
+
currentSourceFile = undefined;
|
|
85165
|
+
if (importRequireStatements) {
|
|
85166
|
+
result = factory.updateSourceFile(result, ts.setTextRange(factory.createNodeArray(ts.insertStatementsAfterCustomPrologue(result.statements.slice(), importRequireStatements)), result.statements));
|
|
85167
|
+
}
|
|
84487
85168
|
if (!ts.isExternalModule(node) || ts.some(result.statements, ts.isExternalModuleIndicator)) {
|
|
84488
85169
|
return result;
|
|
84489
85170
|
}
|
|
@@ -84507,7 +85188,7 @@ var ts;
|
|
|
84507
85188
|
function visitor(node) {
|
|
84508
85189
|
switch (node.kind) {
|
|
84509
85190
|
case 264:
|
|
84510
|
-
return undefined;
|
|
85191
|
+
return ts.getEmitScriptTarget(compilerOptions) >= ts.ModuleKind.ES2020 ? visitImportEqualsDeclaration(node) : undefined;
|
|
84511
85192
|
case 270:
|
|
84512
85193
|
return visitExportAssignment(node);
|
|
84513
85194
|
case 271:
|
|
@@ -84516,6 +85197,44 @@ var ts;
|
|
|
84516
85197
|
}
|
|
84517
85198
|
return node;
|
|
84518
85199
|
}
|
|
85200
|
+
function createRequireCall(importNode) {
|
|
85201
|
+
var moduleName = ts.getExternalModuleNameLiteral(factory, importNode, ts.Debug.checkDefined(currentSourceFile), host, resolver, compilerOptions);
|
|
85202
|
+
var args = [];
|
|
85203
|
+
if (moduleName) {
|
|
85204
|
+
args.push(moduleName);
|
|
85205
|
+
}
|
|
85206
|
+
if (!importRequireStatements) {
|
|
85207
|
+
var createRequireName = factory.createUniqueName("_createRequire", 16 | 32);
|
|
85208
|
+
var importStatement = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamedImports([
|
|
85209
|
+
factory.createImportSpecifier(factory.createIdentifier("createRequire"), createRequireName)
|
|
85210
|
+
])), factory.createStringLiteral("module"));
|
|
85211
|
+
var requireHelperName = factory.createUniqueName("__require", 16 | 32);
|
|
85212
|
+
var requireStatement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
|
|
85213
|
+
factory.createVariableDeclaration(requireHelperName, undefined, undefined, factory.createCallExpression(factory.cloneNode(createRequireName), undefined, [
|
|
85214
|
+
factory.createPropertyAccessExpression(factory.createMetaProperty(100, factory.createIdentifier("meta")), factory.createIdentifier("url"))
|
|
85215
|
+
]))
|
|
85216
|
+
], languageVersion >= 2 ? 2 : 0));
|
|
85217
|
+
importRequireStatements = [importStatement, requireStatement];
|
|
85218
|
+
}
|
|
85219
|
+
var name = importRequireStatements[1].declarationList.declarations[0].name;
|
|
85220
|
+
ts.Debug.assertNode(name, ts.isIdentifier);
|
|
85221
|
+
return factory.createCallExpression(factory.cloneNode(name), undefined, args);
|
|
85222
|
+
}
|
|
85223
|
+
function visitImportEqualsDeclaration(node) {
|
|
85224
|
+
ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer.");
|
|
85225
|
+
var statements;
|
|
85226
|
+
statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
|
|
85227
|
+
factory.createVariableDeclaration(factory.cloneNode(node.name), undefined, undefined, createRequireCall(node))
|
|
85228
|
+
], languageVersion >= 2 ? 2 : 0)), node), node));
|
|
85229
|
+
statements = appendExportsOfImportEqualsDeclaration(statements, node);
|
|
85230
|
+
return ts.singleOrMany(statements);
|
|
85231
|
+
}
|
|
85232
|
+
function appendExportsOfImportEqualsDeclaration(statements, node) {
|
|
85233
|
+
if (ts.hasSyntacticModifier(node, 1)) {
|
|
85234
|
+
statements = ts.append(statements, factory.createExportDeclaration(undefined, undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(undefined, ts.idText(node.name))])));
|
|
85235
|
+
}
|
|
85236
|
+
return statements;
|
|
85237
|
+
}
|
|
84519
85238
|
function visitExportAssignment(node) {
|
|
84520
85239
|
return node.isExportEquals ? undefined : node;
|
|
84521
85240
|
}
|
|
@@ -84565,6 +85284,74 @@ var ts;
|
|
|
84565
85284
|
ts.transformECMAScriptModule = transformECMAScriptModule;
|
|
84566
85285
|
})(ts || (ts = {}));
|
|
84567
85286
|
var ts;
|
|
85287
|
+
(function (ts) {
|
|
85288
|
+
function transformNodeModule(context) {
|
|
85289
|
+
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
85290
|
+
var previousOnEmitNode = context.onEmitNode;
|
|
85291
|
+
var esmTransform = ts.transformECMAScriptModule(context);
|
|
85292
|
+
var esmOnSubstituteNode = context.onSubstituteNode;
|
|
85293
|
+
var esmOnEmitNode = context.onEmitNode;
|
|
85294
|
+
context.onSubstituteNode = previousOnSubstituteNode;
|
|
85295
|
+
context.onEmitNode = previousOnEmitNode;
|
|
85296
|
+
var cjsTransform = ts.transformModule(context);
|
|
85297
|
+
var cjsOnSubstituteNode = context.onSubstituteNode;
|
|
85298
|
+
var cjsOnEmitNode = context.onEmitNode;
|
|
85299
|
+
context.onSubstituteNode = onSubstituteNode;
|
|
85300
|
+
context.onEmitNode = onEmitNode;
|
|
85301
|
+
context.enableSubstitution(303);
|
|
85302
|
+
context.enableEmitNotification(303);
|
|
85303
|
+
var currentSourceFile;
|
|
85304
|
+
return transformSourceFileOrBundle;
|
|
85305
|
+
function onSubstituteNode(hint, node) {
|
|
85306
|
+
if (ts.isSourceFile(node)) {
|
|
85307
|
+
currentSourceFile = node;
|
|
85308
|
+
return previousOnSubstituteNode(hint, node);
|
|
85309
|
+
}
|
|
85310
|
+
else {
|
|
85311
|
+
if (!currentSourceFile) {
|
|
85312
|
+
return previousOnSubstituteNode(hint, node);
|
|
85313
|
+
}
|
|
85314
|
+
if (currentSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
|
|
85315
|
+
return esmOnSubstituteNode(hint, node);
|
|
85316
|
+
}
|
|
85317
|
+
return cjsOnSubstituteNode(hint, node);
|
|
85318
|
+
}
|
|
85319
|
+
}
|
|
85320
|
+
function onEmitNode(hint, node, emitCallback) {
|
|
85321
|
+
if (ts.isSourceFile(node)) {
|
|
85322
|
+
currentSourceFile = node;
|
|
85323
|
+
}
|
|
85324
|
+
if (!currentSourceFile) {
|
|
85325
|
+
return previousOnEmitNode(hint, node, emitCallback);
|
|
85326
|
+
}
|
|
85327
|
+
if (currentSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
|
|
85328
|
+
return esmOnEmitNode(hint, node, emitCallback);
|
|
85329
|
+
}
|
|
85330
|
+
return cjsOnEmitNode(hint, node, emitCallback);
|
|
85331
|
+
}
|
|
85332
|
+
function getModuleTransformForFile(file) {
|
|
85333
|
+
return file.impliedNodeFormat === ts.ModuleKind.ESNext ? esmTransform : cjsTransform;
|
|
85334
|
+
}
|
|
85335
|
+
function transformSourceFile(node) {
|
|
85336
|
+
if (node.isDeclarationFile) {
|
|
85337
|
+
return node;
|
|
85338
|
+
}
|
|
85339
|
+
currentSourceFile = node;
|
|
85340
|
+
var result = getModuleTransformForFile(node)(node);
|
|
85341
|
+
currentSourceFile = undefined;
|
|
85342
|
+
ts.Debug.assert(ts.isSourceFile(result));
|
|
85343
|
+
return result;
|
|
85344
|
+
}
|
|
85345
|
+
function transformSourceFileOrBundle(node) {
|
|
85346
|
+
return node.kind === 303 ? transformSourceFile(node) : transformBundle(node);
|
|
85347
|
+
}
|
|
85348
|
+
function transformBundle(node) {
|
|
85349
|
+
return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
|
|
85350
|
+
}
|
|
85351
|
+
}
|
|
85352
|
+
ts.transformNodeModule = transformNodeModule;
|
|
85353
|
+
})(ts || (ts = {}));
|
|
85354
|
+
var ts;
|
|
84568
85355
|
(function (ts) {
|
|
84569
85356
|
function canProduceDiagnostics(node) {
|
|
84570
85357
|
return ts.isVariableDeclaration(node) ||
|
|
@@ -86218,6 +87005,9 @@ var ts;
|
|
|
86218
87005
|
return ts.transformECMAScriptModule;
|
|
86219
87006
|
case ts.ModuleKind.System:
|
|
86220
87007
|
return ts.transformSystemModule;
|
|
87008
|
+
case ts.ModuleKind.Node12:
|
|
87009
|
+
case ts.ModuleKind.NodeNext:
|
|
87010
|
+
return ts.transformNodeModule;
|
|
86221
87011
|
default:
|
|
86222
87012
|
return ts.transformModule;
|
|
86223
87013
|
}
|
|
@@ -86714,7 +87504,7 @@ var ts;
|
|
|
86714
87504
|
return getOutputPathsForBundle(options, forceDtsPaths);
|
|
86715
87505
|
}
|
|
86716
87506
|
else {
|
|
86717
|
-
var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile, options));
|
|
87507
|
+
var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options));
|
|
86718
87508
|
var isJsonFile = ts.isJsonSourceFile(sourceFile);
|
|
86719
87509
|
var isJsonEmittedToSameLocation = isJsonFile &&
|
|
86720
87510
|
ts.comparePaths(sourceFile.fileName, ownOutputFilePath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0;
|
|
@@ -86729,21 +87519,12 @@ var ts;
|
|
|
86729
87519
|
function getSourceMapFilePath(jsFilePath, options) {
|
|
86730
87520
|
return (options.sourceMap && !options.inlineSourceMap) ? jsFilePath + ".map" : undefined;
|
|
86731
87521
|
}
|
|
86732
|
-
function getOutputExtension(
|
|
86733
|
-
|
|
86734
|
-
|
|
86735
|
-
|
|
86736
|
-
|
|
86737
|
-
|
|
86738
|
-
if (ts.fileExtensionIs(sourceFile.fileName, ".jsx")) {
|
|
86739
|
-
return ".jsx";
|
|
86740
|
-
}
|
|
86741
|
-
}
|
|
86742
|
-
else if (sourceFile.languageVariant === 1) {
|
|
86743
|
-
return ".jsx";
|
|
86744
|
-
}
|
|
86745
|
-
}
|
|
86746
|
-
return ".js";
|
|
87522
|
+
function getOutputExtension(fileName, options) {
|
|
87523
|
+
return ts.fileExtensionIs(fileName, ".json") ? ".json" :
|
|
87524
|
+
options.jsx === 1 && ts.fileExtensionIsOneOf(fileName, [".jsx", ".tsx"]) ? ".jsx" :
|
|
87525
|
+
ts.fileExtensionIsOneOf(fileName, [".mts", ".mjs"]) ? ".mjs" :
|
|
87526
|
+
ts.fileExtensionIsOneOf(fileName, [".cts", ".cjs"]) ? ".cjs" :
|
|
87527
|
+
".js";
|
|
86747
87528
|
}
|
|
86748
87529
|
ts.getOutputExtension = getOutputExtension;
|
|
86749
87530
|
function getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, outputDir, getCommonSourceDirectory) {
|
|
@@ -86752,19 +87533,14 @@ var ts;
|
|
|
86752
87533
|
inputFileName;
|
|
86753
87534
|
}
|
|
86754
87535
|
function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory) {
|
|
86755
|
-
ts.
|
|
86756
|
-
return ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir, getCommonSourceDirectory), ".d.ts");
|
|
87536
|
+
return ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir, getCommonSourceDirectory), ts.getDeclarationEmitExtensionForPath(inputFileName));
|
|
86757
87537
|
}
|
|
86758
87538
|
ts.getOutputDeclarationFileName = getOutputDeclarationFileName;
|
|
86759
87539
|
function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory) {
|
|
86760
87540
|
if (configFile.options.emitDeclarationOnly)
|
|
86761
87541
|
return undefined;
|
|
86762
87542
|
var isJsonFile = ts.fileExtensionIs(inputFileName, ".json");
|
|
86763
|
-
var outputFileName = ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir, getCommonSourceDirectory),
|
|
86764
|
-
".json" :
|
|
86765
|
-
configFile.options.jsx === 1 && (ts.fileExtensionIs(inputFileName, ".tsx") || ts.fileExtensionIs(inputFileName, ".jsx")) ?
|
|
86766
|
-
".jsx" :
|
|
86767
|
-
".js");
|
|
87543
|
+
var outputFileName = ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir, getCommonSourceDirectory), getOutputExtension(inputFileName, configFile.options));
|
|
86768
87544
|
return !isJsonFile || ts.comparePaths(inputFileName, outputFileName, ts.Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 ?
|
|
86769
87545
|
outputFileName :
|
|
86770
87546
|
undefined;
|
|
@@ -86828,7 +87604,7 @@ var ts;
|
|
|
86828
87604
|
ts.getCommonSourceDirectory = getCommonSourceDirectory;
|
|
86829
87605
|
function getCommonSourceDirectoryOfConfig(_a, ignoreCase) {
|
|
86830
87606
|
var options = _a.options, fileNames = _a.fileNames;
|
|
86831
|
-
return getCommonSourceDirectory(options, function () { return ts.filter(fileNames, function (file) { return !(options.noEmitForJsFiles && ts.fileExtensionIsOneOf(file, ts.
|
|
87607
|
+
return getCommonSourceDirectory(options, function () { return ts.filter(fileNames, function (file) { return !(options.noEmitForJsFiles && ts.fileExtensionIsOneOf(file, ts.supportedJSExtensionsFlat)) && !ts.fileExtensionIs(file, ".d.ts"); }); }, ts.getDirectoryPath(ts.normalizeSlashes(ts.Debug.checkDefined(options.configFilePath))), ts.createGetCanonicalFileName(!ignoreCase));
|
|
86832
87608
|
}
|
|
86833
87609
|
ts.getCommonSourceDirectoryOfConfig = getCommonSourceDirectoryOfConfig;
|
|
86834
87610
|
function getAllProjectOutputs(configFile, ignoreCase) {
|
|
@@ -88014,6 +88790,8 @@ var ts;
|
|
|
88014
88790
|
return emitLiteral(node, false);
|
|
88015
88791
|
case 79:
|
|
88016
88792
|
return emitIdentifier(node);
|
|
88793
|
+
case 80:
|
|
88794
|
+
return emitPrivateIdentifier(node);
|
|
88017
88795
|
case 203:
|
|
88018
88796
|
return emitArrayLiteralExpression(node);
|
|
88019
88797
|
case 204:
|
|
@@ -91604,7 +92382,7 @@ var ts;
|
|
|
91604
92382
|
if (options.declarationDir)
|
|
91605
92383
|
return false;
|
|
91606
92384
|
}
|
|
91607
|
-
else if (!ts.fileExtensionIsOneOf(fileOrDirectoryPath, ts.
|
|
92385
|
+
else if (!ts.fileExtensionIsOneOf(fileOrDirectoryPath, ts.supportedJSExtensionsFlat)) {
|
|
91608
92386
|
return false;
|
|
91609
92387
|
}
|
|
91610
92388
|
var filePathWithoutExtension = ts.removeFileExtension(fileOrDirectoryPath);
|
|
@@ -92187,6 +92965,48 @@ var ts;
|
|
|
92187
92965
|
return resolutions;
|
|
92188
92966
|
}
|
|
92189
92967
|
ts.loadWithLocalCache = loadWithLocalCache;
|
|
92968
|
+
;
|
|
92969
|
+
function getModeForResolutionAtIndex(file, index) {
|
|
92970
|
+
if (file.impliedNodeFormat === undefined)
|
|
92971
|
+
return undefined;
|
|
92972
|
+
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
92973
|
+
}
|
|
92974
|
+
ts.getModeForResolutionAtIndex = getModeForResolutionAtIndex;
|
|
92975
|
+
function getModeForUsageLocation(file, usage) {
|
|
92976
|
+
var _a;
|
|
92977
|
+
if (file.impliedNodeFormat === undefined)
|
|
92978
|
+
return undefined;
|
|
92979
|
+
if (file.impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
92980
|
+
return ts.isImportCall(ts.walkUpParenthesizedExpressions(usage.parent)) ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
92981
|
+
}
|
|
92982
|
+
var exprParentParent = (_a = ts.walkUpParenthesizedExpressions(usage.parent)) === null || _a === void 0 ? void 0 : _a.parent;
|
|
92983
|
+
return exprParentParent && ts.isImportEqualsDeclaration(exprParentParent) ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
92984
|
+
}
|
|
92985
|
+
ts.getModeForUsageLocation = getModeForUsageLocation;
|
|
92986
|
+
function loadWithModeAwareCache(names, containingFile, containingFileName, redirectedReference, loader) {
|
|
92987
|
+
if (names.length === 0) {
|
|
92988
|
+
return [];
|
|
92989
|
+
}
|
|
92990
|
+
var resolutions = [];
|
|
92991
|
+
var cache = new ts.Map();
|
|
92992
|
+
var i = 0;
|
|
92993
|
+
for (var _i = 0, names_3 = names; _i < names_3.length; _i++) {
|
|
92994
|
+
var name = names_3[_i];
|
|
92995
|
+
var result = void 0;
|
|
92996
|
+
var mode = getModeForResolutionAtIndex(containingFile, i);
|
|
92997
|
+
i++;
|
|
92998
|
+
var cacheKey = mode !== undefined ? mode + "|" + name : name;
|
|
92999
|
+
if (cache.has(cacheKey)) {
|
|
93000
|
+
result = cache.get(cacheKey);
|
|
93001
|
+
}
|
|
93002
|
+
else {
|
|
93003
|
+
cache.set(cacheKey, result = loader(name, mode, containingFileName, redirectedReference));
|
|
93004
|
+
}
|
|
93005
|
+
resolutions.push(result);
|
|
93006
|
+
}
|
|
93007
|
+
return resolutions;
|
|
93008
|
+
}
|
|
93009
|
+
ts.loadWithModeAwareCache = loadWithModeAwareCache;
|
|
92190
93010
|
function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
|
|
92191
93011
|
return forEachProjectReference(undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); });
|
|
92192
93012
|
}
|
|
@@ -92238,7 +93058,7 @@ var ts;
|
|
|
92238
93058
|
switch (kind) {
|
|
92239
93059
|
case ts.FileIncludeKind.Import:
|
|
92240
93060
|
var importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
92241
|
-
packageId = (_e = (_d = file.resolvedModules) === null || _d === void 0 ? void 0 : _d.get(importLiteral.text)) === null || _e === void 0 ? void 0 : _e.packageId;
|
|
93061
|
+
packageId = (_e = (_d = file.resolvedModules) === null || _d === void 0 ? void 0 : _d.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) === null || _e === void 0 ? void 0 : _e.packageId;
|
|
92242
93062
|
if (importLiteral.pos === -1)
|
|
92243
93063
|
return { file: file, packageId: packageId, text: importLiteral.text };
|
|
92244
93064
|
pos = ts.skipTrivia(file.text, importLiteral.pos);
|
|
@@ -92249,7 +93069,7 @@ var ts;
|
|
|
92249
93069
|
break;
|
|
92250
93070
|
case ts.FileIncludeKind.TypeReferenceDirective:
|
|
92251
93071
|
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end);
|
|
92252
|
-
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName))) === null || _g === void 0 ? void 0 : _g.packageId;
|
|
93072
|
+
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), getModeForResolutionAtIndex(file, index))) === null || _g === void 0 ? void 0 : _g.packageId;
|
|
92253
93073
|
break;
|
|
92254
93074
|
case ts.FileIncludeKind.LibReferenceDirective:
|
|
92255
93075
|
(_c = file.libReferenceDirectives[index], pos = _c.pos, end = _c.end);
|
|
@@ -92316,6 +93136,23 @@ var ts;
|
|
|
92316
93136
|
configFileParseResult.errors;
|
|
92317
93137
|
}
|
|
92318
93138
|
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
|
|
93139
|
+
function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) {
|
|
93140
|
+
switch (ts.getEmitModuleResolutionKind(options)) {
|
|
93141
|
+
case ts.ModuleResolutionKind.Node12:
|
|
93142
|
+
case ts.ModuleResolutionKind.NodeNext:
|
|
93143
|
+
return ts.fileExtensionIsOneOf(fileName, [".d.mts", ".mts", ".mjs"]) ? ts.ModuleKind.ESNext :
|
|
93144
|
+
ts.fileExtensionIsOneOf(fileName, [".d.cts", ".cts", ".cjs"]) ? ts.ModuleKind.CommonJS :
|
|
93145
|
+
ts.fileExtensionIsOneOf(fileName, [".d.ts", ".ts", ".tsx", ".js", ".jsx"]) ? lookupFromPackageJson() :
|
|
93146
|
+
undefined;
|
|
93147
|
+
default:
|
|
93148
|
+
return undefined;
|
|
93149
|
+
}
|
|
93150
|
+
function lookupFromPackageJson() {
|
|
93151
|
+
var scope = ts.getPackageScopeForPath(fileName, packageJsonInfoCache, host, options);
|
|
93152
|
+
return (scope === null || scope === void 0 ? void 0 : scope.packageJsonContent.type) === "module" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
93153
|
+
}
|
|
93154
|
+
}
|
|
93155
|
+
ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
|
|
92319
93156
|
function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
92320
93157
|
if (!program)
|
|
92321
93158
|
return false;
|
|
@@ -92331,7 +93168,7 @@ var ts;
|
|
|
92331
93168
|
};
|
|
92332
93169
|
}
|
|
92333
93170
|
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
92334
|
-
var _a, _b, _c;
|
|
93171
|
+
var _a, _b, _c, _d;
|
|
92335
93172
|
var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
92336
93173
|
var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences;
|
|
92337
93174
|
var oldProgram = createProgramOptions.oldProgram;
|
|
@@ -92363,7 +93200,7 @@ var ts;
|
|
|
92363
93200
|
var programDiagnostics = ts.createDiagnosticCollection();
|
|
92364
93201
|
var currentDirectory = host.getCurrentDirectory();
|
|
92365
93202
|
var supportedExtensions = ts.getSupportedExtensions(options);
|
|
92366
|
-
var supportedExtensionsWithJsonIfResolveJsonModule = ts.
|
|
93203
|
+
var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
|
|
92367
93204
|
var hasEmitBlockingDiagnostics = new ts.Map();
|
|
92368
93205
|
var _compilerOptionsObjectLiteralSyntax;
|
|
92369
93206
|
var moduleResolutionCache;
|
|
@@ -92371,7 +93208,7 @@ var ts;
|
|
|
92371
93208
|
var actualResolveModuleNamesWorker;
|
|
92372
93209
|
var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;
|
|
92373
93210
|
if (host.resolveModuleNames) {
|
|
92374
|
-
actualResolveModuleNamesWorker = function (moduleNames, containingFile, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames),
|
|
93211
|
+
actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function (resolved) {
|
|
92375
93212
|
if (!resolved || resolved.extension !== undefined) {
|
|
92376
93213
|
return resolved;
|
|
92377
93214
|
}
|
|
@@ -92379,11 +93216,12 @@ var ts;
|
|
|
92379
93216
|
withExtension.extension = ts.extensionFromPath(resolved.resolvedFileName);
|
|
92380
93217
|
return withExtension;
|
|
92381
93218
|
}); };
|
|
93219
|
+
moduleResolutionCache = (_a = host.getModuleResolutionCache) === null || _a === void 0 ? void 0 : _a.call(host);
|
|
92382
93220
|
}
|
|
92383
93221
|
else {
|
|
92384
93222
|
moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, getCanonicalFileName, options);
|
|
92385
|
-
var loader_1 = function (moduleName,
|
|
92386
|
-
actualResolveModuleNamesWorker = function (moduleNames, containingFile, _reusedNames, redirectedReference) { return
|
|
93223
|
+
var loader_1 = function (moduleName, resolverMode, containingFileName, redirectedReference) { return ts.resolveModuleName(moduleName, containingFileName, options, host, moduleResolutionCache, redirectedReference, resolverMode).resolvedModule; };
|
|
93224
|
+
actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, _reusedNames, redirectedReference) { return loadWithModeAwareCache(ts.Debug.checkEachDefined(moduleNames), containingFile, containingFileName, redirectedReference, loader_1); };
|
|
92387
93225
|
}
|
|
92388
93226
|
var actualResolveTypeReferenceDirectiveNamesWorker;
|
|
92389
93227
|
if (host.resolveTypeReferenceDirectives) {
|
|
@@ -92405,9 +93243,9 @@ var ts;
|
|
|
92405
93243
|
var projectReferenceRedirects;
|
|
92406
93244
|
var mapFromFileToProjectReferenceRedirects;
|
|
92407
93245
|
var mapFromToProjectReferenceRedirectSource;
|
|
92408
|
-
var useSourceOfProjectReferenceRedirect = !!((
|
|
93246
|
+
var useSourceOfProjectReferenceRedirect = !!((_b = host.useSourceOfProjectReferenceRedirect) === null || _b === void 0 ? void 0 : _b.call(host)) &&
|
|
92409
93247
|
!options.disableSourceOfProjectReferenceRedirect;
|
|
92410
|
-
var
|
|
93248
|
+
var _e = updateHostForUseSourceOfProjectReferenceRedirect({
|
|
92411
93249
|
compilerHost: host,
|
|
92412
93250
|
getSymlinkCache: getSymlinkCache,
|
|
92413
93251
|
useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect,
|
|
@@ -92415,7 +93253,8 @@ var ts;
|
|
|
92415
93253
|
getResolvedProjectReferences: getResolvedProjectReferences,
|
|
92416
93254
|
getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect,
|
|
92417
93255
|
forEachResolvedProjectReference: forEachResolvedProjectReference
|
|
92418
|
-
}), onProgramCreateComplete =
|
|
93256
|
+
}), onProgramCreateComplete = _e.onProgramCreateComplete, fileExists = _e.fileExists, directoryExists = _e.directoryExists;
|
|
93257
|
+
var readFile = host.readFile.bind(host);
|
|
92419
93258
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
|
|
92420
93259
|
var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
|
|
92421
93260
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -92470,7 +93309,7 @@ var ts;
|
|
|
92470
93309
|
var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
|
|
92471
93310
|
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
|
|
92472
93311
|
for (var i = 0; i < typeReferences.length; i++) {
|
|
92473
|
-
processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (
|
|
93312
|
+
processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
92474
93313
|
}
|
|
92475
93314
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
92476
93315
|
}
|
|
@@ -92575,9 +93414,10 @@ var ts;
|
|
|
92575
93414
|
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
|
|
92576
93415
|
emitBuildInfo: emitBuildInfo,
|
|
92577
93416
|
fileExists: fileExists,
|
|
93417
|
+
readFile: readFile,
|
|
92578
93418
|
directoryExists: directoryExists,
|
|
92579
93419
|
getSymlinkCache: getSymlinkCache,
|
|
92580
|
-
realpath: (
|
|
93420
|
+
realpath: (_d = host.realpath) === null || _d === void 0 ? void 0 : _d.bind(host),
|
|
92581
93421
|
useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },
|
|
92582
93422
|
getFileIncludeReasons: function () { return fileReasons; },
|
|
92583
93423
|
structureIsReused: structureIsReused,
|
|
@@ -92606,7 +93446,7 @@ var ts;
|
|
|
92606
93446
|
var redirectedReference = getRedirectReferenceForResolution(containingFile);
|
|
92607
93447
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "resolveModuleNamesWorker", { containingFileName: containingFileName });
|
|
92608
93448
|
ts.performance.mark("beforeResolveModule");
|
|
92609
|
-
var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference);
|
|
93449
|
+
var result = actualResolveModuleNamesWorker(moduleNames, containingFile, containingFileName, reusedNames, redirectedReference);
|
|
92610
93450
|
ts.performance.mark("afterResolveModule");
|
|
92611
93451
|
ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule");
|
|
92612
93452
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -92627,7 +93467,7 @@ var ts;
|
|
|
92627
93467
|
}
|
|
92628
93468
|
function getRedirectReferenceForResolution(file) {
|
|
92629
93469
|
var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName);
|
|
92630
|
-
if (redirect || !ts.
|
|
93470
|
+
if (redirect || !ts.fileExtensionIsOneOf(file.originalFileName, [".d.ts", ".d.cts", ".d.mts"]))
|
|
92631
93471
|
return redirect;
|
|
92632
93472
|
var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
92633
93473
|
if (resultFromDts)
|
|
@@ -92665,8 +93505,8 @@ var ts;
|
|
|
92665
93505
|
}
|
|
92666
93506
|
return ts.libs.length + 2;
|
|
92667
93507
|
}
|
|
92668
|
-
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {
|
|
92669
|
-
return moduleResolutionCache && ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache);
|
|
93508
|
+
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile, mode) {
|
|
93509
|
+
return moduleResolutionCache && ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache, mode);
|
|
92670
93510
|
}
|
|
92671
93511
|
function toPath(fileName) {
|
|
92672
93512
|
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
@@ -92697,9 +93537,11 @@ var ts;
|
|
|
92697
93537
|
var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
92698
93538
|
if (oldSourceFile !== file && file.resolvedModules) {
|
|
92699
93539
|
var result_14 = [];
|
|
93540
|
+
var i = 0;
|
|
92700
93541
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
92701
93542
|
var moduleName = moduleNames_1[_i];
|
|
92702
|
-
var resolvedModule = file.resolvedModules.get(moduleName);
|
|
93543
|
+
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
93544
|
+
i++;
|
|
92703
93545
|
result_14.push(resolvedModule);
|
|
92704
93546
|
}
|
|
92705
93547
|
return result_14;
|
|
@@ -92711,7 +93553,7 @@ var ts;
|
|
|
92711
93553
|
for (var i = 0; i < moduleNames.length; i++) {
|
|
92712
93554
|
var moduleName = moduleNames[i];
|
|
92713
93555
|
if (file === oldSourceFile && !hasInvalidatedResolution(oldSourceFile.path)) {
|
|
92714
|
-
var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName);
|
|
93556
|
+
var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName, getModeForResolutionAtIndex(oldSourceFile, i));
|
|
92715
93557
|
if (oldResolvedModule) {
|
|
92716
93558
|
if (ts.isTraceEnabled(options, host)) {
|
|
92717
93559
|
ts.trace(host, oldResolvedModule.packageId ?
|
|
@@ -92731,7 +93573,7 @@ var ts;
|
|
|
92731
93573
|
}
|
|
92732
93574
|
}
|
|
92733
93575
|
else {
|
|
92734
|
-
resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName);
|
|
93576
|
+
resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, i);
|
|
92735
93577
|
}
|
|
92736
93578
|
if (resolvesToAmbientModuleInNonModifiedFile) {
|
|
92737
93579
|
(result || (result = new Array(moduleNames.length)))[i] = predictedToResolveToAmbientModuleMarker;
|
|
@@ -92761,8 +93603,10 @@ var ts;
|
|
|
92761
93603
|
}
|
|
92762
93604
|
ts.Debug.assert(j === resolutions.length);
|
|
92763
93605
|
return result;
|
|
92764
|
-
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
92765
|
-
|
|
93606
|
+
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, index) {
|
|
93607
|
+
if (index >= ts.length(oldSourceFile === null || oldSourceFile === void 0 ? void 0 : oldSourceFile.imports) + ts.length(oldSourceFile === null || oldSourceFile === void 0 ? void 0 : oldSourceFile.moduleAugmentations))
|
|
93608
|
+
return false;
|
|
93609
|
+
var resolutionToFile = ts.getResolvedModule(oldSourceFile, moduleName, oldSourceFile && getModeForResolutionAtIndex(oldSourceFile, index));
|
|
92766
93610
|
var resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
92767
93611
|
if (resolutionToFile && resolvedFile) {
|
|
92768
93612
|
return false;
|
|
@@ -92824,8 +93668,8 @@ var ts;
|
|
|
92824
93668
|
for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {
|
|
92825
93669
|
var oldSourceFile = oldSourceFiles_2[_i];
|
|
92826
93670
|
var newSourceFile = host.getSourceFileByPath
|
|
92827
|
-
? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options
|
|
92828
|
-
: host.getSourceFile(oldSourceFile.fileName, options
|
|
93671
|
+
? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, ts.getEmitScriptTarget(options), undefined, shouldCreateNewSourceFile)
|
|
93672
|
+
: host.getSourceFile(oldSourceFile.fileName, ts.getEmitScriptTarget(options), undefined, shouldCreateNewSourceFile);
|
|
92829
93673
|
if (!newSourceFile) {
|
|
92830
93674
|
return 0;
|
|
92831
93675
|
}
|
|
@@ -92908,20 +93752,20 @@ var ts;
|
|
|
92908
93752
|
var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile;
|
|
92909
93753
|
var moduleNames = getModuleNames(newSourceFile);
|
|
92910
93754
|
var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
92911
|
-
var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo);
|
|
93755
|
+
var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, oldSourceFile, ts.moduleResolutionIsEqualTo);
|
|
92912
93756
|
if (resolutionsChanged) {
|
|
92913
93757
|
structureIsReused = 1;
|
|
92914
|
-
newSourceFile.resolvedModules = ts.
|
|
93758
|
+
newSourceFile.resolvedModules = ts.zipToModeAwareCache(newSourceFile, moduleNames, resolutions);
|
|
92915
93759
|
}
|
|
92916
93760
|
else {
|
|
92917
93761
|
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
|
92918
93762
|
}
|
|
92919
93763
|
var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });
|
|
92920
93764
|
var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
|
92921
|
-
var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo);
|
|
93765
|
+
var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
|
|
92922
93766
|
if (typeReferenceEesolutionsChanged) {
|
|
92923
93767
|
structureIsReused = 1;
|
|
92924
|
-
newSourceFile.resolvedTypeReferenceDirectiveNames = ts.
|
|
93768
|
+
newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
|
|
92925
93769
|
}
|
|
92926
93770
|
else {
|
|
92927
93771
|
newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
|
|
@@ -93482,6 +94326,7 @@ var ts;
|
|
|
93482
94326
|
if (ts.isAnyImportOrReExport(node)) {
|
|
93483
94327
|
var moduleNameExpr = ts.getExternalModuleName(node);
|
|
93484
94328
|
if (moduleNameExpr && ts.isStringLiteral(moduleNameExpr) && moduleNameExpr.text && (!inAmbientModule || !ts.isExternalModuleNameRelative(moduleNameExpr.text))) {
|
|
94329
|
+
ts.setParentRecursive(node, false);
|
|
93485
94330
|
imports = ts.append(imports, moduleNameExpr);
|
|
93486
94331
|
if (!usesUriStyleNodeCoreModules && currentNodeModulesDepth === 0 && !file.isDeclarationFile) {
|
|
93487
94332
|
usesUriStyleNodeCoreModules = ts.startsWith(moduleNameExpr.text, "node:");
|
|
@@ -93490,6 +94335,7 @@ var ts;
|
|
|
93490
94335
|
}
|
|
93491
94336
|
else if (ts.isModuleDeclaration(node)) {
|
|
93492
94337
|
if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasSyntacticModifier(node, 2) || file.isDeclarationFile)) {
|
|
94338
|
+
node.name.parent = node;
|
|
93493
94339
|
var nameText = ts.getTextOfIdentifierOrLiteral(node.name);
|
|
93494
94340
|
if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(nameText))) {
|
|
93495
94341
|
(moduleAugmentations || (moduleAugmentations = [])).push(node.name);
|
|
@@ -93514,12 +94360,15 @@ var ts;
|
|
|
93514
94360
|
while (r.exec(file.text) !== null) {
|
|
93515
94361
|
var node = getNodeAtPosition(file, r.lastIndex);
|
|
93516
94362
|
if (isJavaScriptFile && ts.isRequireCall(node, true)) {
|
|
94363
|
+
ts.setParentRecursive(node, false);
|
|
93517
94364
|
imports = ts.append(imports, node.arguments[0]);
|
|
93518
94365
|
}
|
|
93519
94366
|
else if (ts.isImportCall(node) && node.arguments.length >= 1 && ts.isStringLiteralLike(node.arguments[0])) {
|
|
94367
|
+
ts.setParentRecursive(node, false);
|
|
93520
94368
|
imports = ts.append(imports, node.arguments[0]);
|
|
93521
94369
|
}
|
|
93522
94370
|
else if (ts.isLiteralImportTypeNode(node)) {
|
|
94371
|
+
ts.setParentRecursive(node, false);
|
|
93523
94372
|
imports = ts.append(imports, node.argument.literal);
|
|
93524
94373
|
}
|
|
93525
94374
|
}
|
|
@@ -93553,13 +94402,13 @@ var ts;
|
|
|
93553
94402
|
function getSourceFileFromReferenceWorker(fileName, getSourceFile, fail, reason) {
|
|
93554
94403
|
if (ts.hasExtension(fileName)) {
|
|
93555
94404
|
var canonicalFileName_1 = host.getCanonicalFileName(fileName);
|
|
93556
|
-
if (!options.allowNonTsExtensions && !ts.forEach(supportedExtensionsWithJsonIfResolveJsonModule, function (extension) { return ts.fileExtensionIs(canonicalFileName_1, extension); })) {
|
|
94405
|
+
if (!options.allowNonTsExtensions && !ts.forEach(ts.flatten(supportedExtensionsWithJsonIfResolveJsonModule), function (extension) { return ts.fileExtensionIs(canonicalFileName_1, extension); })) {
|
|
93557
94406
|
if (fail) {
|
|
93558
94407
|
if (ts.hasJSFileExtension(canonicalFileName_1)) {
|
|
93559
94408
|
fail(ts.Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, fileName);
|
|
93560
94409
|
}
|
|
93561
94410
|
else {
|
|
93562
|
-
fail(ts.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, "'" + supportedExtensions.join("', '") + "'");
|
|
94411
|
+
fail(ts.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, "'" + ts.flatten(supportedExtensions).join("', '") + "'");
|
|
93563
94412
|
}
|
|
93564
94413
|
}
|
|
93565
94414
|
return undefined;
|
|
@@ -93589,9 +94438,9 @@ var ts;
|
|
|
93589
94438
|
fail(ts.Diagnostics.File_0_not_found, fileName);
|
|
93590
94439
|
return undefined;
|
|
93591
94440
|
}
|
|
93592
|
-
var sourceFileWithAddedExtension = ts.forEach(supportedExtensions, function (extension) { return getSourceFile(fileName + extension); });
|
|
94441
|
+
var sourceFileWithAddedExtension = ts.forEach(supportedExtensions[0], function (extension) { return getSourceFile(fileName + extension); });
|
|
93593
94442
|
if (fail && !sourceFileWithAddedExtension)
|
|
93594
|
-
fail(ts.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + supportedExtensions.join("', '") + "'");
|
|
94443
|
+
fail(ts.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + ts.flatten(supportedExtensions).join("', '") + "'");
|
|
93595
94444
|
return sourceFileWithAddedExtension;
|
|
93596
94445
|
}
|
|
93597
94446
|
}
|
|
@@ -93716,7 +94565,7 @@ var ts;
|
|
|
93716
94565
|
redirectedPath = toPath(redirect);
|
|
93717
94566
|
}
|
|
93718
94567
|
}
|
|
93719
|
-
var file = host.getSourceFile(fileName, options
|
|
94568
|
+
var file = host.getSourceFile(fileName, ts.getEmitScriptTarget(options), function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
|
|
93720
94569
|
if (packageId) {
|
|
93721
94570
|
var packageIdKey = ts.packageIdToString(packageId);
|
|
93722
94571
|
var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
|
|
@@ -93741,6 +94590,7 @@ var ts;
|
|
|
93741
94590
|
file.path = path;
|
|
93742
94591
|
file.resolvedPath = toPath(fileName);
|
|
93743
94592
|
file.originalFileName = originalFileName;
|
|
94593
|
+
file.impliedNodeFormat = getImpliedNodeFormatForFile(file.resolvedPath, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
|
|
93744
94594
|
addFileIncludeReason(file, reason);
|
|
93745
94595
|
if (host.useCaseSensitiveFileNames()) {
|
|
93746
94596
|
var pathLowerCase = ts.toFileNameLowerCase(path);
|
|
@@ -93919,7 +94769,7 @@ var ts;
|
|
|
93919
94769
|
i++;
|
|
93920
94770
|
}
|
|
93921
94771
|
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
|
|
93922
|
-
var localOverrideModuleResult = ts.resolveModuleName("@typescript/" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
94772
|
+
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
93923
94773
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
93924
94774
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
93925
94775
|
}
|
|
@@ -93958,7 +94808,7 @@ var ts;
|
|
|
93958
94808
|
var optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a = getRedirectReferenceForResolution(file)) === null || _a === void 0 ? void 0 : _a.commandLine.options : undefined) || options;
|
|
93959
94809
|
for (var index = 0; index < moduleNames.length; index++) {
|
|
93960
94810
|
var resolution = resolutions[index];
|
|
93961
|
-
ts.setResolvedModule(file, moduleNames[index], resolution);
|
|
94811
|
+
ts.setResolvedModule(file, moduleNames[index], resolution, getModeForResolutionAtIndex(file, index));
|
|
93962
94812
|
if (!resolution) {
|
|
93963
94813
|
continue;
|
|
93964
94814
|
}
|
|
@@ -94166,7 +95016,7 @@ var ts;
|
|
|
94166
95016
|
if (options.noImplicitUseStrict && ts.getStrictOptionValue(options, "alwaysStrict")) {
|
|
94167
95017
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict");
|
|
94168
95018
|
}
|
|
94169
|
-
var languageVersion = options
|
|
95019
|
+
var languageVersion = ts.getEmitScriptTarget(options);
|
|
94170
95020
|
var firstNonAmbientExternalModuleSourceFile = ts.find(files, function (f) { return ts.isExternalModule(f) && !f.isDeclarationFile; });
|
|
94171
95021
|
if (options.isolatedModules) {
|
|
94172
95022
|
if (options.module === ts.ModuleKind.None && languageVersion < 2) {
|
|
@@ -94410,7 +95260,7 @@ var ts;
|
|
|
94410
95260
|
message = ts.Diagnostics.File_is_library_specified_here;
|
|
94411
95261
|
break;
|
|
94412
95262
|
}
|
|
94413
|
-
var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === options
|
|
95263
|
+
var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === ts.getEmitScriptTarget(options) ? key : undefined; });
|
|
94414
95264
|
configFileNode = target ? getOptionsSyntaxByValue("target", target) : undefined;
|
|
94415
95265
|
message = ts.Diagnostics.File_is_default_library_for_target_specified_here;
|
|
94416
95266
|
break;
|
|
@@ -94573,7 +95423,7 @@ var ts;
|
|
|
94573
95423
|
if (options.outDir) {
|
|
94574
95424
|
return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
|
|
94575
95425
|
}
|
|
94576
|
-
if (ts.fileExtensionIsOneOf(filePath, ts.
|
|
95426
|
+
if (ts.fileExtensionIsOneOf(filePath, ts.supportedJSExtensionsFlat) || ts.fileExtensionIs(filePath, ".d.ts")) {
|
|
94577
95427
|
var filePathWithoutExtension = ts.removeFileExtension(filePath);
|
|
94578
95428
|
return !!getSourceFileByPath((filePathWithoutExtension + ".ts")) ||
|
|
94579
95429
|
!!getSourceFileByPath((filePathWithoutExtension + ".tsx"));
|
|
@@ -95037,7 +95887,7 @@ var ts;
|
|
|
95037
95887
|
}
|
|
95038
95888
|
}
|
|
95039
95889
|
}
|
|
95040
|
-
fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined });
|
|
95890
|
+
fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
|
|
95041
95891
|
}
|
|
95042
95892
|
return {
|
|
95043
95893
|
fileInfos: fileInfos,
|
|
@@ -95105,7 +95955,7 @@ var ts;
|
|
|
95105
95955
|
var emitOutput_1 = getFileEmitOutput(programOfThisState, sourceFile, true, cancellationToken, undefined, true);
|
|
95106
95956
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
95107
95957
|
if (firstDts_1) {
|
|
95108
|
-
ts.Debug.assert(ts.
|
|
95958
|
+
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts", ".d.mts", ".d.cts"]), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
|
|
95109
95959
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
95110
95960
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
95111
95961
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -95353,6 +96203,13 @@ var ts;
|
|
|
95353
96203
|
ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
|
|
95354
96204
|
state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
|
|
95355
96205
|
}
|
|
96206
|
+
if (useOldState) {
|
|
96207
|
+
ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
|
|
96208
|
+
if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
|
|
96209
|
+
state.changedFilesSet.add(sourceFilePath);
|
|
96210
|
+
}
|
|
96211
|
+
});
|
|
96212
|
+
}
|
|
95356
96213
|
state.buildInfoEmitPending = !!state.changedFilesSet.size;
|
|
95357
96214
|
return state;
|
|
95358
96215
|
}
|
|
@@ -95652,13 +96509,13 @@ var ts;
|
|
|
95652
96509
|
var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
|
|
95653
96510
|
return value.version === actualSignature ?
|
|
95654
96511
|
value.affectsGlobalScope ?
|
|
95655
|
-
{ version: value.version, signature: undefined, affectsGlobalScope: true } :
|
|
96512
|
+
{ version: value.version, signature: undefined, affectsGlobalScope: true, impliedFormat: value.impliedFormat } :
|
|
95656
96513
|
value.version :
|
|
95657
96514
|
actualSignature !== undefined ?
|
|
95658
96515
|
signature === undefined ?
|
|
95659
96516
|
value :
|
|
95660
|
-
{ version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope } :
|
|
95661
|
-
{ version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope };
|
|
96517
|
+
{ version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
|
|
96518
|
+
{ version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
|
|
95662
96519
|
});
|
|
95663
96520
|
var referencedMap;
|
|
95664
96521
|
if (state.referencedMap) {
|
|
@@ -96011,10 +96868,10 @@ var ts;
|
|
|
96011
96868
|
}
|
|
96012
96869
|
function toBuilderStateFileInfo(fileInfo) {
|
|
96013
96870
|
return ts.isString(fileInfo) ?
|
|
96014
|
-
{ version: fileInfo, signature: fileInfo, affectsGlobalScope: undefined } :
|
|
96871
|
+
{ version: fileInfo, signature: fileInfo, affectsGlobalScope: undefined, impliedFormat: undefined } :
|
|
96015
96872
|
ts.isString(fileInfo.signature) ?
|
|
96016
96873
|
fileInfo :
|
|
96017
|
-
{ version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope };
|
|
96874
|
+
{ version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
|
|
96018
96875
|
}
|
|
96019
96876
|
ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
|
|
96020
96877
|
function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
|
|
@@ -96314,14 +97171,14 @@ var ts;
|
|
|
96314
97171
|
}
|
|
96315
97172
|
function resolveNamesWithLocalCache(_a) {
|
|
96316
97173
|
var _b, _c, _d;
|
|
96317
|
-
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges;
|
|
97174
|
+
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges, containingSourceFile = _a.containingSourceFile;
|
|
96318
97175
|
var path = resolutionHost.toPath(containingFile);
|
|
96319
|
-
var resolutionsInFile = cache.get(path) || cache.set(path,
|
|
97176
|
+
var resolutionsInFile = cache.get(path) || cache.set(path, ts.createModeAwareCache()).get(path);
|
|
96320
97177
|
var dirPath = ts.getDirectoryPath(path);
|
|
96321
97178
|
var perDirectoryCache = perDirectoryCacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
|
|
96322
97179
|
var perDirectoryResolution = perDirectoryCache.get(dirPath);
|
|
96323
97180
|
if (!perDirectoryResolution) {
|
|
96324
|
-
perDirectoryResolution =
|
|
97181
|
+
perDirectoryResolution = ts.createModeAwareCache();
|
|
96325
97182
|
perDirectoryCache.set(dirPath, perDirectoryResolution);
|
|
96326
97183
|
}
|
|
96327
97184
|
var resolvedModules = [];
|
|
@@ -96332,15 +97189,18 @@ var ts;
|
|
|
96332
97189
|
var unmatchedRedirects = oldRedirect ?
|
|
96333
97190
|
!redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path :
|
|
96334
97191
|
!!redirectedReference;
|
|
96335
|
-
var seenNamesInFile =
|
|
96336
|
-
|
|
96337
|
-
|
|
96338
|
-
var
|
|
96339
|
-
|
|
97192
|
+
var seenNamesInFile = ts.createModeAwareCache();
|
|
97193
|
+
var i = 0;
|
|
97194
|
+
for (var _i = 0, names_4 = names; _i < names_4.length; _i++) {
|
|
97195
|
+
var name = names_4[_i];
|
|
97196
|
+
var mode = containingSourceFile ? ts.getModeForResolutionAtIndex(containingSourceFile, i) : undefined;
|
|
97197
|
+
i++;
|
|
97198
|
+
var resolution = resolutionsInFile.get(name, mode);
|
|
97199
|
+
if (!seenNamesInFile.has(name, mode) &&
|
|
96340
97200
|
unmatchedRedirects || !resolution || resolution.isInvalidated ||
|
|
96341
97201
|
(hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) {
|
|
96342
97202
|
var existingResolution = resolution;
|
|
96343
|
-
var resolutionInDirectory = perDirectoryResolution.get(name);
|
|
97203
|
+
var resolutionInDirectory = perDirectoryResolution.get(name, mode);
|
|
96344
97204
|
if (resolutionInDirectory) {
|
|
96345
97205
|
resolution = resolutionInDirectory;
|
|
96346
97206
|
var host = ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost;
|
|
@@ -96360,10 +97220,10 @@ var ts;
|
|
|
96360
97220
|
}
|
|
96361
97221
|
}
|
|
96362
97222
|
else {
|
|
96363
|
-
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference);
|
|
96364
|
-
perDirectoryResolution.set(name, resolution);
|
|
97223
|
+
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
|
|
97224
|
+
perDirectoryResolution.set(name, mode, resolution);
|
|
96365
97225
|
}
|
|
96366
|
-
resolutionsInFile.set(name, resolution);
|
|
97226
|
+
resolutionsInFile.set(name, mode, resolution);
|
|
96367
97227
|
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
|
|
96368
97228
|
if (existingResolution) {
|
|
96369
97229
|
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
@@ -96375,7 +97235,7 @@ var ts;
|
|
|
96375
97235
|
}
|
|
96376
97236
|
else {
|
|
96377
97237
|
var host = ((_d = resolutionHost.getCompilerHost) === null || _d === void 0 ? void 0 : _d.call(resolutionHost)) || resolutionHost;
|
|
96378
|
-
if (ts.isTraceEnabled(compilerOptions, host) && !seenNamesInFile.has(name)) {
|
|
97238
|
+
if (ts.isTraceEnabled(compilerOptions, host) && !seenNamesInFile.has(name, mode)) {
|
|
96379
97239
|
var resolved = getResolutionWithResolvedFileName(resolution);
|
|
96380
97240
|
ts.trace(host, loader === resolveModuleName ?
|
|
96381
97241
|
(resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ?
|
|
@@ -96391,13 +97251,13 @@ var ts;
|
|
|
96391
97251
|
}
|
|
96392
97252
|
}
|
|
96393
97253
|
ts.Debug.assert(resolution !== undefined && !resolution.isInvalidated);
|
|
96394
|
-
seenNamesInFile.set(name, true);
|
|
97254
|
+
seenNamesInFile.set(name, mode, true);
|
|
96395
97255
|
resolvedModules.push(getResolutionWithResolvedFileName(resolution));
|
|
96396
97256
|
}
|
|
96397
|
-
resolutionsInFile.forEach(function (resolution, name) {
|
|
96398
|
-
if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) {
|
|
97257
|
+
resolutionsInFile.forEach(function (resolution, name, mode) {
|
|
97258
|
+
if (!seenNamesInFile.has(name, mode) && !ts.contains(reusedNames, name)) {
|
|
96399
97259
|
stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName);
|
|
96400
|
-
resolutionsInFile.delete(name);
|
|
97260
|
+
resolutionsInFile.delete(name, mode);
|
|
96401
97261
|
}
|
|
96402
97262
|
});
|
|
96403
97263
|
return resolvedModules;
|
|
@@ -96431,7 +97291,7 @@ var ts;
|
|
|
96431
97291
|
shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; },
|
|
96432
97292
|
});
|
|
96433
97293
|
}
|
|
96434
|
-
function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) {
|
|
97294
|
+
function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, containingSourceFile) {
|
|
96435
97295
|
return resolveNamesWithLocalCache({
|
|
96436
97296
|
names: moduleNames,
|
|
96437
97297
|
containingFile: containingFile,
|
|
@@ -96443,11 +97303,14 @@ var ts;
|
|
|
96443
97303
|
shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); },
|
|
96444
97304
|
reusedNames: reusedNames,
|
|
96445
97305
|
logChanges: logChangesWhenResolvingModule,
|
|
97306
|
+
containingSourceFile: containingSourceFile,
|
|
96446
97307
|
});
|
|
96447
97308
|
}
|
|
96448
|
-
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {
|
|
97309
|
+
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile, resolutionMode) {
|
|
96449
97310
|
var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile));
|
|
96450
|
-
|
|
97311
|
+
if (!cache)
|
|
97312
|
+
return undefined;
|
|
97313
|
+
return cache.get(moduleName, resolutionMode);
|
|
96451
97314
|
}
|
|
96452
97315
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
96453
97316
|
return ts.endsWith(dirPath, "/node_modules/@types");
|
|
@@ -96781,7 +97644,7 @@ var ts;
|
|
|
96781
97644
|
(function (ts) {
|
|
96782
97645
|
var moduleSpecifiers;
|
|
96783
97646
|
(function (moduleSpecifiers_1) {
|
|
96784
|
-
function getPreferences(_a, compilerOptions, importingSourceFile) {
|
|
97647
|
+
function getPreferences(host, _a, compilerOptions, importingSourceFile) {
|
|
96785
97648
|
var importModuleSpecifierPreference = _a.importModuleSpecifierPreference, importModuleSpecifierEnding = _a.importModuleSpecifierEnding;
|
|
96786
97649
|
return {
|
|
96787
97650
|
relativePreference: importModuleSpecifierPreference === "relative" ? 0 :
|
|
@@ -96795,28 +97658,46 @@ var ts;
|
|
|
96795
97658
|
case "minimal": return 0;
|
|
96796
97659
|
case "index": return 1;
|
|
96797
97660
|
case "js": return 2;
|
|
96798
|
-
default: return usesJsExtensionOnImports(importingSourceFile) ? 2
|
|
97661
|
+
default: return usesJsExtensionOnImports(importingSourceFile) || isFormatRequiringExtensions(compilerOptions, importingSourceFile.path, host) ? 2
|
|
96799
97662
|
: ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeJs ? 1 : 0;
|
|
96800
97663
|
}
|
|
96801
97664
|
}
|
|
96802
97665
|
}
|
|
96803
|
-
function getPreferencesForUpdate(compilerOptions, oldImportSpecifier) {
|
|
97666
|
+
function getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host) {
|
|
96804
97667
|
return {
|
|
96805
97668
|
relativePreference: ts.isExternalModuleNameRelative(oldImportSpecifier) ? 0 : 1,
|
|
96806
|
-
ending: ts.hasJSFileExtension(oldImportSpecifier) ?
|
|
97669
|
+
ending: ts.hasJSFileExtension(oldImportSpecifier) || isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) ?
|
|
96807
97670
|
2 :
|
|
96808
97671
|
ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeJs || ts.endsWith(oldImportSpecifier, "index") ? 1 : 0,
|
|
96809
97672
|
};
|
|
96810
97673
|
}
|
|
97674
|
+
function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
|
|
97675
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
|
|
97676
|
+
&& ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
97677
|
+
return false;
|
|
97678
|
+
}
|
|
97679
|
+
return ts.getImpliedNodeFormatForFile(importingSourceFileName, undefined, getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
|
|
97680
|
+
}
|
|
97681
|
+
function getModuleResolutionHost(host) {
|
|
97682
|
+
var _a;
|
|
97683
|
+
return {
|
|
97684
|
+
fileExists: host.fileExists,
|
|
97685
|
+
readFile: ts.Debug.checkDefined(host.readFile),
|
|
97686
|
+
directoryExists: host.directoryExists,
|
|
97687
|
+
getCurrentDirectory: host.getCurrentDirectory,
|
|
97688
|
+
realpath: host.realpath,
|
|
97689
|
+
useCaseSensitiveFileNames: (_a = host.useCaseSensitiveFileNames) === null || _a === void 0 ? void 0 : _a.call(host),
|
|
97690
|
+
};
|
|
97691
|
+
}
|
|
96811
97692
|
function updateModuleSpecifier(compilerOptions, importingSourceFileName, toFileName, host, oldImportSpecifier) {
|
|
96812
|
-
var res = getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier), {});
|
|
97693
|
+
var res = getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {});
|
|
96813
97694
|
if (res === oldImportSpecifier)
|
|
96814
97695
|
return undefined;
|
|
96815
97696
|
return res;
|
|
96816
97697
|
}
|
|
96817
97698
|
moduleSpecifiers_1.updateModuleSpecifier = updateModuleSpecifier;
|
|
96818
97699
|
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host) {
|
|
96819
|
-
return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences({}, compilerOptions, importingSourceFile), {});
|
|
97700
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
|
|
96820
97701
|
}
|
|
96821
97702
|
moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier;
|
|
96822
97703
|
function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host, preferences) {
|
|
@@ -96868,7 +97749,7 @@ var ts;
|
|
|
96868
97749
|
moduleSpecifiers_1.getModuleSpecifiersWithCacheInfo = getModuleSpecifiersWithCacheInfo;
|
|
96869
97750
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences) {
|
|
96870
97751
|
var info = getInfo(importingSourceFile.path, host);
|
|
96871
|
-
var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
97752
|
+
var preferences = getPreferences(host, userPreferences, compilerOptions, importingSourceFile);
|
|
96872
97753
|
var existingSpecifier = ts.forEach(modulePaths, function (modulePath) { return ts.forEach(host.getFileIncludeReasons().get(ts.toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)), function (reason) {
|
|
96873
97754
|
if (reason.kind !== ts.FileIncludeKind.Import || reason.file !== importingSourceFile.path)
|
|
96874
97755
|
return undefined;
|
|
@@ -97236,7 +98117,7 @@ var ts;
|
|
|
97236
98117
|
function tryGetAnyFileFromPath(host, path) {
|
|
97237
98118
|
if (!host.fileExists)
|
|
97238
98119
|
return;
|
|
97239
|
-
var extensions = ts.getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 }]);
|
|
98120
|
+
var extensions = ts.flatten(ts.getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 }]));
|
|
97240
98121
|
for (var _i = 0, extensions_3 = extensions; _i < extensions_3.length; _i++) {
|
|
97241
98122
|
var e = extensions_3[_i];
|
|
97242
98123
|
var fullPath = path + e;
|
|
@@ -97294,9 +98175,11 @@ var ts;
|
|
|
97294
98175
|
});
|
|
97295
98176
|
}
|
|
97296
98177
|
function removeExtensionAndIndexPostFix(fileName, ending, options) {
|
|
97297
|
-
if (ts.
|
|
98178
|
+
if (ts.fileExtensionIsOneOf(fileName, [".json", ".mjs", ".cjs"]))
|
|
97298
98179
|
return fileName;
|
|
97299
98180
|
var noExtension = ts.removeFileExtension(fileName);
|
|
98181
|
+
if (ts.fileExtensionIsOneOf(fileName, [".d.mts", ".mts", ".d.cts", ".cts"]))
|
|
98182
|
+
return noExtension + getJSExtensionForFile(fileName, options);
|
|
97300
98183
|
switch (ending) {
|
|
97301
98184
|
case 0:
|
|
97302
98185
|
return ts.removeSuffix(noExtension, "/index");
|
|
@@ -97324,6 +98207,14 @@ var ts;
|
|
|
97324
98207
|
case ".jsx":
|
|
97325
98208
|
case ".json":
|
|
97326
98209
|
return ext;
|
|
98210
|
+
case ".d.mts":
|
|
98211
|
+
case ".mts":
|
|
98212
|
+
case ".mjs":
|
|
98213
|
+
return ".mjs";
|
|
98214
|
+
case ".d.cts":
|
|
98215
|
+
case ".cts":
|
|
98216
|
+
case ".cjs":
|
|
98217
|
+
return ".cjs";
|
|
97327
98218
|
default:
|
|
97328
98219
|
return undefined;
|
|
97329
98220
|
}
|
|
@@ -97577,7 +98468,7 @@ var ts;
|
|
|
97577
98468
|
case ts.FileIncludeKind.LibFile:
|
|
97578
98469
|
if (reason.index !== undefined)
|
|
97579
98470
|
return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Library_0_specified_in_compilerOptions, options.lib[reason.index]);
|
|
97580
|
-
var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === options
|
|
98471
|
+
var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === ts.getEmitScriptTarget(options) ? key : undefined; });
|
|
97581
98472
|
return ts.chainDiagnosticMessages(undefined, target ?
|
|
97582
98473
|
ts.Diagnostics.Default_library_for_target_0 :
|
|
97583
98474
|
ts.Diagnostics.Default_library, target);
|
|
@@ -97965,7 +98856,7 @@ var ts;
|
|
|
97965
98856
|
}
|
|
97966
98857
|
return host.resolveModuleNames.apply(host, args);
|
|
97967
98858
|
}) :
|
|
97968
|
-
(function (moduleNames, containingFile, reusedNames, redirectedReference) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference); });
|
|
98859
|
+
(function (moduleNames, containingFile, reusedNames, redirectedReference, _options, sourceFile) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, sourceFile); });
|
|
97969
98860
|
compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ?
|
|
97970
98861
|
(function () {
|
|
97971
98862
|
var args = [];
|
|
@@ -98611,10 +99502,11 @@ var ts;
|
|
|
98611
99502
|
var moduleResolutionCache = !compilerHost.resolveModuleNames ? ts.createModuleResolutionCache(currentDirectory, getCanonicalFileName) : undefined;
|
|
98612
99503
|
var typeReferenceDirectiveResolutionCache = !compilerHost.resolveTypeReferenceDirectives ? ts.createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, undefined, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()) : undefined;
|
|
98613
99504
|
if (!compilerHost.resolveModuleNames) {
|
|
98614
|
-
var loader_3 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, state.projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference).resolvedModule; };
|
|
98615
|
-
compilerHost.resolveModuleNames = function (moduleNames, containingFile, _reusedNames, redirectedReference) {
|
|
98616
|
-
return ts.
|
|
99505
|
+
var loader_3 = function (moduleName, resolverMode, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, state.projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference, resolverMode).resolvedModule; };
|
|
99506
|
+
compilerHost.resolveModuleNames = function (moduleNames, containingFile, _reusedNames, redirectedReference, _options, containingSourceFile) {
|
|
99507
|
+
return ts.loadWithModeAwareCache(ts.Debug.checkEachDefined(moduleNames), ts.Debug.checkDefined(containingSourceFile), containingFile, redirectedReference, loader_3);
|
|
98617
99508
|
};
|
|
99509
|
+
compilerHost.getModuleResolutionCache = function () { return moduleResolutionCache; };
|
|
98618
99510
|
}
|
|
98619
99511
|
if (!compilerHost.resolveTypeReferenceDirectives) {
|
|
98620
99512
|
var loader_4 = function (moduleName, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
|
|
@@ -99972,10 +100864,10 @@ var ts;
|
|
|
99972
100864
|
return "Definitions";
|
|
99973
100865
|
}
|
|
99974
100866
|
var path = file.path;
|
|
99975
|
-
if (ts.fileExtensionIsOneOf(path, ts.
|
|
100867
|
+
if (ts.fileExtensionIsOneOf(path, ts.supportedTSExtensionsFlat)) {
|
|
99976
100868
|
return "TypeScript";
|
|
99977
100869
|
}
|
|
99978
|
-
else if (ts.fileExtensionIsOneOf(path, ts.
|
|
100870
|
+
else if (ts.fileExtensionIsOneOf(path, ts.supportedJSExtensionsFlat)) {
|
|
99979
100871
|
return "JavaScript";
|
|
99980
100872
|
}
|
|
99981
100873
|
else if (ts.fileExtensionIs(path, ".json")) {
|