@typescript-deploys/pr-build 4.8.0-pr-50098-2 → 4.9.0-pr-50248-2
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 +11 -1
- package/lib/de/diagnosticMessages.generated.json +11 -1
- package/lib/es/diagnosticMessages.generated.json +11 -1
- package/lib/fr/diagnosticMessages.generated.json +11 -1
- package/lib/it/diagnosticMessages.generated.json +11 -1
- package/lib/ja/diagnosticMessages.generated.json +11 -1
- package/lib/ko/diagnosticMessages.generated.json +11 -1
- package/lib/lib.es2015.promise.d.ts +9 -4
- package/lib/lib.es2015.reflect.d.ts +25 -2
- package/lib/lib.es5.d.ts +15 -5
- package/lib/pl/diagnosticMessages.generated.json +11 -1
- package/lib/pt-br/diagnosticMessages.generated.json +11 -1
- package/lib/ru/diagnosticMessages.generated.json +11 -1
- package/lib/tr/diagnosticMessages.generated.json +11 -1
- package/lib/tsc.js +403 -205
- package/lib/tsserver.js +569 -264
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +569 -264
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +569 -264
- package/lib/typescriptServices.d.ts +1 -1
- package/lib/typescriptServices.js +569 -264
- package/lib/typingsInstaller.js +509 -236
- package/lib/zh-cn/diagnosticMessages.generated.json +11 -1
- package/lib/zh-tw/diagnosticMessages.generated.json +11 -1
- package/package.json +4 -1
package/lib/tsc.js
CHANGED
|
@@ -68,8 +68,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
68
68
|
};
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
|
-
ts.versionMajorMinor = "4.
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
71
|
+
ts.versionMajorMinor = "4.9";
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220810";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -759,15 +759,18 @@ var ts;
|
|
|
759
759
|
function insertSorted(array, insert, compare, allowDuplicates) {
|
|
760
760
|
if (array.length === 0) {
|
|
761
761
|
array.push(insert);
|
|
762
|
-
return;
|
|
762
|
+
return true;
|
|
763
763
|
}
|
|
764
764
|
var insertIndex = binarySearch(array, insert, identity, compare);
|
|
765
765
|
if (insertIndex < 0) {
|
|
766
766
|
array.splice(~insertIndex, 0, insert);
|
|
767
|
+
return true;
|
|
767
768
|
}
|
|
768
|
-
|
|
769
|
+
if (allowDuplicates) {
|
|
769
770
|
array.splice(insertIndex, 0, insert);
|
|
771
|
+
return true;
|
|
770
772
|
}
|
|
773
|
+
return false;
|
|
771
774
|
}
|
|
772
775
|
ts.insertSorted = insertSorted;
|
|
773
776
|
function sortAndDeduplicate(array, comparer, equalityComparer) {
|
|
@@ -5732,7 +5735,7 @@ var ts;
|
|
|
5732
5735
|
File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, ts.DiagnosticCategory.Message, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", "File is CommonJS module because '{0}' does not have field \"type\""),
|
|
5733
5736
|
File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, ts.DiagnosticCategory.Message, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"),
|
|
5734
5737
|
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."),
|
|
5735
|
-
|
|
5738
|
+
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_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 with 'require'. Use an ECMAScript import instead."),
|
|
5736
5739
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
5737
5740
|
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
5738
5741
|
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
@@ -5740,6 +5743,11 @@ var ts;
|
|
|
5740
5743
|
auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules."),
|
|
5741
5744
|
An_instantiation_expression_cannot_be_followed_by_a_property_access: diag(1477, ts.DiagnosticCategory.Error, "An_instantiation_expression_cannot_be_followed_by_a_property_access_1477", "An instantiation expression cannot be followed by a property access."),
|
|
5742
5745
|
Identifier_or_string_literal_expected: diag(1478, ts.DiagnosticCategory.Error, "Identifier_or_string_literal_expected_1478", "Identifier or string literal expected."),
|
|
5746
|
+
The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead: diag(1479, ts.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", "The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"{0}\")' call instead."),
|
|
5747
|
+
To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module: diag(1480, ts.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480", "To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ \"type\": \"module\" }`."),
|
|
5748
|
+
To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, ts.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", "To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `\"type\": \"module\"` to '{1}'."),
|
|
5749
|
+
To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, ts.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", "To convert this file to an ECMAScript module, add the field `\"type\": \"module\"` to '{0}'."),
|
|
5750
|
+
To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, ts.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", "To convert this file to an ECMAScript module, create a local package.json file with `{ \"type\": \"module\" }`."),
|
|
5743
5751
|
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."),
|
|
5744
5752
|
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."),
|
|
5745
5753
|
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),
|
|
@@ -17383,10 +17391,11 @@ var ts;
|
|
|
17383
17391
|
}
|
|
17384
17392
|
return parenthesizeLeftSideOfAccess(expression);
|
|
17385
17393
|
}
|
|
17386
|
-
function parenthesizeLeftSideOfAccess(expression) {
|
|
17394
|
+
function parenthesizeLeftSideOfAccess(expression, optionalChain) {
|
|
17387
17395
|
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
|
|
17388
17396
|
if (ts.isLeftHandSideExpression(emittedExpression)
|
|
17389
|
-
&& (emittedExpression.kind !== 209 || emittedExpression.arguments)
|
|
17397
|
+
&& (emittedExpression.kind !== 209 || emittedExpression.arguments)
|
|
17398
|
+
&& (optionalChain || !ts.isOptionalChain(emittedExpression))) {
|
|
17390
17399
|
return expression;
|
|
17391
17400
|
}
|
|
17392
17401
|
return ts.setTextRange(factory.createParenthesizedExpression(expression), expression);
|
|
@@ -18596,7 +18605,7 @@ var ts;
|
|
|
18596
18605
|
}
|
|
18597
18606
|
function createDecorator(expression) {
|
|
18598
18607
|
var node = createBaseNode(165);
|
|
18599
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
18608
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
18600
18609
|
node.transformFlags |=
|
|
18601
18610
|
propagateChildFlags(node.expression) |
|
|
18602
18611
|
1 |
|
|
@@ -19270,7 +19279,7 @@ var ts;
|
|
|
19270
19279
|
}
|
|
19271
19280
|
function createPropertyAccessExpression(expression, name) {
|
|
19272
19281
|
var node = createBaseExpression(206);
|
|
19273
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19282
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19274
19283
|
node.name = asName(name);
|
|
19275
19284
|
node.transformFlags =
|
|
19276
19285
|
propagateChildFlags(node.expression) |
|
|
@@ -19296,7 +19305,7 @@ var ts;
|
|
|
19296
19305
|
function createPropertyAccessChain(expression, questionDotToken, name) {
|
|
19297
19306
|
var node = createBaseExpression(206);
|
|
19298
19307
|
node.flags |= 32;
|
|
19299
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19308
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19300
19309
|
node.questionDotToken = questionDotToken;
|
|
19301
19310
|
node.name = asName(name);
|
|
19302
19311
|
node.transformFlags |=
|
|
@@ -19318,7 +19327,7 @@ var ts;
|
|
|
19318
19327
|
}
|
|
19319
19328
|
function createElementAccessExpression(expression, index) {
|
|
19320
19329
|
var node = createBaseExpression(207);
|
|
19321
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19330
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19322
19331
|
node.argumentExpression = asExpression(index);
|
|
19323
19332
|
node.transformFlags |=
|
|
19324
19333
|
propagateChildFlags(node.expression) |
|
|
@@ -19342,7 +19351,7 @@ var ts;
|
|
|
19342
19351
|
function createElementAccessChain(expression, questionDotToken, index) {
|
|
19343
19352
|
var node = createBaseExpression(207);
|
|
19344
19353
|
node.flags |= 32;
|
|
19345
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19354
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19346
19355
|
node.questionDotToken = questionDotToken;
|
|
19347
19356
|
node.argumentExpression = asExpression(index);
|
|
19348
19357
|
node.transformFlags |=
|
|
@@ -19362,7 +19371,7 @@ var ts;
|
|
|
19362
19371
|
}
|
|
19363
19372
|
function createCallExpression(expression, typeArguments, argumentsArray) {
|
|
19364
19373
|
var node = createBaseExpression(208);
|
|
19365
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19374
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19366
19375
|
node.typeArguments = asNodeArray(typeArguments);
|
|
19367
19376
|
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
|
|
19368
19377
|
node.transformFlags |=
|
|
@@ -19393,7 +19402,7 @@ var ts;
|
|
|
19393
19402
|
function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
|
|
19394
19403
|
var node = createBaseExpression(208);
|
|
19395
19404
|
node.flags |= 32;
|
|
19396
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19405
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19397
19406
|
node.questionDotToken = questionDotToken;
|
|
19398
19407
|
node.typeArguments = asNodeArray(typeArguments);
|
|
19399
19408
|
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
|
|
@@ -19444,7 +19453,7 @@ var ts;
|
|
|
19444
19453
|
}
|
|
19445
19454
|
function createTaggedTemplateExpression(tag, typeArguments, template) {
|
|
19446
19455
|
var node = createBaseExpression(210);
|
|
19447
|
-
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag);
|
|
19456
|
+
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
|
|
19448
19457
|
node.typeArguments = asNodeArray(typeArguments);
|
|
19449
19458
|
node.template = template;
|
|
19450
19459
|
node.transformFlags |=
|
|
@@ -19833,7 +19842,7 @@ var ts;
|
|
|
19833
19842
|
}
|
|
19834
19843
|
function createExpressionWithTypeArguments(expression, typeArguments) {
|
|
19835
19844
|
var node = createBaseNode(228);
|
|
19836
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19845
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19837
19846
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
19838
19847
|
node.transformFlags |=
|
|
19839
19848
|
propagateChildFlags(node.expression) |
|
|
@@ -19865,7 +19874,7 @@ var ts;
|
|
|
19865
19874
|
}
|
|
19866
19875
|
function createNonNullExpression(expression) {
|
|
19867
19876
|
var node = createBaseExpression(230);
|
|
19868
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19877
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19869
19878
|
node.transformFlags |=
|
|
19870
19879
|
propagateChildFlags(node.expression) |
|
|
19871
19880
|
1;
|
|
@@ -19882,7 +19891,7 @@ var ts;
|
|
|
19882
19891
|
function createNonNullChain(expression) {
|
|
19883
19892
|
var node = createBaseExpression(230);
|
|
19884
19893
|
node.flags |= 32;
|
|
19885
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19894
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19886
19895
|
node.transformFlags |=
|
|
19887
19896
|
propagateChildFlags(node.expression) |
|
|
19888
19897
|
1;
|
|
@@ -21725,7 +21734,7 @@ var ts;
|
|
|
21725
21734
|
}
|
|
21726
21735
|
else if (ts.getEmitFlags(callee) & 4096) {
|
|
21727
21736
|
thisArg = createVoidZero();
|
|
21728
|
-
target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee);
|
|
21737
|
+
target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee, false);
|
|
21729
21738
|
}
|
|
21730
21739
|
else if (ts.isPropertyAccessExpression(callee)) {
|
|
21731
21740
|
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
|
|
@@ -21751,7 +21760,7 @@ var ts;
|
|
|
21751
21760
|
}
|
|
21752
21761
|
else {
|
|
21753
21762
|
thisArg = createVoidZero();
|
|
21754
|
-
target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
21763
|
+
target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
21755
21764
|
}
|
|
21756
21765
|
return { target: target, thisArg: thisArg };
|
|
21757
21766
|
}
|
|
@@ -35521,15 +35530,15 @@ var ts;
|
|
|
35521
35530
|
}
|
|
35522
35531
|
ts.createModuleResolutionCache = createModuleResolutionCache;
|
|
35523
35532
|
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, directoryToModuleNameMap) {
|
|
35524
|
-
var
|
|
35533
|
+
var perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options)));
|
|
35525
35534
|
packageJsonInfoCache || (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName));
|
|
35526
|
-
return __assign(__assign(__assign({}, packageJsonInfoCache),
|
|
35535
|
+
return __assign(__assign(__assign({}, packageJsonInfoCache), perDirectoryResolutionCache), { clear: clear, clearAllExceptPackageJsonInfoCache: clearAllExceptPackageJsonInfoCache });
|
|
35527
35536
|
function clear() {
|
|
35528
35537
|
clearAllExceptPackageJsonInfoCache();
|
|
35529
35538
|
packageJsonInfoCache.clear();
|
|
35530
35539
|
}
|
|
35531
35540
|
function clearAllExceptPackageJsonInfoCache() {
|
|
35532
|
-
|
|
35541
|
+
perDirectoryResolutionCache.clear();
|
|
35533
35542
|
}
|
|
35534
35543
|
}
|
|
35535
35544
|
ts.createTypeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache;
|
|
@@ -37492,6 +37501,9 @@ var ts;
|
|
|
37492
37501
|
case 203:
|
|
37493
37502
|
bindBindingElementFlow(node);
|
|
37494
37503
|
break;
|
|
37504
|
+
case 164:
|
|
37505
|
+
bindParameterFlow(node);
|
|
37506
|
+
break;
|
|
37495
37507
|
case 205:
|
|
37496
37508
|
case 204:
|
|
37497
37509
|
case 296:
|
|
@@ -38186,15 +38198,32 @@ var ts;
|
|
|
38186
38198
|
}
|
|
38187
38199
|
}
|
|
38188
38200
|
function bindBindingElementFlow(node) {
|
|
38189
|
-
|
|
38190
|
-
|
|
38191
|
-
|
|
38192
|
-
|
|
38193
|
-
|
|
38201
|
+
bind(node.dotDotDotToken);
|
|
38202
|
+
bind(node.propertyName);
|
|
38203
|
+
bindInitializer(node.initializer);
|
|
38204
|
+
bind(node.name);
|
|
38205
|
+
}
|
|
38206
|
+
function bindParameterFlow(node) {
|
|
38207
|
+
bindEach(node.modifiers);
|
|
38208
|
+
bind(node.dotDotDotToken);
|
|
38209
|
+
bind(node.questionToken);
|
|
38210
|
+
bind(node.type);
|
|
38211
|
+
bindInitializer(node.initializer);
|
|
38212
|
+
bind(node.name);
|
|
38213
|
+
}
|
|
38214
|
+
function bindInitializer(node) {
|
|
38215
|
+
if (!node) {
|
|
38216
|
+
return;
|
|
38194
38217
|
}
|
|
38195
|
-
|
|
38196
|
-
|
|
38218
|
+
var entryFlow = currentFlow;
|
|
38219
|
+
bind(node);
|
|
38220
|
+
if (entryFlow === unreachableFlow || entryFlow === currentFlow) {
|
|
38221
|
+
return;
|
|
38197
38222
|
}
|
|
38223
|
+
var exitFlow = createBranchLabel();
|
|
38224
|
+
addAntecedent(exitFlow, entryFlow);
|
|
38225
|
+
addAntecedent(exitFlow, currentFlow);
|
|
38226
|
+
currentFlow = finishFlowLabel(exitFlow);
|
|
38198
38227
|
}
|
|
38199
38228
|
function bindJSDocTypeAlias(node) {
|
|
38200
38229
|
bind(node.tagName);
|
|
@@ -40840,7 +40869,7 @@ var ts;
|
|
|
40840
40869
|
if (unidirectional === void 0) { unidirectional = false; }
|
|
40841
40870
|
source.forEach(function (sourceSymbol, id) {
|
|
40842
40871
|
var targetSymbol = target.get(id);
|
|
40843
|
-
target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : sourceSymbol);
|
|
40872
|
+
target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : getMergedSymbol(sourceSymbol));
|
|
40844
40873
|
});
|
|
40845
40874
|
}
|
|
40846
40875
|
function mergeModuleAugmentation(moduleName) {
|
|
@@ -42118,10 +42147,6 @@ var ts;
|
|
|
42118
42147
|
checkExpressionCached(expression);
|
|
42119
42148
|
return getNodeLinks(expression).resolvedSymbol;
|
|
42120
42149
|
}
|
|
42121
|
-
function getTargetOfPropertyAssignment(node, dontRecursivelyResolve) {
|
|
42122
|
-
var expression = node.initializer;
|
|
42123
|
-
return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve);
|
|
42124
|
-
}
|
|
42125
42150
|
function getTargetOfAccessExpression(node, dontRecursivelyResolve) {
|
|
42126
42151
|
if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63)) {
|
|
42127
42152
|
return undefined;
|
|
@@ -42153,7 +42178,7 @@ var ts;
|
|
|
42153
42178
|
case 297:
|
|
42154
42179
|
return resolveEntityName(node.name, 111551 | 788968 | 1920, true, dontRecursivelyResolve);
|
|
42155
42180
|
case 296:
|
|
42156
|
-
return
|
|
42181
|
+
return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve);
|
|
42157
42182
|
case 207:
|
|
42158
42183
|
case 206:
|
|
42159
42184
|
return getTargetOfAccessExpression(node, dontRecursivelyResolve);
|
|
@@ -42491,7 +42516,34 @@ var ts;
|
|
|
42491
42516
|
var overrideClauseHost = ts.findAncestor(location, function (l) { return ts.isImportTypeNode(l) || ts.isExportDeclaration(l) || ts.isImportDeclaration(l); });
|
|
42492
42517
|
var overrideClause = overrideClauseHost && ts.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause;
|
|
42493
42518
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext && !ts.getResolutionModeOverrideForClause(overrideClause)) {
|
|
42494
|
-
|
|
42519
|
+
if (ts.findAncestor(location, ts.isImportEqualsDeclaration)) {
|
|
42520
|
+
error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
|
|
42521
|
+
}
|
|
42522
|
+
else {
|
|
42523
|
+
var diagnosticDetails = void 0;
|
|
42524
|
+
var ext = ts.tryGetExtensionFromPath(currentSourceFile.fileName);
|
|
42525
|
+
if (ext === ".ts" || ext === ".js" || ext === ".tsx" || ext === ".jsx") {
|
|
42526
|
+
var scope = currentSourceFile.packageJsonScope;
|
|
42527
|
+
var targetExt = ext === ".ts" ? ".mts" : ext === ".js" ? ".mjs" : undefined;
|
|
42528
|
+
if (scope && !scope.packageJsonContent.type) {
|
|
42529
|
+
if (targetExt) {
|
|
42530
|
+
diagnosticDetails = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1, targetExt, ts.combinePaths(scope.packageDirectory, "package.json"));
|
|
42531
|
+
}
|
|
42532
|
+
else {
|
|
42533
|
+
diagnosticDetails = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0, ts.combinePaths(scope.packageDirectory, "package.json"));
|
|
42534
|
+
}
|
|
42535
|
+
}
|
|
42536
|
+
else {
|
|
42537
|
+
if (targetExt) {
|
|
42538
|
+
diagnosticDetails = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module, targetExt);
|
|
42539
|
+
}
|
|
42540
|
+
else {
|
|
42541
|
+
diagnosticDetails = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module);
|
|
42542
|
+
}
|
|
42543
|
+
}
|
|
42544
|
+
}
|
|
42545
|
+
diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, ts.chainDiagnosticMessages(diagnosticDetails, ts.Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, moduleReference)));
|
|
42546
|
+
}
|
|
42495
42547
|
}
|
|
42496
42548
|
}
|
|
42497
42549
|
return getMergedSymbol(sourceFile.symbol);
|
|
@@ -46669,11 +46721,9 @@ var ts;
|
|
|
46669
46721
|
return getReturnTypeOfSignature(getterSignature);
|
|
46670
46722
|
}
|
|
46671
46723
|
}
|
|
46672
|
-
|
|
46673
|
-
|
|
46674
|
-
|
|
46675
|
-
return type_1;
|
|
46676
|
-
}
|
|
46724
|
+
var parameterTypeOfTypeTag = getParameterTypeOfTypeTag(func, declaration);
|
|
46725
|
+
if (parameterTypeOfTypeTag)
|
|
46726
|
+
return parameterTypeOfTypeTag;
|
|
46677
46727
|
var type = declaration.symbol.escapedName === "this" ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
|
|
46678
46728
|
if (type) {
|
|
46679
46729
|
return addOptionality(type, false, isOptional);
|
|
@@ -46964,7 +47014,7 @@ var ts;
|
|
|
46964
47014
|
(resolvedSymbol || symbol).exports.forEach(function (s, name) {
|
|
46965
47015
|
var _a;
|
|
46966
47016
|
var exportedMember = members_4.get(name);
|
|
46967
|
-
if (exportedMember && exportedMember !== s) {
|
|
47017
|
+
if (exportedMember && exportedMember !== s && !(s.flags & 2097152)) {
|
|
46968
47018
|
if (s.flags & 111551 && exportedMember.flags & 111551) {
|
|
46969
47019
|
if (s.valueDeclaration && exportedMember.valueDeclaration && ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
46970
47020
|
var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);
|
|
@@ -47178,8 +47228,8 @@ var ts;
|
|
|
47178
47228
|
if (typeNode === undefined) {
|
|
47179
47229
|
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
47180
47230
|
}
|
|
47181
|
-
var
|
|
47182
|
-
return isTypeAny(
|
|
47231
|
+
var type_1 = getTypeOfNode(typeNode);
|
|
47232
|
+
return isTypeAny(type_1) || type_1 === unknownType ? type_1 : errorType;
|
|
47183
47233
|
}
|
|
47184
47234
|
if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) {
|
|
47185
47235
|
if (!declaration.statements.length) {
|
|
@@ -47376,11 +47426,11 @@ var ts;
|
|
|
47376
47426
|
return errorType;
|
|
47377
47427
|
}
|
|
47378
47428
|
var exportEquals = getMergedSymbol(symbol.exports.get("export="));
|
|
47379
|
-
var
|
|
47429
|
+
var type_2 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);
|
|
47380
47430
|
if (!popTypeResolution()) {
|
|
47381
47431
|
return reportCircularityError(symbol);
|
|
47382
47432
|
}
|
|
47383
|
-
return
|
|
47433
|
+
return type_2;
|
|
47384
47434
|
}
|
|
47385
47435
|
}
|
|
47386
47436
|
var type = createObjectType(16, symbol);
|
|
@@ -49306,10 +49356,10 @@ var ts;
|
|
|
49306
49356
|
var baseTypes = [];
|
|
49307
49357
|
var different = false;
|
|
49308
49358
|
for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
|
|
49309
|
-
var
|
|
49310
|
-
var baseType = getBaseConstraint(
|
|
49359
|
+
var type_3 = types_7[_i];
|
|
49360
|
+
var baseType = getBaseConstraint(type_3);
|
|
49311
49361
|
if (baseType) {
|
|
49312
|
-
if (baseType !==
|
|
49362
|
+
if (baseType !== type_3) {
|
|
49313
49363
|
different = true;
|
|
49314
49364
|
}
|
|
49315
49365
|
baseTypes.push(baseType);
|
|
@@ -49990,7 +50040,10 @@ var ts;
|
|
|
49990
50040
|
continue;
|
|
49991
50041
|
}
|
|
49992
50042
|
}
|
|
49993
|
-
result.push(
|
|
50043
|
+
result.push((!ts.isFunctionExpressionOrArrowFunction(decl) &&
|
|
50044
|
+
!ts.isObjectLiteralMethod(decl) &&
|
|
50045
|
+
getSignatureOfTypeTag(decl)) ||
|
|
50046
|
+
getSignatureFromDeclaration(decl));
|
|
49994
50047
|
}
|
|
49995
50048
|
return result;
|
|
49996
50049
|
}
|
|
@@ -50021,7 +50074,7 @@ var ts;
|
|
|
50021
50074
|
else {
|
|
50022
50075
|
var type = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
|
|
50023
50076
|
var jsdocPredicate = void 0;
|
|
50024
|
-
if (!type
|
|
50077
|
+
if (!type) {
|
|
50025
50078
|
var jsdocSignature = getSignatureOfTypeTag(signature.declaration);
|
|
50026
50079
|
if (jsdocSignature && signature !== jsdocSignature) {
|
|
50027
50080
|
jsdocPredicate = getTypePredicateOfSignature(jsdocSignature);
|
|
@@ -52643,6 +52696,7 @@ var ts;
|
|
|
52643
52696
|
}
|
|
52644
52697
|
}
|
|
52645
52698
|
function getTypeFromImportTypeNode(node) {
|
|
52699
|
+
var _a;
|
|
52646
52700
|
var links = getNodeLinks(node);
|
|
52647
52701
|
if (!links.resolvedType) {
|
|
52648
52702
|
if (node.isTypeOf && node.typeArguments) {
|
|
@@ -52661,6 +52715,7 @@ var ts;
|
|
|
52661
52715
|
links.resolvedSymbol = unknownSymbol;
|
|
52662
52716
|
return links.resolvedType = errorType;
|
|
52663
52717
|
}
|
|
52718
|
+
var isExportEquals = !!((_a = innerModuleSymbol.exports) === null || _a === void 0 ? void 0 : _a.get("export="));
|
|
52664
52719
|
var moduleSymbol = resolveExternalModuleSymbol(innerModuleSymbol, false);
|
|
52665
52720
|
if (!ts.nodeIsMissing(node.qualifier)) {
|
|
52666
52721
|
var nameStack = getIdentifierChain(node.qualifier);
|
|
@@ -52669,9 +52724,11 @@ var ts;
|
|
|
52669
52724
|
while (current = nameStack.shift()) {
|
|
52670
52725
|
var meaning = nameStack.length ? 1920 : targetMeaning;
|
|
52671
52726
|
var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace));
|
|
52672
|
-
var
|
|
52727
|
+
var symbolFromVariable = node.isTypeOf || ts.isInJSFile(node) && isExportEquals
|
|
52673
52728
|
? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText, false, true)
|
|
52674
|
-
:
|
|
52729
|
+
: undefined;
|
|
52730
|
+
var symbolFromModule = node.isTypeOf ? undefined : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning);
|
|
52731
|
+
var next = symbolFromModule !== null && symbolFromModule !== void 0 ? symbolFromModule : symbolFromVariable;
|
|
52675
52732
|
if (!next) {
|
|
52676
52733
|
error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current));
|
|
52677
52734
|
return links.resolvedType = errorType;
|
|
@@ -53610,14 +53667,13 @@ var ts;
|
|
|
53610
53667
|
return false;
|
|
53611
53668
|
}
|
|
53612
53669
|
function isContextSensitiveFunctionLikeDeclaration(node) {
|
|
53613
|
-
return
|
|
53614
|
-
(ts.hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node));
|
|
53670
|
+
return ts.hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
|
|
53615
53671
|
}
|
|
53616
53672
|
function hasContextSensitiveReturnExpression(node) {
|
|
53617
53673
|
return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 235 && isContextSensitive(node.body);
|
|
53618
53674
|
}
|
|
53619
53675
|
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
|
|
53620
|
-
return (ts.
|
|
53676
|
+
return (ts.isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
|
|
53621
53677
|
isContextSensitiveFunctionLikeDeclaration(func);
|
|
53622
53678
|
}
|
|
53623
53679
|
function getTypeWithoutSignatures(type) {
|
|
@@ -55226,6 +55282,12 @@ var ts;
|
|
|
55226
55282
|
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
|
|
55227
55283
|
var saveErrorInfo = captureErrorCalculationState();
|
|
55228
55284
|
var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo);
|
|
55285
|
+
if (!result && (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576)) {
|
|
55286
|
+
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
|
|
55287
|
+
if (constraint && everyType(constraint, function (c) { return c !== source; })) {
|
|
55288
|
+
result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState);
|
|
55289
|
+
}
|
|
55290
|
+
}
|
|
55229
55291
|
if (result) {
|
|
55230
55292
|
resetErrorInfo(saveErrorInfo);
|
|
55231
55293
|
}
|
|
@@ -55282,14 +55344,6 @@ var ts;
|
|
|
55282
55344
|
if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
|
|
55283
55345
|
return result;
|
|
55284
55346
|
}
|
|
55285
|
-
if (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576) {
|
|
55286
|
-
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
|
|
55287
|
-
if (constraint && everyType(constraint, function (c) { return c !== source; })) {
|
|
55288
|
-
if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
|
|
55289
|
-
return result;
|
|
55290
|
-
}
|
|
55291
|
-
}
|
|
55292
|
-
}
|
|
55293
55347
|
if (!(sourceFlags & 465829888 ||
|
|
55294
55348
|
sourceFlags & 524288 && targetFlags & 1048576 ||
|
|
55295
55349
|
sourceFlags & 2097152 && targetFlags & (524288 | 1048576 | 465829888))) {
|
|
@@ -61177,12 +61231,15 @@ var ts;
|
|
|
61177
61231
|
if (contextualReturnType) {
|
|
61178
61232
|
var functionFlags = ts.getFunctionFlags(func);
|
|
61179
61233
|
if (functionFlags & 1) {
|
|
61180
|
-
var
|
|
61181
|
-
|
|
61182
|
-
|
|
61234
|
+
var isAsyncGenerator_1 = (functionFlags & 2) !== 0;
|
|
61235
|
+
if (contextualReturnType.flags & 1048576) {
|
|
61236
|
+
contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1, type, isAsyncGenerator_1); });
|
|
61237
|
+
}
|
|
61238
|
+
var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1, contextualReturnType, (functionFlags & 2) !== 0);
|
|
61239
|
+
if (!iterationReturnType) {
|
|
61183
61240
|
return undefined;
|
|
61184
61241
|
}
|
|
61185
|
-
contextualReturnType =
|
|
61242
|
+
contextualReturnType = iterationReturnType;
|
|
61186
61243
|
}
|
|
61187
61244
|
if (functionFlags & 2) {
|
|
61188
61245
|
var contextualAwaitedType = mapType(contextualReturnType, getAwaitedTypeNoAlias);
|
|
@@ -61207,9 +61264,13 @@ var ts;
|
|
|
61207
61264
|
var functionFlags = ts.getFunctionFlags(func);
|
|
61208
61265
|
var contextualReturnType = getContextualReturnType(func, contextFlags);
|
|
61209
61266
|
if (contextualReturnType) {
|
|
61267
|
+
var isAsyncGenerator_2 = (functionFlags & 2) !== 0;
|
|
61268
|
+
if (!node.asteriskToken && contextualReturnType.flags & 1048576) {
|
|
61269
|
+
contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1, type, isAsyncGenerator_2); });
|
|
61270
|
+
}
|
|
61210
61271
|
return node.asteriskToken
|
|
61211
61272
|
? contextualReturnType
|
|
61212
|
-
: getIterationTypeOfGeneratorFunctionReturnType(0, contextualReturnType,
|
|
61273
|
+
: getIterationTypeOfGeneratorFunctionReturnType(0, contextualReturnType, isAsyncGenerator_2);
|
|
61213
61274
|
}
|
|
61214
61275
|
}
|
|
61215
61276
|
return undefined;
|
|
@@ -62234,15 +62295,26 @@ var ts;
|
|
|
62234
62295
|
}
|
|
62235
62296
|
propertiesArray.push(member);
|
|
62236
62297
|
}
|
|
62237
|
-
if (contextualTypeHasPattern
|
|
62238
|
-
|
|
62239
|
-
|
|
62240
|
-
|
|
62241
|
-
|
|
62242
|
-
|
|
62298
|
+
if (contextualTypeHasPattern) {
|
|
62299
|
+
var rootPatternParent_1 = ts.findAncestor(contextualType.pattern.parent, function (n) {
|
|
62300
|
+
return n.kind === 254 ||
|
|
62301
|
+
n.kind === 221 ||
|
|
62302
|
+
n.kind === 164;
|
|
62303
|
+
});
|
|
62304
|
+
var spreadOrOutsideRootObject = ts.findAncestor(node, function (n) {
|
|
62305
|
+
return n === rootPatternParent_1 ||
|
|
62306
|
+
n.kind === 298;
|
|
62307
|
+
});
|
|
62308
|
+
if (spreadOrOutsideRootObject.kind !== 298) {
|
|
62309
|
+
for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) {
|
|
62310
|
+
var prop = _e[_d];
|
|
62311
|
+
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
62312
|
+
if (!(prop.flags & 16777216)) {
|
|
62313
|
+
error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
|
|
62314
|
+
}
|
|
62315
|
+
propertiesTable.set(prop.escapedName, prop);
|
|
62316
|
+
propertiesArray.push(prop);
|
|
62243
62317
|
}
|
|
62244
|
-
propertiesTable.set(prop.escapedName, prop);
|
|
62245
|
-
propertiesArray.push(prop);
|
|
62246
62318
|
}
|
|
62247
62319
|
}
|
|
62248
62320
|
}
|
|
@@ -65230,8 +65302,8 @@ var ts;
|
|
|
65230
65302
|
if (hasDefaultOnly && type && !isErrorType(type)) {
|
|
65231
65303
|
var synthType = type;
|
|
65232
65304
|
if (!synthType.defaultOnlyType) {
|
|
65233
|
-
var
|
|
65234
|
-
synthType.defaultOnlyType =
|
|
65305
|
+
var type_4 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
|
|
65306
|
+
synthType.defaultOnlyType = type_4;
|
|
65235
65307
|
}
|
|
65236
65308
|
return synthType.defaultOnlyType;
|
|
65237
65309
|
}
|
|
@@ -68960,7 +69032,9 @@ var ts;
|
|
|
68960
69032
|
}
|
|
68961
69033
|
if (isGenericObjectType(type)) {
|
|
68962
69034
|
var baseConstraint = getBaseConstraintOfType(type);
|
|
68963
|
-
if (
|
|
69035
|
+
if (baseConstraint ?
|
|
69036
|
+
baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || isThenableType(baseConstraint) :
|
|
69037
|
+
maybeTypeOfKind(type, 8650752)) {
|
|
68964
69038
|
return true;
|
|
68965
69039
|
}
|
|
68966
69040
|
}
|
|
@@ -70471,17 +70545,28 @@ var ts;
|
|
|
70471
70545
|
return type[cacheKey] = cachedTypes;
|
|
70472
70546
|
}
|
|
70473
70547
|
function getIterationTypesOfIterable(type, use, errorNode) {
|
|
70548
|
+
var _a, _b;
|
|
70474
70549
|
if (isTypeAny(type)) {
|
|
70475
70550
|
return anyIterationTypes;
|
|
70476
70551
|
}
|
|
70477
70552
|
if (!(type.flags & 1048576)) {
|
|
70478
|
-
var
|
|
70553
|
+
var errorOutputContainer = errorNode ? { errors: undefined } : undefined;
|
|
70554
|
+
var iterationTypes_1 = getIterationTypesOfIterableWorker(type, use, errorNode, errorOutputContainer);
|
|
70479
70555
|
if (iterationTypes_1 === noIterationTypes) {
|
|
70480
70556
|
if (errorNode) {
|
|
70481
|
-
reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70557
|
+
var rootDiag = reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70558
|
+
if (errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) {
|
|
70559
|
+
ts.addRelatedInfo.apply(void 0, __spreadArray([rootDiag], errorOutputContainer.errors, false));
|
|
70560
|
+
}
|
|
70482
70561
|
}
|
|
70483
70562
|
return undefined;
|
|
70484
70563
|
}
|
|
70564
|
+
else if ((_a = errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) === null || _a === void 0 ? void 0 : _a.length) {
|
|
70565
|
+
for (var _i = 0, _c = errorOutputContainer.errors; _i < _c.length; _i++) {
|
|
70566
|
+
var diag = _c[_i];
|
|
70567
|
+
diagnostics.add(diag);
|
|
70568
|
+
}
|
|
70569
|
+
}
|
|
70485
70570
|
return iterationTypes_1;
|
|
70486
70571
|
}
|
|
70487
70572
|
var cacheKey = use & 2 ? "iterationTypesOfAsyncIterable" : "iterationTypesOfIterable";
|
|
@@ -70489,19 +70574,27 @@ var ts;
|
|
|
70489
70574
|
if (cachedTypes)
|
|
70490
70575
|
return cachedTypes === noIterationTypes ? undefined : cachedTypes;
|
|
70491
70576
|
var allIterationTypes;
|
|
70492
|
-
for (var
|
|
70493
|
-
var constituent =
|
|
70494
|
-
var
|
|
70577
|
+
for (var _d = 0, _e = type.types; _d < _e.length; _d++) {
|
|
70578
|
+
var constituent = _e[_d];
|
|
70579
|
+
var errorOutputContainer = errorNode ? { errors: undefined } : undefined;
|
|
70580
|
+
var iterationTypes_2 = getIterationTypesOfIterableWorker(constituent, use, errorNode, errorOutputContainer);
|
|
70495
70581
|
if (iterationTypes_2 === noIterationTypes) {
|
|
70496
70582
|
if (errorNode) {
|
|
70497
|
-
reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70583
|
+
var rootDiag = reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70584
|
+
if (errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) {
|
|
70585
|
+
ts.addRelatedInfo.apply(void 0, __spreadArray([rootDiag], errorOutputContainer.errors, false));
|
|
70586
|
+
}
|
|
70498
70587
|
}
|
|
70499
70588
|
setCachedIterationTypes(type, cacheKey, noIterationTypes);
|
|
70500
70589
|
return undefined;
|
|
70501
70590
|
}
|
|
70502
|
-
else {
|
|
70503
|
-
|
|
70591
|
+
else if ((_b = errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) === null || _b === void 0 ? void 0 : _b.length) {
|
|
70592
|
+
for (var _f = 0, _g = errorOutputContainer.errors; _f < _g.length; _f++) {
|
|
70593
|
+
var diag = _g[_f];
|
|
70594
|
+
diagnostics.add(diag);
|
|
70595
|
+
}
|
|
70504
70596
|
}
|
|
70597
|
+
allIterationTypes = ts.append(allIterationTypes, iterationTypes_2);
|
|
70505
70598
|
}
|
|
70506
70599
|
var iterationTypes = allIterationTypes ? combineIterationTypes(allIterationTypes) : noIterationTypes;
|
|
70507
70600
|
setCachedIterationTypes(type, cacheKey, iterationTypes);
|
|
@@ -70518,46 +70611,57 @@ var ts;
|
|
|
70518
70611
|
}
|
|
70519
70612
|
return createIterationTypes(getAwaitedType(yieldType, errorNode) || anyType, getAwaitedType(returnType, errorNode) || anyType, nextType);
|
|
70520
70613
|
}
|
|
70521
|
-
function getIterationTypesOfIterableWorker(type, use, errorNode) {
|
|
70614
|
+
function getIterationTypesOfIterableWorker(type, use, errorNode, errorOutputContainer) {
|
|
70522
70615
|
if (isTypeAny(type)) {
|
|
70523
70616
|
return anyIterationTypes;
|
|
70524
70617
|
}
|
|
70618
|
+
var noCache = false;
|
|
70525
70619
|
if (use & 2) {
|
|
70526
70620
|
var iterationTypes = getIterationTypesOfIterableCached(type, asyncIterationTypesResolver) ||
|
|
70527
70621
|
getIterationTypesOfIterableFast(type, asyncIterationTypesResolver);
|
|
70528
70622
|
if (iterationTypes) {
|
|
70529
|
-
|
|
70530
|
-
|
|
70531
|
-
|
|
70623
|
+
if (iterationTypes === noIterationTypes && errorNode) {
|
|
70624
|
+
noCache = true;
|
|
70625
|
+
}
|
|
70626
|
+
else {
|
|
70627
|
+
return use & 8 ?
|
|
70628
|
+
getAsyncFromSyncIterationTypes(iterationTypes, errorNode) :
|
|
70629
|
+
iterationTypes;
|
|
70630
|
+
}
|
|
70532
70631
|
}
|
|
70533
70632
|
}
|
|
70534
70633
|
if (use & 1) {
|
|
70535
70634
|
var iterationTypes = getIterationTypesOfIterableCached(type, syncIterationTypesResolver) ||
|
|
70536
70635
|
getIterationTypesOfIterableFast(type, syncIterationTypesResolver);
|
|
70537
70636
|
if (iterationTypes) {
|
|
70538
|
-
if (
|
|
70539
|
-
|
|
70540
|
-
return setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", getAsyncFromSyncIterationTypes(iterationTypes, errorNode));
|
|
70541
|
-
}
|
|
70637
|
+
if (iterationTypes === noIterationTypes && errorNode) {
|
|
70638
|
+
noCache = true;
|
|
70542
70639
|
}
|
|
70543
70640
|
else {
|
|
70544
|
-
|
|
70641
|
+
if (use & 2) {
|
|
70642
|
+
if (iterationTypes !== noIterationTypes) {
|
|
70643
|
+
iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode);
|
|
70644
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", iterationTypes);
|
|
70645
|
+
}
|
|
70646
|
+
}
|
|
70647
|
+
else {
|
|
70648
|
+
return iterationTypes;
|
|
70649
|
+
}
|
|
70545
70650
|
}
|
|
70546
70651
|
}
|
|
70547
70652
|
}
|
|
70548
70653
|
if (use & 2) {
|
|
70549
|
-
var iterationTypes = getIterationTypesOfIterableSlow(type, asyncIterationTypesResolver, errorNode);
|
|
70654
|
+
var iterationTypes = getIterationTypesOfIterableSlow(type, asyncIterationTypesResolver, errorNode, errorOutputContainer, noCache);
|
|
70550
70655
|
if (iterationTypes !== noIterationTypes) {
|
|
70551
70656
|
return iterationTypes;
|
|
70552
70657
|
}
|
|
70553
70658
|
}
|
|
70554
70659
|
if (use & 1) {
|
|
70555
|
-
var iterationTypes = getIterationTypesOfIterableSlow(type, syncIterationTypesResolver, errorNode);
|
|
70660
|
+
var iterationTypes = getIterationTypesOfIterableSlow(type, syncIterationTypesResolver, errorNode, errorOutputContainer, noCache);
|
|
70556
70661
|
if (iterationTypes !== noIterationTypes) {
|
|
70557
70662
|
if (use & 2) {
|
|
70558
|
-
|
|
70559
|
-
|
|
70560
|
-
: noIterationTypes);
|
|
70663
|
+
iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode);
|
|
70664
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", iterationTypes);
|
|
70561
70665
|
}
|
|
70562
70666
|
else {
|
|
70563
70667
|
return iterationTypes;
|
|
@@ -70571,7 +70675,7 @@ var ts;
|
|
|
70571
70675
|
}
|
|
70572
70676
|
function getIterationTypesOfGlobalIterableType(globalType, resolver) {
|
|
70573
70677
|
var globalIterationTypes = getIterationTypesOfIterableCached(globalType, resolver) ||
|
|
70574
|
-
getIterationTypesOfIterableSlow(globalType, resolver, undefined);
|
|
70678
|
+
getIterationTypesOfIterableSlow(globalType, resolver, undefined, undefined, false);
|
|
70575
70679
|
return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
|
|
70576
70680
|
}
|
|
70577
70681
|
function getIterationTypesOfIterableFast(type, resolver) {
|
|
@@ -70592,34 +70696,41 @@ var ts;
|
|
|
70592
70696
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
70593
70697
|
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
|
|
70594
70698
|
}
|
|
70595
|
-
function getIterationTypesOfIterableSlow(type, resolver, errorNode) {
|
|
70699
|
+
function getIterationTypesOfIterableSlow(type, resolver, errorNode, errorOutputContainer, noCache) {
|
|
70596
70700
|
var _a;
|
|
70597
70701
|
var method = getPropertyOfType(type, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName));
|
|
70598
70702
|
var methodType = method && !(method.flags & 16777216) ? getTypeOfSymbol(method) : undefined;
|
|
70599
70703
|
if (isTypeAny(methodType)) {
|
|
70600
|
-
return setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes);
|
|
70704
|
+
return noCache ? anyIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes);
|
|
70601
70705
|
}
|
|
70602
70706
|
var signatures = methodType ? getSignaturesOfType(methodType, 0) : undefined;
|
|
70603
70707
|
if (!ts.some(signatures)) {
|
|
70604
|
-
return setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);
|
|
70708
|
+
return noCache ? noIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);
|
|
70605
70709
|
}
|
|
70606
70710
|
var iteratorType = getIntersectionType(ts.map(signatures, getReturnTypeOfSignature));
|
|
70607
|
-
var iterationTypes = (_a =
|
|
70608
|
-
return setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);
|
|
70711
|
+
var iterationTypes = (_a = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache)) !== null && _a !== void 0 ? _a : noIterationTypes;
|
|
70712
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);
|
|
70609
70713
|
}
|
|
70610
70714
|
function reportTypeNotIterableError(errorNode, type, allowAsyncIterables) {
|
|
70611
70715
|
var message = allowAsyncIterables
|
|
70612
70716
|
? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator
|
|
70613
70717
|
: ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;
|
|
70614
|
-
errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
|
|
70718
|
+
return errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
|
|
70719
|
+
}
|
|
70720
|
+
function getIterationTypesOfIterator(type, resolver, errorNode, errorOutputContainer) {
|
|
70721
|
+
return getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, false);
|
|
70615
70722
|
}
|
|
70616
|
-
function
|
|
70723
|
+
function getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, noCache) {
|
|
70617
70724
|
if (isTypeAny(type)) {
|
|
70618
70725
|
return anyIterationTypes;
|
|
70619
70726
|
}
|
|
70620
70727
|
var iterationTypes = getIterationTypesOfIteratorCached(type, resolver) ||
|
|
70621
|
-
getIterationTypesOfIteratorFast(type, resolver)
|
|
70622
|
-
|
|
70728
|
+
getIterationTypesOfIteratorFast(type, resolver);
|
|
70729
|
+
if (iterationTypes === noIterationTypes && errorNode) {
|
|
70730
|
+
iterationTypes = undefined;
|
|
70731
|
+
noCache = true;
|
|
70732
|
+
}
|
|
70733
|
+
iterationTypes !== null && iterationTypes !== void 0 ? iterationTypes : (iterationTypes = getIterationTypesOfIteratorSlow(type, resolver, errorNode, errorOutputContainer, noCache));
|
|
70623
70734
|
return iterationTypes === noIterationTypes ? undefined : iterationTypes;
|
|
70624
70735
|
}
|
|
70625
70736
|
function getIterationTypesOfIteratorCached(type, resolver) {
|
|
@@ -70630,7 +70741,7 @@ var ts;
|
|
|
70630
70741
|
if (isReferenceToType(type, globalType)) {
|
|
70631
70742
|
var yieldType = getTypeArguments(type)[0];
|
|
70632
70743
|
var globalIterationTypes = getIterationTypesOfIteratorCached(globalType, resolver) ||
|
|
70633
|
-
getIterationTypesOfIteratorSlow(globalType, resolver, undefined);
|
|
70744
|
+
getIterationTypesOfIteratorSlow(globalType, resolver, undefined, undefined, false);
|
|
70634
70745
|
var _a = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes, returnType = _a.returnType, nextType = _a.nextType;
|
|
70635
70746
|
return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType));
|
|
70636
70747
|
}
|
|
@@ -70675,8 +70786,8 @@ var ts;
|
|
|
70675
70786
|
}
|
|
70676
70787
|
return setCachedIterationTypes(type, "iterationTypesOfIteratorResult", createIterationTypes(yieldType, returnType || voidType, undefined));
|
|
70677
70788
|
}
|
|
70678
|
-
function getIterationTypesOfMethod(type, resolver, methodName, errorNode) {
|
|
70679
|
-
var _a, _b, _c, _d;
|
|
70789
|
+
function getIterationTypesOfMethod(type, resolver, methodName, errorNode, errorOutputContainer) {
|
|
70790
|
+
var _a, _b, _c, _d, _e, _f;
|
|
70680
70791
|
var method = getPropertyOfType(type, methodName);
|
|
70681
70792
|
if (!method && methodName !== "next") {
|
|
70682
70793
|
return undefined;
|
|
@@ -70693,15 +70804,21 @@ var ts;
|
|
|
70693
70804
|
var diagnostic = methodName === "next"
|
|
70694
70805
|
? resolver.mustHaveANextMethodDiagnostic
|
|
70695
70806
|
: resolver.mustBeAMethodDiagnostic;
|
|
70696
|
-
|
|
70807
|
+
if (errorOutputContainer) {
|
|
70808
|
+
(_a = errorOutputContainer.errors) !== null && _a !== void 0 ? _a : (errorOutputContainer.errors = []);
|
|
70809
|
+
errorOutputContainer.errors.push(ts.createDiagnosticForNode(errorNode, diagnostic, methodName));
|
|
70810
|
+
}
|
|
70811
|
+
else {
|
|
70812
|
+
error(errorNode, diagnostic, methodName);
|
|
70813
|
+
}
|
|
70697
70814
|
}
|
|
70698
|
-
return methodName === "next" ?
|
|
70815
|
+
return methodName === "next" ? noIterationTypes : undefined;
|
|
70699
70816
|
}
|
|
70700
70817
|
if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) {
|
|
70701
70818
|
var globalGeneratorType = resolver.getGlobalGeneratorType(false);
|
|
70702
70819
|
var globalIteratorType = resolver.getGlobalIteratorType(false);
|
|
70703
|
-
var isGeneratorMethod = ((
|
|
70704
|
-
var isIteratorMethod = !isGeneratorMethod && ((
|
|
70820
|
+
var isGeneratorMethod = ((_c = (_b = globalGeneratorType.symbol) === null || _b === void 0 ? void 0 : _b.members) === null || _c === void 0 ? void 0 : _c.get(methodName)) === methodType.symbol;
|
|
70821
|
+
var isIteratorMethod = !isGeneratorMethod && ((_e = (_d = globalIteratorType.symbol) === null || _d === void 0 ? void 0 : _d.members) === null || _e === void 0 ? void 0 : _e.get(methodName)) === methodType.symbol;
|
|
70705
70822
|
if (isGeneratorMethod || isIteratorMethod) {
|
|
70706
70823
|
var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType;
|
|
70707
70824
|
var mapper = methodType.mapper;
|
|
@@ -70735,7 +70852,13 @@ var ts;
|
|
|
70735
70852
|
var iterationTypes = getIterationTypesOfIteratorResult(resolvedMethodReturnType);
|
|
70736
70853
|
if (iterationTypes === noIterationTypes) {
|
|
70737
70854
|
if (errorNode) {
|
|
70738
|
-
|
|
70855
|
+
if (errorOutputContainer) {
|
|
70856
|
+
(_f = errorOutputContainer.errors) !== null && _f !== void 0 ? _f : (errorOutputContainer.errors = []);
|
|
70857
|
+
errorOutputContainer.errors.push(ts.createDiagnosticForNode(errorNode, resolver.mustHaveAValueDiagnostic, methodName));
|
|
70858
|
+
}
|
|
70859
|
+
else {
|
|
70860
|
+
error(errorNode, resolver.mustHaveAValueDiagnostic, methodName);
|
|
70861
|
+
}
|
|
70739
70862
|
}
|
|
70740
70863
|
yieldType = anyType;
|
|
70741
70864
|
returnTypes = ts.append(returnTypes, anyType);
|
|
@@ -70746,13 +70869,13 @@ var ts;
|
|
|
70746
70869
|
}
|
|
70747
70870
|
return createIterationTypes(yieldType, getUnionType(returnTypes), nextType);
|
|
70748
70871
|
}
|
|
70749
|
-
function getIterationTypesOfIteratorSlow(type, resolver, errorNode) {
|
|
70872
|
+
function getIterationTypesOfIteratorSlow(type, resolver, errorNode, errorOutputContainer, noCache) {
|
|
70750
70873
|
var iterationTypes = combineIterationTypes([
|
|
70751
|
-
getIterationTypesOfMethod(type, resolver, "next", errorNode),
|
|
70752
|
-
getIterationTypesOfMethod(type, resolver, "return", errorNode),
|
|
70753
|
-
getIterationTypesOfMethod(type, resolver, "throw", errorNode),
|
|
70874
|
+
getIterationTypesOfMethod(type, resolver, "next", errorNode, errorOutputContainer),
|
|
70875
|
+
getIterationTypesOfMethod(type, resolver, "return", errorNode, errorOutputContainer),
|
|
70876
|
+
getIterationTypesOfMethod(type, resolver, "throw", errorNode, errorOutputContainer),
|
|
70754
70877
|
]);
|
|
70755
|
-
return setCachedIterationTypes(type, resolver.iteratorCacheKey, iterationTypes);
|
|
70878
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iteratorCacheKey, iterationTypes);
|
|
70756
70879
|
}
|
|
70757
70880
|
function getIterationTypeOfGeneratorFunctionReturnType(kind, returnType, isAsyncGenerator) {
|
|
70758
70881
|
if (isTypeAny(returnType)) {
|
|
@@ -70768,7 +70891,7 @@ var ts;
|
|
|
70768
70891
|
var use = isAsyncGenerator ? 2 : 1;
|
|
70769
70892
|
var resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver;
|
|
70770
70893
|
return getIterationTypesOfIterable(type, use, undefined) ||
|
|
70771
|
-
getIterationTypesOfIterator(type, resolver, undefined);
|
|
70894
|
+
getIterationTypesOfIterator(type, resolver, undefined, undefined);
|
|
70772
70895
|
}
|
|
70773
70896
|
function checkBreakOrContinueStatement(node) {
|
|
70774
70897
|
if (!checkGrammarStatementInAmbientContext(node))
|
|
@@ -73304,6 +73427,12 @@ var ts;
|
|
|
73304
73427
|
return resolveJSDocMemberName(name, false, getSymbolOfNode(container));
|
|
73305
73428
|
}
|
|
73306
73429
|
}
|
|
73430
|
+
if (result && isJSDoc_1) {
|
|
73431
|
+
var container = ts.getJSDocHost(name);
|
|
73432
|
+
if (container && ts.isEnumMember(container) && container === result.valueDeclaration) {
|
|
73433
|
+
return resolveEntityName(name, meaning, true, true, ts.getSourceFileOfNode(container)) || result;
|
|
73434
|
+
}
|
|
73435
|
+
}
|
|
73307
73436
|
return result;
|
|
73308
73437
|
}
|
|
73309
73438
|
else if (ts.isPrivateIdentifier(name)) {
|
|
@@ -79599,10 +79728,11 @@ var ts;
|
|
|
79599
79728
|
}
|
|
79600
79729
|
function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) {
|
|
79601
79730
|
if (node.operator === 45 || node.operator === 46) {
|
|
79602
|
-
|
|
79731
|
+
var operand = ts.skipParentheses(node.operand);
|
|
79732
|
+
if (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierPropertyAccessExpression(operand)) {
|
|
79603
79733
|
var info = void 0;
|
|
79604
|
-
if (info = accessPrivateIdentifier(
|
|
79605
|
-
var receiver = ts.visitNode(
|
|
79734
|
+
if (info = accessPrivateIdentifier(operand.name)) {
|
|
79735
|
+
var receiver = ts.visitNode(operand.expression, visitor, ts.isExpression);
|
|
79606
79736
|
var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
|
|
79607
79737
|
var expression = createPrivateIdentifierAccess(info, readExpression);
|
|
79608
79738
|
var temp = ts.isPrefixUnaryExpression(node) || valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
|
|
@@ -79618,36 +79748,36 @@ var ts;
|
|
|
79618
79748
|
}
|
|
79619
79749
|
}
|
|
79620
79750
|
else if (shouldTransformSuperInStaticInitializers &&
|
|
79621
|
-
ts.isSuperProperty(
|
|
79751
|
+
ts.isSuperProperty(operand) &&
|
|
79622
79752
|
currentStaticPropertyDeclarationOrStaticBlock &&
|
|
79623
79753
|
currentClassLexicalEnvironment) {
|
|
79624
79754
|
var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts;
|
|
79625
79755
|
if (facts & 1) {
|
|
79626
|
-
var
|
|
79756
|
+
var expression = visitInvalidSuperProperty(operand);
|
|
79627
79757
|
return ts.isPrefixUnaryExpression(node) ?
|
|
79628
|
-
factory.updatePrefixUnaryExpression(node,
|
|
79629
|
-
factory.updatePostfixUnaryExpression(node,
|
|
79758
|
+
factory.updatePrefixUnaryExpression(node, expression) :
|
|
79759
|
+
factory.updatePostfixUnaryExpression(node, expression);
|
|
79630
79760
|
}
|
|
79631
79761
|
if (classConstructor && superClassReference) {
|
|
79632
79762
|
var setterName = void 0;
|
|
79633
79763
|
var getterName = void 0;
|
|
79634
|
-
if (ts.isPropertyAccessExpression(
|
|
79635
|
-
if (ts.isIdentifier(
|
|
79636
|
-
getterName = setterName = factory.createStringLiteralFromNode(
|
|
79764
|
+
if (ts.isPropertyAccessExpression(operand)) {
|
|
79765
|
+
if (ts.isIdentifier(operand.name)) {
|
|
79766
|
+
getterName = setterName = factory.createStringLiteralFromNode(operand.name);
|
|
79637
79767
|
}
|
|
79638
79768
|
}
|
|
79639
79769
|
else {
|
|
79640
|
-
if (ts.isSimpleInlineableExpression(
|
|
79641
|
-
getterName = setterName =
|
|
79770
|
+
if (ts.isSimpleInlineableExpression(operand.argumentExpression)) {
|
|
79771
|
+
getterName = setterName = operand.argumentExpression;
|
|
79642
79772
|
}
|
|
79643
79773
|
else {
|
|
79644
79774
|
getterName = factory.createTempVariable(hoistVariableDeclaration);
|
|
79645
|
-
setterName = factory.createAssignment(getterName, ts.visitNode(
|
|
79775
|
+
setterName = factory.createAssignment(getterName, ts.visitNode(operand.argumentExpression, visitor, ts.isExpression));
|
|
79646
79776
|
}
|
|
79647
79777
|
}
|
|
79648
79778
|
if (setterName && getterName) {
|
|
79649
79779
|
var expression = factory.createReflectGetCall(superClassReference, getterName, classConstructor);
|
|
79650
|
-
ts.setTextRange(expression,
|
|
79780
|
+
ts.setTextRange(expression, operand);
|
|
79651
79781
|
var temp = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
|
|
79652
79782
|
expression = ts.expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, hoistVariableDeclaration, temp);
|
|
79653
79783
|
expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor);
|
|
@@ -88386,6 +88516,12 @@ var ts;
|
|
|
88386
88516
|
case 265:
|
|
88387
88517
|
ts.Debug.assert(importVariableName !== undefined);
|
|
88388
88518
|
statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName)));
|
|
88519
|
+
if (ts.hasSyntacticModifier(entry, 1)) {
|
|
88520
|
+
statements.push(factory.createExpressionStatement(factory.createCallExpression(exportFunction, undefined, [
|
|
88521
|
+
factory.createStringLiteral(ts.idText(importVariableName)),
|
|
88522
|
+
parameterName,
|
|
88523
|
+
])));
|
|
88524
|
+
}
|
|
88389
88525
|
break;
|
|
88390
88526
|
case 272:
|
|
88391
88527
|
ts.Debug.assert(importVariableName !== undefined);
|
|
@@ -90627,8 +90763,12 @@ var ts;
|
|
|
90627
90763
|
}
|
|
90628
90764
|
var previousNeedsDeclare = needsDeclare;
|
|
90629
90765
|
switch (input.kind) {
|
|
90630
|
-
case 259:
|
|
90631
|
-
|
|
90766
|
+
case 259: {
|
|
90767
|
+
needsDeclare = false;
|
|
90768
|
+
var clean = cleanup(factory.updateTypeAliasDeclaration(input, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));
|
|
90769
|
+
needsDeclare = previousNeedsDeclare;
|
|
90770
|
+
return clean;
|
|
90771
|
+
}
|
|
90632
90772
|
case 258: {
|
|
90633
90773
|
return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
|
|
90634
90774
|
}
|
|
@@ -96266,7 +96406,15 @@ var ts;
|
|
|
96266
96406
|
return cachedReadDirectoryResult.get(ts.ensureTrailingDirectorySeparator(rootDirPath));
|
|
96267
96407
|
}
|
|
96268
96408
|
function getCachedFileSystemEntriesForBaseDir(path) {
|
|
96269
|
-
|
|
96409
|
+
var entries = getCachedFileSystemEntries(ts.getDirectoryPath(path));
|
|
96410
|
+
if (!entries) {
|
|
96411
|
+
return entries;
|
|
96412
|
+
}
|
|
96413
|
+
if (!entries.sortedAndCanonicalizedFiles) {
|
|
96414
|
+
entries.sortedAndCanonicalizedFiles = entries.files.map(getCanonicalFileName).sort();
|
|
96415
|
+
entries.sortedAndCanonicalizedDirectories = entries.directories.map(getCanonicalFileName).sort();
|
|
96416
|
+
}
|
|
96417
|
+
return entries;
|
|
96270
96418
|
}
|
|
96271
96419
|
function getBaseNameOfFileName(fileName) {
|
|
96272
96420
|
return ts.getBaseFileName(ts.normalizePath(fileName));
|
|
@@ -96301,21 +96449,9 @@ var ts;
|
|
|
96301
96449
|
return undefined;
|
|
96302
96450
|
}
|
|
96303
96451
|
}
|
|
96304
|
-
function fileNameEqual(name1, name2) {
|
|
96305
|
-
return getCanonicalFileName(name1) === getCanonicalFileName(name2);
|
|
96306
|
-
}
|
|
96307
96452
|
function hasEntry(entries, name) {
|
|
96308
|
-
|
|
96309
|
-
|
|
96310
|
-
function updateFileSystemEntry(entries, baseName, isValid) {
|
|
96311
|
-
if (hasEntry(entries, baseName)) {
|
|
96312
|
-
if (!isValid) {
|
|
96313
|
-
return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); });
|
|
96314
|
-
}
|
|
96315
|
-
}
|
|
96316
|
-
else if (isValid) {
|
|
96317
|
-
return entries.push(baseName);
|
|
96318
|
-
}
|
|
96453
|
+
var index = ts.binarySearch(entries, name, ts.identity, ts.compareStringsCaseSensitive);
|
|
96454
|
+
return index >= 0;
|
|
96319
96455
|
}
|
|
96320
96456
|
function writeFile(fileName, data, writeByteOrderMark) {
|
|
96321
96457
|
var path = toPath(fileName);
|
|
@@ -96328,7 +96464,7 @@ var ts;
|
|
|
96328
96464
|
function fileExists(fileName) {
|
|
96329
96465
|
var path = toPath(fileName);
|
|
96330
96466
|
var result = getCachedFileSystemEntriesForBaseDir(path);
|
|
96331
|
-
return result && hasEntry(result.
|
|
96467
|
+
return result && hasEntry(result.sortedAndCanonicalizedFiles, getCanonicalFileName(getBaseNameOfFileName(fileName))) ||
|
|
96332
96468
|
host.fileExists(fileName);
|
|
96333
96469
|
}
|
|
96334
96470
|
function directoryExists(dirPath) {
|
|
@@ -96338,9 +96474,13 @@ var ts;
|
|
|
96338
96474
|
function createDirectory(dirPath) {
|
|
96339
96475
|
var path = toPath(dirPath);
|
|
96340
96476
|
var result = getCachedFileSystemEntriesForBaseDir(path);
|
|
96341
|
-
var baseFileName = getBaseNameOfFileName(dirPath);
|
|
96342
96477
|
if (result) {
|
|
96343
|
-
|
|
96478
|
+
var baseName = getBaseNameOfFileName(dirPath);
|
|
96479
|
+
var canonicalizedBaseName = getCanonicalFileName(baseName);
|
|
96480
|
+
var canonicalizedDirectories = result.sortedAndCanonicalizedDirectories;
|
|
96481
|
+
if (ts.insertSorted(canonicalizedDirectories, canonicalizedBaseName, ts.compareStringsCaseSensitive)) {
|
|
96482
|
+
result.directories.push(baseName);
|
|
96483
|
+
}
|
|
96344
96484
|
}
|
|
96345
96485
|
host.createDirectory(dirPath);
|
|
96346
96486
|
}
|
|
@@ -96404,7 +96544,7 @@ var ts;
|
|
|
96404
96544
|
fileExists: host.fileExists(fileOrDirectoryPath),
|
|
96405
96545
|
directoryExists: host.directoryExists(fileOrDirectoryPath)
|
|
96406
96546
|
};
|
|
96407
|
-
if (fsQueryResult.directoryExists || hasEntry(parentResult.
|
|
96547
|
+
if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) {
|
|
96408
96548
|
clearCache();
|
|
96409
96549
|
}
|
|
96410
96550
|
else {
|
|
@@ -96422,7 +96562,21 @@ var ts;
|
|
|
96422
96562
|
}
|
|
96423
96563
|
}
|
|
96424
96564
|
function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) {
|
|
96425
|
-
|
|
96565
|
+
var canonicalizedFiles = parentResult.sortedAndCanonicalizedFiles;
|
|
96566
|
+
var canonicalizedBaseName = getCanonicalFileName(baseName);
|
|
96567
|
+
if (fileExists) {
|
|
96568
|
+
if (ts.insertSorted(canonicalizedFiles, canonicalizedBaseName, ts.compareStringsCaseSensitive)) {
|
|
96569
|
+
parentResult.files.push(baseName);
|
|
96570
|
+
}
|
|
96571
|
+
}
|
|
96572
|
+
else {
|
|
96573
|
+
var sortedIndex = ts.binarySearch(canonicalizedFiles, canonicalizedBaseName, ts.identity, ts.compareStringsCaseSensitive);
|
|
96574
|
+
if (sortedIndex >= 0) {
|
|
96575
|
+
canonicalizedFiles.splice(sortedIndex, 1);
|
|
96576
|
+
var unsortedIndex = parentResult.files.findIndex(function (entry) { return getCanonicalFileName(entry) === canonicalizedBaseName; });
|
|
96577
|
+
parentResult.files.splice(unsortedIndex, 1);
|
|
96578
|
+
}
|
|
96579
|
+
}
|
|
96426
96580
|
}
|
|
96427
96581
|
function clearCache() {
|
|
96428
96582
|
cachedReadDirectoryResult.clear();
|
|
@@ -98818,13 +98972,16 @@ var ts;
|
|
|
98818
98972
|
addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, [fileName, existingFile.fileName]);
|
|
98819
98973
|
}
|
|
98820
98974
|
}
|
|
98821
|
-
function createRedirectSourceFile(redirectTarget, unredirected, fileName, path, resolvedPath, originalFileName) {
|
|
98975
|
+
function createRedirectSourceFile(redirectTarget, unredirected, fileName, path, resolvedPath, originalFileName, sourceFileOptions) {
|
|
98976
|
+
var _a;
|
|
98822
98977
|
var redirect = Object.create(redirectTarget);
|
|
98823
98978
|
redirect.fileName = fileName;
|
|
98824
98979
|
redirect.path = path;
|
|
98825
98980
|
redirect.resolvedPath = resolvedPath;
|
|
98826
98981
|
redirect.originalFileName = originalFileName;
|
|
98827
98982
|
redirect.redirectInfo = { redirectTarget: redirectTarget, unredirected: unredirected };
|
|
98983
|
+
redirect.packageJsonLocations = ((_a = sourceFileOptions.packageJsonLocations) === null || _a === void 0 ? void 0 : _a.length) ? sourceFileOptions.packageJsonLocations : undefined;
|
|
98984
|
+
redirect.packageJsonScope = sourceFileOptions.packageJsonScope;
|
|
98828
98985
|
sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);
|
|
98829
98986
|
Object.defineProperties(redirect, {
|
|
98830
98987
|
id: {
|
|
@@ -98932,7 +99089,7 @@ var ts;
|
|
|
98932
99089
|
var packageIdKey = ts.packageIdToString(packageId);
|
|
98933
99090
|
var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
|
|
98934
99091
|
if (fileFromPackageId) {
|
|
98935
|
-
var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path, toPath(fileName), originalFileName);
|
|
99092
|
+
var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path, toPath(fileName), originalFileName, sourceFileOptions);
|
|
98936
99093
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
98937
99094
|
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
98938
99095
|
addFileIncludeReason(dupFile, reason);
|
|
@@ -101604,7 +101761,6 @@ var ts;
|
|
|
101604
101761
|
resolvedModuleNames.clear();
|
|
101605
101762
|
resolvedTypeReferenceDirectives.clear();
|
|
101606
101763
|
resolvedFileToResolution.clear();
|
|
101607
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
101608
101764
|
resolutionsWithFailedLookups.length = 0;
|
|
101609
101765
|
resolutionsWithOnlyAffectingLocations.length = 0;
|
|
101610
101766
|
failedLookupChecks = undefined;
|
|
@@ -101646,6 +101802,8 @@ var ts;
|
|
|
101646
101802
|
function startCachingPerDirectoryResolution() {
|
|
101647
101803
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
101648
101804
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
101805
|
+
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
|
|
101806
|
+
nonRelativeExternalModuleResolutions.clear();
|
|
101649
101807
|
}
|
|
101650
101808
|
function finishCachingPerDirectoryResolution(newProgram, oldProgram) {
|
|
101651
101809
|
filesWithInvalidatedNonRelativeUnresolvedImports = undefined;
|
|
@@ -101686,7 +101844,6 @@ var ts;
|
|
|
101686
101844
|
if (watcher.files === 0 && watcher.resolutions === 0) {
|
|
101687
101845
|
fileWatchesOfAffectingLocations.delete(path);
|
|
101688
101846
|
watcher.watcher.close();
|
|
101689
|
-
watcher.watcher = ts.noopFileWatcher;
|
|
101690
101847
|
}
|
|
101691
101848
|
});
|
|
101692
101849
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
@@ -102006,20 +102163,26 @@ var ts;
|
|
|
102006
102163
|
}
|
|
102007
102164
|
var paths = new ts.Set();
|
|
102008
102165
|
paths.add(locationToWatch);
|
|
102166
|
+
var actualWatcher = canWatchDirectoryOrFile(resolutionHost.toPath(locationToWatch)) ?
|
|
102167
|
+
resolutionHost.watchAffectingFileLocation(locationToWatch, function (fileName, eventKind) {
|
|
102168
|
+
cachedDirectoryStructureHost === null || cachedDirectoryStructureHost === void 0 ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
102169
|
+
var packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
|
102170
|
+
paths.forEach(function (path) {
|
|
102171
|
+
if (watcher.resolutions)
|
|
102172
|
+
(affectingPathChecks !== null && affectingPathChecks !== void 0 ? affectingPathChecks : (affectingPathChecks = new ts.Set())).add(path);
|
|
102173
|
+
if (watcher.files)
|
|
102174
|
+
(affectingPathChecksForFile !== null && affectingPathChecksForFile !== void 0 ? affectingPathChecksForFile : (affectingPathChecksForFile = new ts.Set())).add(path);
|
|
102175
|
+
packageJsonMap === null || packageJsonMap === void 0 ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
|
|
102176
|
+
});
|
|
102177
|
+
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
102178
|
+
}) : ts.noopFileWatcher;
|
|
102009
102179
|
var watcher = {
|
|
102010
|
-
watcher:
|
|
102011
|
-
|
|
102012
|
-
|
|
102013
|
-
|
|
102014
|
-
|
|
102015
|
-
|
|
102016
|
-
(affectingPathChecks !== null && affectingPathChecks !== void 0 ? affectingPathChecks : (affectingPathChecks = new ts.Set())).add(path);
|
|
102017
|
-
if (watcher.files)
|
|
102018
|
-
(affectingPathChecksForFile !== null && affectingPathChecksForFile !== void 0 ? affectingPathChecksForFile : (affectingPathChecksForFile = new ts.Set())).add(path);
|
|
102019
|
-
(_a = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()) === null || _a === void 0 ? void 0 : _a.delete(resolutionHost.toPath(path));
|
|
102020
|
-
});
|
|
102021
|
-
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
102022
|
-
}) : ts.noopFileWatcher,
|
|
102180
|
+
watcher: actualWatcher !== ts.noopFileWatcher ? {
|
|
102181
|
+
close: function () {
|
|
102182
|
+
actualWatcher.close();
|
|
102183
|
+
actualWatcher = ts.noopFileWatcher;
|
|
102184
|
+
}
|
|
102185
|
+
} : actualWatcher,
|
|
102023
102186
|
resolutions: forResolution ? 1 : 0,
|
|
102024
102187
|
files: forResolution ? 0 : 1,
|
|
102025
102188
|
paths: paths,
|
|
@@ -102368,7 +102531,7 @@ var ts;
|
|
|
102368
102531
|
var info = getInfo(importingSourceFileName, host);
|
|
102369
102532
|
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
|
|
102370
102533
|
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, undefined, options.overrideImportMode); }) ||
|
|
102371
|
-
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
|
|
102534
|
+
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
|
|
102372
102535
|
}
|
|
102373
102536
|
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options) {
|
|
102374
102537
|
if (options === void 0) { options = {}; }
|
|
@@ -102439,7 +102602,7 @@ var ts;
|
|
|
102439
102602
|
return nodeModulesSpecifiers;
|
|
102440
102603
|
}
|
|
102441
102604
|
if (!specifier && !modulePath.isRedirect) {
|
|
102442
|
-
var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences);
|
|
102605
|
+
var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
|
|
102443
102606
|
if (ts.pathIsBareSpecifier(local)) {
|
|
102444
102607
|
pathsSpecifiers = ts.append(pathsSpecifiers, local);
|
|
102445
102608
|
}
|
|
@@ -102457,7 +102620,7 @@ var ts;
|
|
|
102457
102620
|
var sourceDirectory = ts.getDirectoryPath(importingSourceFileName);
|
|
102458
102621
|
return { getCanonicalFileName: getCanonicalFileName, importingSourceFileName: importingSourceFileName, sourceDirectory: sourceDirectory };
|
|
102459
102622
|
}
|
|
102460
|
-
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, _a) {
|
|
102623
|
+
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, _a) {
|
|
102461
102624
|
var ending = _a.ending, relativePreference = _a.relativePreference;
|
|
102462
102625
|
var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs;
|
|
102463
102626
|
var sourceDirectory = info.sourceDirectory, getCanonicalFileName = info.getCanonicalFileName;
|
|
@@ -102471,9 +102634,8 @@ var ts;
|
|
|
102471
102634
|
if (!relativeToBaseUrl) {
|
|
102472
102635
|
return relativePath;
|
|
102473
102636
|
}
|
|
102474
|
-
var
|
|
102475
|
-
var
|
|
102476
|
-
var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;
|
|
102637
|
+
var fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, getAllowedEndings(ending, compilerOptions, importMode), host, compilerOptions);
|
|
102638
|
+
var nonRelative = fromPaths === undefined && baseUrl !== undefined ? removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions) : fromPaths;
|
|
102477
102639
|
if (!nonRelative) {
|
|
102478
102640
|
return relativePath;
|
|
102479
102641
|
}
|
|
@@ -102670,28 +102832,59 @@ var ts;
|
|
|
102670
102832
|
return ambientModuleDeclare.name.text;
|
|
102671
102833
|
}
|
|
102672
102834
|
}
|
|
102673
|
-
function
|
|
102835
|
+
function getAllowedEndings(preferredEnding, compilerOptions, importMode) {
|
|
102836
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) >= ts.ModuleResolutionKind.Node16 && importMode === ts.ModuleKind.ESNext) {
|
|
102837
|
+
return [2];
|
|
102838
|
+
}
|
|
102839
|
+
switch (preferredEnding) {
|
|
102840
|
+
case 2: return [2, 0, 1];
|
|
102841
|
+
case 1: return [1, 0, 2];
|
|
102842
|
+
case 0: return [0, 1, 2];
|
|
102843
|
+
default: ts.Debug.assertNever(preferredEnding);
|
|
102844
|
+
}
|
|
102845
|
+
}
|
|
102846
|
+
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
102674
102847
|
for (var key in paths) {
|
|
102675
|
-
|
|
102676
|
-
var
|
|
102677
|
-
var pattern = ts.removeFileExtension(ts.normalizePath(patternText_1));
|
|
102848
|
+
var _loop_36 = function (patternText_1) {
|
|
102849
|
+
var pattern = ts.normalizePath(patternText_1);
|
|
102678
102850
|
var indexOfStar = pattern.indexOf("*");
|
|
102851
|
+
var candidates = allowedEndings.map(function (ending) { return ({
|
|
102852
|
+
ending: ending,
|
|
102853
|
+
value: removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions)
|
|
102854
|
+
}); });
|
|
102855
|
+
if (ts.tryGetExtensionFromPath(pattern)) {
|
|
102856
|
+
candidates.push({ ending: undefined, value: relativeToBaseUrl });
|
|
102857
|
+
}
|
|
102679
102858
|
if (indexOfStar !== -1) {
|
|
102680
|
-
var prefix = pattern.
|
|
102681
|
-
var suffix = pattern.
|
|
102682
|
-
|
|
102683
|
-
|
|
102684
|
-
|
|
102685
|
-
|
|
102686
|
-
|
|
102687
|
-
|
|
102859
|
+
var prefix = pattern.substring(0, indexOfStar);
|
|
102860
|
+
var suffix = pattern.substring(indexOfStar + 1);
|
|
102861
|
+
for (var _b = 0, candidates_3 = candidates; _b < candidates_3.length; _b++) {
|
|
102862
|
+
var _c = candidates_3[_b], ending = _c.ending, value = _c.value;
|
|
102863
|
+
if (value.length >= prefix.length + suffix.length &&
|
|
102864
|
+
ts.startsWith(value, prefix) &&
|
|
102865
|
+
ts.endsWith(value, suffix) &&
|
|
102866
|
+
validateEnding({ ending: ending, value: value })) {
|
|
102867
|
+
var matchedStar = value.substring(prefix.length, value.length - suffix.length);
|
|
102868
|
+
return { value: key.replace("*", matchedStar) };
|
|
102869
|
+
}
|
|
102688
102870
|
}
|
|
102689
102871
|
}
|
|
102690
|
-
else if (
|
|
102691
|
-
return
|
|
102872
|
+
else if (ts.some(candidates, function (c) { return c.ending !== 0 && pattern === c.value; }) ||
|
|
102873
|
+
ts.some(candidates, function (c) { return c.ending === 0 && pattern === c.value && validateEnding(c); })) {
|
|
102874
|
+
return { value: key };
|
|
102692
102875
|
}
|
|
102876
|
+
};
|
|
102877
|
+
for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
|
|
102878
|
+
var patternText_1 = _a[_i];
|
|
102879
|
+
var state_12 = _loop_36(patternText_1);
|
|
102880
|
+
if (typeof state_12 === "object")
|
|
102881
|
+
return state_12.value;
|
|
102693
102882
|
}
|
|
102694
102883
|
}
|
|
102884
|
+
function validateEnding(_a) {
|
|
102885
|
+
var ending = _a.ending, value = _a.value;
|
|
102886
|
+
return ending !== 0 || value === removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions, host);
|
|
102887
|
+
}
|
|
102695
102888
|
}
|
|
102696
102889
|
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports, conditions, mode) {
|
|
102697
102890
|
if (mode === void 0) { mode = 0; }
|
|
@@ -102774,10 +102967,10 @@ var ts;
|
|
|
102774
102967
|
if (!parts) {
|
|
102775
102968
|
return undefined;
|
|
102776
102969
|
}
|
|
102970
|
+
var preferences = getPreferences(host, userPreferences, options, importingSourceFile);
|
|
102777
102971
|
var moduleSpecifier = path;
|
|
102778
102972
|
var isPackageRootPath = false;
|
|
102779
102973
|
if (!packageNameOnly) {
|
|
102780
|
-
var preferences = getPreferences(host, userPreferences, options, importingSourceFile);
|
|
102781
102974
|
var packageRootIndex = parts.packageRootIndex;
|
|
102782
102975
|
var moduleFileName = void 0;
|
|
102783
102976
|
while (true) {
|
|
@@ -102820,11 +103013,13 @@ var ts;
|
|
|
102820
103013
|
var packageRootPath = path.substring(0, packageRootIndex);
|
|
102821
103014
|
var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
|
|
102822
103015
|
var moduleFileToTry = path;
|
|
103016
|
+
var maybeBlockedByTypesVersions = false;
|
|
102823
103017
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
102824
103018
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
102825
103019
|
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
103020
|
+
var importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
102826
103021
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
102827
|
-
var conditions = ["node",
|
|
103022
|
+
var conditions = ["node", importMode === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
102828
103023
|
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
102829
103024
|
? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
|
|
102830
103025
|
: undefined;
|
|
@@ -102843,13 +103038,16 @@ var ts;
|
|
|
102843
103038
|
: undefined;
|
|
102844
103039
|
if (versionPaths) {
|
|
102845
103040
|
var subModuleName = path.slice(packageRootPath.length + 1);
|
|
102846
|
-
var fromPaths = tryGetModuleNameFromPaths(
|
|
102847
|
-
if (fromPaths
|
|
103041
|
+
var fromPaths = tryGetModuleNameFromPaths(subModuleName, versionPaths.paths, getAllowedEndings(preferences.ending, options, importMode), host, options);
|
|
103042
|
+
if (fromPaths === undefined) {
|
|
103043
|
+
maybeBlockedByTypesVersions = true;
|
|
103044
|
+
}
|
|
103045
|
+
else {
|
|
102848
103046
|
moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths);
|
|
102849
103047
|
}
|
|
102850
103048
|
}
|
|
102851
103049
|
var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js";
|
|
102852
|
-
if (ts.isString(mainFileRelative)) {
|
|
103050
|
+
if (ts.isString(mainFileRelative) && !(maybeBlockedByTypesVersions && ts.matchPatternOrExact(ts.tryParsePatterns(versionPaths.paths), mainFileRelative))) {
|
|
102853
103051
|
var mainExportFile = ts.toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
|
|
102854
103052
|
if (ts.removeFileExtension(mainExportFile) === ts.removeFileExtension(getCanonicalFileName(moduleFileToTry))) {
|
|
102855
103053
|
return { packageRootPath: packageRootPath, moduleFileToTry: moduleFileToTry };
|