typescript 4.8.0-dev.20220803 → 4.8.0-dev.20220804
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +191 -101
- package/lib/tsserver.js +259 -107
- package/lib/tsserverlibrary.js +259 -107
- package/lib/typescript.js +259 -107
- package/lib/typescriptServices.js +259 -107
- package/lib/typingsInstaller.js +256 -107
- package/package.json +4 -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.8";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220804";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -17383,10 +17383,11 @@ var ts;
|
|
|
17383
17383
|
}
|
|
17384
17384
|
return parenthesizeLeftSideOfAccess(expression);
|
|
17385
17385
|
}
|
|
17386
|
-
function parenthesizeLeftSideOfAccess(expression) {
|
|
17386
|
+
function parenthesizeLeftSideOfAccess(expression, optionalChain) {
|
|
17387
17387
|
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
|
|
17388
17388
|
if (ts.isLeftHandSideExpression(emittedExpression)
|
|
17389
|
-
&& (emittedExpression.kind !== 209 || emittedExpression.arguments)
|
|
17389
|
+
&& (emittedExpression.kind !== 209 || emittedExpression.arguments)
|
|
17390
|
+
&& (optionalChain || !ts.isOptionalChain(emittedExpression))) {
|
|
17390
17391
|
return expression;
|
|
17391
17392
|
}
|
|
17392
17393
|
return ts.setTextRange(factory.createParenthesizedExpression(expression), expression);
|
|
@@ -18596,7 +18597,7 @@ var ts;
|
|
|
18596
18597
|
}
|
|
18597
18598
|
function createDecorator(expression) {
|
|
18598
18599
|
var node = createBaseNode(165);
|
|
18599
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
18600
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
18600
18601
|
node.transformFlags |=
|
|
18601
18602
|
propagateChildFlags(node.expression) |
|
|
18602
18603
|
1 |
|
|
@@ -19270,7 +19271,7 @@ var ts;
|
|
|
19270
19271
|
}
|
|
19271
19272
|
function createPropertyAccessExpression(expression, name) {
|
|
19272
19273
|
var node = createBaseExpression(206);
|
|
19273
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19274
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19274
19275
|
node.name = asName(name);
|
|
19275
19276
|
node.transformFlags =
|
|
19276
19277
|
propagateChildFlags(node.expression) |
|
|
@@ -19296,7 +19297,7 @@ var ts;
|
|
|
19296
19297
|
function createPropertyAccessChain(expression, questionDotToken, name) {
|
|
19297
19298
|
var node = createBaseExpression(206);
|
|
19298
19299
|
node.flags |= 32;
|
|
19299
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19300
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19300
19301
|
node.questionDotToken = questionDotToken;
|
|
19301
19302
|
node.name = asName(name);
|
|
19302
19303
|
node.transformFlags |=
|
|
@@ -19318,7 +19319,7 @@ var ts;
|
|
|
19318
19319
|
}
|
|
19319
19320
|
function createElementAccessExpression(expression, index) {
|
|
19320
19321
|
var node = createBaseExpression(207);
|
|
19321
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19322
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19322
19323
|
node.argumentExpression = asExpression(index);
|
|
19323
19324
|
node.transformFlags |=
|
|
19324
19325
|
propagateChildFlags(node.expression) |
|
|
@@ -19342,7 +19343,7 @@ var ts;
|
|
|
19342
19343
|
function createElementAccessChain(expression, questionDotToken, index) {
|
|
19343
19344
|
var node = createBaseExpression(207);
|
|
19344
19345
|
node.flags |= 32;
|
|
19345
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19346
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19346
19347
|
node.questionDotToken = questionDotToken;
|
|
19347
19348
|
node.argumentExpression = asExpression(index);
|
|
19348
19349
|
node.transformFlags |=
|
|
@@ -19362,7 +19363,7 @@ var ts;
|
|
|
19362
19363
|
}
|
|
19363
19364
|
function createCallExpression(expression, typeArguments, argumentsArray) {
|
|
19364
19365
|
var node = createBaseExpression(208);
|
|
19365
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19366
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19366
19367
|
node.typeArguments = asNodeArray(typeArguments);
|
|
19367
19368
|
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
|
|
19368
19369
|
node.transformFlags |=
|
|
@@ -19393,7 +19394,7 @@ var ts;
|
|
|
19393
19394
|
function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
|
|
19394
19395
|
var node = createBaseExpression(208);
|
|
19395
19396
|
node.flags |= 32;
|
|
19396
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19397
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19397
19398
|
node.questionDotToken = questionDotToken;
|
|
19398
19399
|
node.typeArguments = asNodeArray(typeArguments);
|
|
19399
19400
|
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
|
|
@@ -19444,7 +19445,7 @@ var ts;
|
|
|
19444
19445
|
}
|
|
19445
19446
|
function createTaggedTemplateExpression(tag, typeArguments, template) {
|
|
19446
19447
|
var node = createBaseExpression(210);
|
|
19447
|
-
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag);
|
|
19448
|
+
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
|
|
19448
19449
|
node.typeArguments = asNodeArray(typeArguments);
|
|
19449
19450
|
node.template = template;
|
|
19450
19451
|
node.transformFlags |=
|
|
@@ -19833,7 +19834,7 @@ var ts;
|
|
|
19833
19834
|
}
|
|
19834
19835
|
function createExpressionWithTypeArguments(expression, typeArguments) {
|
|
19835
19836
|
var node = createBaseNode(228);
|
|
19836
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19837
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19837
19838
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
19838
19839
|
node.transformFlags |=
|
|
19839
19840
|
propagateChildFlags(node.expression) |
|
|
@@ -19865,7 +19866,7 @@ var ts;
|
|
|
19865
19866
|
}
|
|
19866
19867
|
function createNonNullExpression(expression) {
|
|
19867
19868
|
var node = createBaseExpression(230);
|
|
19868
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19869
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
19869
19870
|
node.transformFlags |=
|
|
19870
19871
|
propagateChildFlags(node.expression) |
|
|
19871
19872
|
1;
|
|
@@ -19882,7 +19883,7 @@ var ts;
|
|
|
19882
19883
|
function createNonNullChain(expression) {
|
|
19883
19884
|
var node = createBaseExpression(230);
|
|
19884
19885
|
node.flags |= 32;
|
|
19885
|
-
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
19886
|
+
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
19886
19887
|
node.transformFlags |=
|
|
19887
19888
|
propagateChildFlags(node.expression) |
|
|
19888
19889
|
1;
|
|
@@ -21725,7 +21726,7 @@ var ts;
|
|
|
21725
21726
|
}
|
|
21726
21727
|
else if (ts.getEmitFlags(callee) & 4096) {
|
|
21727
21728
|
thisArg = createVoidZero();
|
|
21728
|
-
target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee);
|
|
21729
|
+
target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee, false);
|
|
21729
21730
|
}
|
|
21730
21731
|
else if (ts.isPropertyAccessExpression(callee)) {
|
|
21731
21732
|
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
|
|
@@ -21751,7 +21752,7 @@ var ts;
|
|
|
21751
21752
|
}
|
|
21752
21753
|
else {
|
|
21753
21754
|
thisArg = createVoidZero();
|
|
21754
|
-
target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
|
21755
|
+
target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
21755
21756
|
}
|
|
21756
21757
|
return { target: target, thisArg: thisArg };
|
|
21757
21758
|
}
|
|
@@ -70471,17 +70472,28 @@ var ts;
|
|
|
70471
70472
|
return type[cacheKey] = cachedTypes;
|
|
70472
70473
|
}
|
|
70473
70474
|
function getIterationTypesOfIterable(type, use, errorNode) {
|
|
70475
|
+
var _a, _b;
|
|
70474
70476
|
if (isTypeAny(type)) {
|
|
70475
70477
|
return anyIterationTypes;
|
|
70476
70478
|
}
|
|
70477
70479
|
if (!(type.flags & 1048576)) {
|
|
70478
|
-
var
|
|
70480
|
+
var errorOutputContainer = errorNode ? { errors: undefined } : undefined;
|
|
70481
|
+
var iterationTypes_1 = getIterationTypesOfIterableWorker(type, use, errorNode, errorOutputContainer);
|
|
70479
70482
|
if (iterationTypes_1 === noIterationTypes) {
|
|
70480
70483
|
if (errorNode) {
|
|
70481
|
-
reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70484
|
+
var rootDiag = reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70485
|
+
if (errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) {
|
|
70486
|
+
ts.addRelatedInfo.apply(void 0, __spreadArray([rootDiag], errorOutputContainer.errors, false));
|
|
70487
|
+
}
|
|
70482
70488
|
}
|
|
70483
70489
|
return undefined;
|
|
70484
70490
|
}
|
|
70491
|
+
else if ((_a = errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) === null || _a === void 0 ? void 0 : _a.length) {
|
|
70492
|
+
for (var _i = 0, _c = errorOutputContainer.errors; _i < _c.length; _i++) {
|
|
70493
|
+
var diag = _c[_i];
|
|
70494
|
+
diagnostics.add(diag);
|
|
70495
|
+
}
|
|
70496
|
+
}
|
|
70485
70497
|
return iterationTypes_1;
|
|
70486
70498
|
}
|
|
70487
70499
|
var cacheKey = use & 2 ? "iterationTypesOfAsyncIterable" : "iterationTypesOfIterable";
|
|
@@ -70489,19 +70501,27 @@ var ts;
|
|
|
70489
70501
|
if (cachedTypes)
|
|
70490
70502
|
return cachedTypes === noIterationTypes ? undefined : cachedTypes;
|
|
70491
70503
|
var allIterationTypes;
|
|
70492
|
-
for (var
|
|
70493
|
-
var constituent =
|
|
70494
|
-
var
|
|
70504
|
+
for (var _d = 0, _e = type.types; _d < _e.length; _d++) {
|
|
70505
|
+
var constituent = _e[_d];
|
|
70506
|
+
var errorOutputContainer = errorNode ? { errors: undefined } : undefined;
|
|
70507
|
+
var iterationTypes_2 = getIterationTypesOfIterableWorker(constituent, use, errorNode, errorOutputContainer);
|
|
70495
70508
|
if (iterationTypes_2 === noIterationTypes) {
|
|
70496
70509
|
if (errorNode) {
|
|
70497
|
-
reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70510
|
+
var rootDiag = reportTypeNotIterableError(errorNode, type, !!(use & 2));
|
|
70511
|
+
if (errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) {
|
|
70512
|
+
ts.addRelatedInfo.apply(void 0, __spreadArray([rootDiag], errorOutputContainer.errors, false));
|
|
70513
|
+
}
|
|
70498
70514
|
}
|
|
70499
70515
|
setCachedIterationTypes(type, cacheKey, noIterationTypes);
|
|
70500
70516
|
return undefined;
|
|
70501
70517
|
}
|
|
70502
|
-
else {
|
|
70503
|
-
|
|
70518
|
+
else if ((_b = errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) === null || _b === void 0 ? void 0 : _b.length) {
|
|
70519
|
+
for (var _f = 0, _g = errorOutputContainer.errors; _f < _g.length; _f++) {
|
|
70520
|
+
var diag = _g[_f];
|
|
70521
|
+
diagnostics.add(diag);
|
|
70522
|
+
}
|
|
70504
70523
|
}
|
|
70524
|
+
allIterationTypes = ts.append(allIterationTypes, iterationTypes_2);
|
|
70505
70525
|
}
|
|
70506
70526
|
var iterationTypes = allIterationTypes ? combineIterationTypes(allIterationTypes) : noIterationTypes;
|
|
70507
70527
|
setCachedIterationTypes(type, cacheKey, iterationTypes);
|
|
@@ -70518,46 +70538,57 @@ var ts;
|
|
|
70518
70538
|
}
|
|
70519
70539
|
return createIterationTypes(getAwaitedType(yieldType, errorNode) || anyType, getAwaitedType(returnType, errorNode) || anyType, nextType);
|
|
70520
70540
|
}
|
|
70521
|
-
function getIterationTypesOfIterableWorker(type, use, errorNode) {
|
|
70541
|
+
function getIterationTypesOfIterableWorker(type, use, errorNode, errorOutputContainer) {
|
|
70522
70542
|
if (isTypeAny(type)) {
|
|
70523
70543
|
return anyIterationTypes;
|
|
70524
70544
|
}
|
|
70545
|
+
var noCache = false;
|
|
70525
70546
|
if (use & 2) {
|
|
70526
70547
|
var iterationTypes = getIterationTypesOfIterableCached(type, asyncIterationTypesResolver) ||
|
|
70527
70548
|
getIterationTypesOfIterableFast(type, asyncIterationTypesResolver);
|
|
70528
70549
|
if (iterationTypes) {
|
|
70529
|
-
|
|
70530
|
-
|
|
70531
|
-
|
|
70550
|
+
if (iterationTypes === noIterationTypes && errorNode) {
|
|
70551
|
+
noCache = true;
|
|
70552
|
+
}
|
|
70553
|
+
else {
|
|
70554
|
+
return use & 8 ?
|
|
70555
|
+
getAsyncFromSyncIterationTypes(iterationTypes, errorNode) :
|
|
70556
|
+
iterationTypes;
|
|
70557
|
+
}
|
|
70532
70558
|
}
|
|
70533
70559
|
}
|
|
70534
70560
|
if (use & 1) {
|
|
70535
70561
|
var iterationTypes = getIterationTypesOfIterableCached(type, syncIterationTypesResolver) ||
|
|
70536
70562
|
getIterationTypesOfIterableFast(type, syncIterationTypesResolver);
|
|
70537
70563
|
if (iterationTypes) {
|
|
70538
|
-
if (
|
|
70539
|
-
|
|
70540
|
-
return setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", getAsyncFromSyncIterationTypes(iterationTypes, errorNode));
|
|
70541
|
-
}
|
|
70564
|
+
if (iterationTypes === noIterationTypes && errorNode) {
|
|
70565
|
+
noCache = true;
|
|
70542
70566
|
}
|
|
70543
70567
|
else {
|
|
70544
|
-
|
|
70568
|
+
if (use & 2) {
|
|
70569
|
+
if (iterationTypes !== noIterationTypes) {
|
|
70570
|
+
iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode);
|
|
70571
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", iterationTypes);
|
|
70572
|
+
}
|
|
70573
|
+
}
|
|
70574
|
+
else {
|
|
70575
|
+
return iterationTypes;
|
|
70576
|
+
}
|
|
70545
70577
|
}
|
|
70546
70578
|
}
|
|
70547
70579
|
}
|
|
70548
70580
|
if (use & 2) {
|
|
70549
|
-
var iterationTypes = getIterationTypesOfIterableSlow(type, asyncIterationTypesResolver, errorNode);
|
|
70581
|
+
var iterationTypes = getIterationTypesOfIterableSlow(type, asyncIterationTypesResolver, errorNode, errorOutputContainer, noCache);
|
|
70550
70582
|
if (iterationTypes !== noIterationTypes) {
|
|
70551
70583
|
return iterationTypes;
|
|
70552
70584
|
}
|
|
70553
70585
|
}
|
|
70554
70586
|
if (use & 1) {
|
|
70555
|
-
var iterationTypes = getIterationTypesOfIterableSlow(type, syncIterationTypesResolver, errorNode);
|
|
70587
|
+
var iterationTypes = getIterationTypesOfIterableSlow(type, syncIterationTypesResolver, errorNode, errorOutputContainer, noCache);
|
|
70556
70588
|
if (iterationTypes !== noIterationTypes) {
|
|
70557
70589
|
if (use & 2) {
|
|
70558
|
-
|
|
70559
|
-
|
|
70560
|
-
: noIterationTypes);
|
|
70590
|
+
iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode);
|
|
70591
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", iterationTypes);
|
|
70561
70592
|
}
|
|
70562
70593
|
else {
|
|
70563
70594
|
return iterationTypes;
|
|
@@ -70571,7 +70602,7 @@ var ts;
|
|
|
70571
70602
|
}
|
|
70572
70603
|
function getIterationTypesOfGlobalIterableType(globalType, resolver) {
|
|
70573
70604
|
var globalIterationTypes = getIterationTypesOfIterableCached(globalType, resolver) ||
|
|
70574
|
-
getIterationTypesOfIterableSlow(globalType, resolver, undefined);
|
|
70605
|
+
getIterationTypesOfIterableSlow(globalType, resolver, undefined, undefined, false);
|
|
70575
70606
|
return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
|
|
70576
70607
|
}
|
|
70577
70608
|
function getIterationTypesOfIterableFast(type, resolver) {
|
|
@@ -70592,34 +70623,41 @@ var ts;
|
|
|
70592
70623
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
70593
70624
|
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
|
|
70594
70625
|
}
|
|
70595
|
-
function getIterationTypesOfIterableSlow(type, resolver, errorNode) {
|
|
70626
|
+
function getIterationTypesOfIterableSlow(type, resolver, errorNode, errorOutputContainer, noCache) {
|
|
70596
70627
|
var _a;
|
|
70597
70628
|
var method = getPropertyOfType(type, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName));
|
|
70598
70629
|
var methodType = method && !(method.flags & 16777216) ? getTypeOfSymbol(method) : undefined;
|
|
70599
70630
|
if (isTypeAny(methodType)) {
|
|
70600
|
-
return setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes);
|
|
70631
|
+
return noCache ? anyIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes);
|
|
70601
70632
|
}
|
|
70602
70633
|
var signatures = methodType ? getSignaturesOfType(methodType, 0) : undefined;
|
|
70603
70634
|
if (!ts.some(signatures)) {
|
|
70604
|
-
return setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);
|
|
70635
|
+
return noCache ? noIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);
|
|
70605
70636
|
}
|
|
70606
70637
|
var iteratorType = getIntersectionType(ts.map(signatures, getReturnTypeOfSignature));
|
|
70607
|
-
var iterationTypes = (_a =
|
|
70608
|
-
return setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);
|
|
70638
|
+
var iterationTypes = (_a = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache)) !== null && _a !== void 0 ? _a : noIterationTypes;
|
|
70639
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);
|
|
70609
70640
|
}
|
|
70610
70641
|
function reportTypeNotIterableError(errorNode, type, allowAsyncIterables) {
|
|
70611
70642
|
var message = allowAsyncIterables
|
|
70612
70643
|
? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator
|
|
70613
70644
|
: ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;
|
|
70614
|
-
errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
|
|
70645
|
+
return errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
|
|
70646
|
+
}
|
|
70647
|
+
function getIterationTypesOfIterator(type, resolver, errorNode, errorOutputContainer) {
|
|
70648
|
+
return getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, false);
|
|
70615
70649
|
}
|
|
70616
|
-
function
|
|
70650
|
+
function getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, noCache) {
|
|
70617
70651
|
if (isTypeAny(type)) {
|
|
70618
70652
|
return anyIterationTypes;
|
|
70619
70653
|
}
|
|
70620
70654
|
var iterationTypes = getIterationTypesOfIteratorCached(type, resolver) ||
|
|
70621
|
-
getIterationTypesOfIteratorFast(type, resolver)
|
|
70622
|
-
|
|
70655
|
+
getIterationTypesOfIteratorFast(type, resolver);
|
|
70656
|
+
if (iterationTypes === noIterationTypes && errorNode) {
|
|
70657
|
+
iterationTypes = undefined;
|
|
70658
|
+
noCache = true;
|
|
70659
|
+
}
|
|
70660
|
+
iterationTypes !== null && iterationTypes !== void 0 ? iterationTypes : (iterationTypes = getIterationTypesOfIteratorSlow(type, resolver, errorNode, errorOutputContainer, noCache));
|
|
70623
70661
|
return iterationTypes === noIterationTypes ? undefined : iterationTypes;
|
|
70624
70662
|
}
|
|
70625
70663
|
function getIterationTypesOfIteratorCached(type, resolver) {
|
|
@@ -70630,7 +70668,7 @@ var ts;
|
|
|
70630
70668
|
if (isReferenceToType(type, globalType)) {
|
|
70631
70669
|
var yieldType = getTypeArguments(type)[0];
|
|
70632
70670
|
var globalIterationTypes = getIterationTypesOfIteratorCached(globalType, resolver) ||
|
|
70633
|
-
getIterationTypesOfIteratorSlow(globalType, resolver, undefined);
|
|
70671
|
+
getIterationTypesOfIteratorSlow(globalType, resolver, undefined, undefined, false);
|
|
70634
70672
|
var _a = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes, returnType = _a.returnType, nextType = _a.nextType;
|
|
70635
70673
|
return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType));
|
|
70636
70674
|
}
|
|
@@ -70675,8 +70713,8 @@ var ts;
|
|
|
70675
70713
|
}
|
|
70676
70714
|
return setCachedIterationTypes(type, "iterationTypesOfIteratorResult", createIterationTypes(yieldType, returnType || voidType, undefined));
|
|
70677
70715
|
}
|
|
70678
|
-
function getIterationTypesOfMethod(type, resolver, methodName, errorNode) {
|
|
70679
|
-
var _a, _b, _c, _d;
|
|
70716
|
+
function getIterationTypesOfMethod(type, resolver, methodName, errorNode, errorOutputContainer) {
|
|
70717
|
+
var _a, _b, _c, _d, _e, _f;
|
|
70680
70718
|
var method = getPropertyOfType(type, methodName);
|
|
70681
70719
|
if (!method && methodName !== "next") {
|
|
70682
70720
|
return undefined;
|
|
@@ -70693,15 +70731,21 @@ var ts;
|
|
|
70693
70731
|
var diagnostic = methodName === "next"
|
|
70694
70732
|
? resolver.mustHaveANextMethodDiagnostic
|
|
70695
70733
|
: resolver.mustBeAMethodDiagnostic;
|
|
70696
|
-
|
|
70734
|
+
if (errorOutputContainer) {
|
|
70735
|
+
(_a = errorOutputContainer.errors) !== null && _a !== void 0 ? _a : (errorOutputContainer.errors = []);
|
|
70736
|
+
errorOutputContainer.errors.push(ts.createDiagnosticForNode(errorNode, diagnostic, methodName));
|
|
70737
|
+
}
|
|
70738
|
+
else {
|
|
70739
|
+
error(errorNode, diagnostic, methodName);
|
|
70740
|
+
}
|
|
70697
70741
|
}
|
|
70698
|
-
return methodName === "next" ?
|
|
70742
|
+
return methodName === "next" ? noIterationTypes : undefined;
|
|
70699
70743
|
}
|
|
70700
70744
|
if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) {
|
|
70701
70745
|
var globalGeneratorType = resolver.getGlobalGeneratorType(false);
|
|
70702
70746
|
var globalIteratorType = resolver.getGlobalIteratorType(false);
|
|
70703
|
-
var isGeneratorMethod = ((
|
|
70704
|
-
var isIteratorMethod = !isGeneratorMethod && ((
|
|
70747
|
+
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;
|
|
70748
|
+
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
70749
|
if (isGeneratorMethod || isIteratorMethod) {
|
|
70706
70750
|
var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType;
|
|
70707
70751
|
var mapper = methodType.mapper;
|
|
@@ -70735,7 +70779,13 @@ var ts;
|
|
|
70735
70779
|
var iterationTypes = getIterationTypesOfIteratorResult(resolvedMethodReturnType);
|
|
70736
70780
|
if (iterationTypes === noIterationTypes) {
|
|
70737
70781
|
if (errorNode) {
|
|
70738
|
-
|
|
70782
|
+
if (errorOutputContainer) {
|
|
70783
|
+
(_f = errorOutputContainer.errors) !== null && _f !== void 0 ? _f : (errorOutputContainer.errors = []);
|
|
70784
|
+
errorOutputContainer.errors.push(ts.createDiagnosticForNode(errorNode, resolver.mustHaveAValueDiagnostic, methodName));
|
|
70785
|
+
}
|
|
70786
|
+
else {
|
|
70787
|
+
error(errorNode, resolver.mustHaveAValueDiagnostic, methodName);
|
|
70788
|
+
}
|
|
70739
70789
|
}
|
|
70740
70790
|
yieldType = anyType;
|
|
70741
70791
|
returnTypes = ts.append(returnTypes, anyType);
|
|
@@ -70746,13 +70796,13 @@ var ts;
|
|
|
70746
70796
|
}
|
|
70747
70797
|
return createIterationTypes(yieldType, getUnionType(returnTypes), nextType);
|
|
70748
70798
|
}
|
|
70749
|
-
function getIterationTypesOfIteratorSlow(type, resolver, errorNode) {
|
|
70799
|
+
function getIterationTypesOfIteratorSlow(type, resolver, errorNode, errorOutputContainer, noCache) {
|
|
70750
70800
|
var iterationTypes = combineIterationTypes([
|
|
70751
|
-
getIterationTypesOfMethod(type, resolver, "next", errorNode),
|
|
70752
|
-
getIterationTypesOfMethod(type, resolver, "return", errorNode),
|
|
70753
|
-
getIterationTypesOfMethod(type, resolver, "throw", errorNode),
|
|
70801
|
+
getIterationTypesOfMethod(type, resolver, "next", errorNode, errorOutputContainer),
|
|
70802
|
+
getIterationTypesOfMethod(type, resolver, "return", errorNode, errorOutputContainer),
|
|
70803
|
+
getIterationTypesOfMethod(type, resolver, "throw", errorNode, errorOutputContainer),
|
|
70754
70804
|
]);
|
|
70755
|
-
return setCachedIterationTypes(type, resolver.iteratorCacheKey, iterationTypes);
|
|
70805
|
+
return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iteratorCacheKey, iterationTypes);
|
|
70756
70806
|
}
|
|
70757
70807
|
function getIterationTypeOfGeneratorFunctionReturnType(kind, returnType, isAsyncGenerator) {
|
|
70758
70808
|
if (isTypeAny(returnType)) {
|
|
@@ -70768,7 +70818,7 @@ var ts;
|
|
|
70768
70818
|
var use = isAsyncGenerator ? 2 : 1;
|
|
70769
70819
|
var resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver;
|
|
70770
70820
|
return getIterationTypesOfIterable(type, use, undefined) ||
|
|
70771
|
-
getIterationTypesOfIterator(type, resolver, undefined);
|
|
70821
|
+
getIterationTypesOfIterator(type, resolver, undefined, undefined);
|
|
70772
70822
|
}
|
|
70773
70823
|
function checkBreakOrContinueStatement(node) {
|
|
70774
70824
|
if (!checkGrammarStatementInAmbientContext(node))
|
|
@@ -101691,7 +101741,6 @@ var ts;
|
|
|
101691
101741
|
if (watcher.files === 0 && watcher.resolutions === 0) {
|
|
101692
101742
|
fileWatchesOfAffectingLocations.delete(path);
|
|
101693
101743
|
watcher.watcher.close();
|
|
101694
|
-
watcher.watcher = ts.noopFileWatcher;
|
|
101695
101744
|
}
|
|
101696
101745
|
});
|
|
101697
101746
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
@@ -102011,20 +102060,26 @@ var ts;
|
|
|
102011
102060
|
}
|
|
102012
102061
|
var paths = new ts.Set();
|
|
102013
102062
|
paths.add(locationToWatch);
|
|
102063
|
+
var actualWatcher = canWatchDirectoryOrFile(resolutionHost.toPath(locationToWatch)) ?
|
|
102064
|
+
resolutionHost.watchAffectingFileLocation(locationToWatch, function (fileName, eventKind) {
|
|
102065
|
+
cachedDirectoryStructureHost === null || cachedDirectoryStructureHost === void 0 ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
102066
|
+
var packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
|
102067
|
+
paths.forEach(function (path) {
|
|
102068
|
+
if (watcher.resolutions)
|
|
102069
|
+
(affectingPathChecks !== null && affectingPathChecks !== void 0 ? affectingPathChecks : (affectingPathChecks = new ts.Set())).add(path);
|
|
102070
|
+
if (watcher.files)
|
|
102071
|
+
(affectingPathChecksForFile !== null && affectingPathChecksForFile !== void 0 ? affectingPathChecksForFile : (affectingPathChecksForFile = new ts.Set())).add(path);
|
|
102072
|
+
packageJsonMap === null || packageJsonMap === void 0 ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
|
|
102073
|
+
});
|
|
102074
|
+
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
102075
|
+
}) : ts.noopFileWatcher;
|
|
102014
102076
|
var watcher = {
|
|
102015
|
-
watcher:
|
|
102016
|
-
|
|
102017
|
-
|
|
102018
|
-
|
|
102019
|
-
|
|
102020
|
-
|
|
102021
|
-
(affectingPathChecks !== null && affectingPathChecks !== void 0 ? affectingPathChecks : (affectingPathChecks = new ts.Set())).add(path);
|
|
102022
|
-
if (watcher.files)
|
|
102023
|
-
(affectingPathChecksForFile !== null && affectingPathChecksForFile !== void 0 ? affectingPathChecksForFile : (affectingPathChecksForFile = new ts.Set())).add(path);
|
|
102024
|
-
(_a = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()) === null || _a === void 0 ? void 0 : _a.delete(resolutionHost.toPath(path));
|
|
102025
|
-
});
|
|
102026
|
-
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
102027
|
-
}) : ts.noopFileWatcher,
|
|
102077
|
+
watcher: actualWatcher !== ts.noopFileWatcher ? {
|
|
102078
|
+
close: function () {
|
|
102079
|
+
actualWatcher.close();
|
|
102080
|
+
actualWatcher = ts.noopFileWatcher;
|
|
102081
|
+
}
|
|
102082
|
+
} : actualWatcher,
|
|
102028
102083
|
resolutions: forResolution ? 1 : 0,
|
|
102029
102084
|
files: forResolution ? 0 : 1,
|
|
102030
102085
|
paths: paths,
|
|
@@ -102373,7 +102428,7 @@ var ts;
|
|
|
102373
102428
|
var info = getInfo(importingSourceFileName, host);
|
|
102374
102429
|
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
|
|
102375
102430
|
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, undefined, options.overrideImportMode); }) ||
|
|
102376
|
-
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
|
|
102431
|
+
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
|
|
102377
102432
|
}
|
|
102378
102433
|
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options) {
|
|
102379
102434
|
if (options === void 0) { options = {}; }
|
|
@@ -102444,7 +102499,7 @@ var ts;
|
|
|
102444
102499
|
return nodeModulesSpecifiers;
|
|
102445
102500
|
}
|
|
102446
102501
|
if (!specifier && !modulePath.isRedirect) {
|
|
102447
|
-
var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences);
|
|
102502
|
+
var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
|
|
102448
102503
|
if (ts.pathIsBareSpecifier(local)) {
|
|
102449
102504
|
pathsSpecifiers = ts.append(pathsSpecifiers, local);
|
|
102450
102505
|
}
|
|
@@ -102462,7 +102517,7 @@ var ts;
|
|
|
102462
102517
|
var sourceDirectory = ts.getDirectoryPath(importingSourceFileName);
|
|
102463
102518
|
return { getCanonicalFileName: getCanonicalFileName, importingSourceFileName: importingSourceFileName, sourceDirectory: sourceDirectory };
|
|
102464
102519
|
}
|
|
102465
|
-
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, _a) {
|
|
102520
|
+
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, _a) {
|
|
102466
102521
|
var ending = _a.ending, relativePreference = _a.relativePreference;
|
|
102467
102522
|
var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs;
|
|
102468
102523
|
var sourceDirectory = info.sourceDirectory, getCanonicalFileName = info.getCanonicalFileName;
|
|
@@ -102476,9 +102531,8 @@ var ts;
|
|
|
102476
102531
|
if (!relativeToBaseUrl) {
|
|
102477
102532
|
return relativePath;
|
|
102478
102533
|
}
|
|
102479
|
-
var
|
|
102480
|
-
var
|
|
102481
|
-
var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;
|
|
102534
|
+
var fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, getAllowedEndings(ending, compilerOptions, importMode), host, compilerOptions);
|
|
102535
|
+
var nonRelative = fromPaths === undefined && baseUrl !== undefined ? removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions) : fromPaths;
|
|
102482
102536
|
if (!nonRelative) {
|
|
102483
102537
|
return relativePath;
|
|
102484
102538
|
}
|
|
@@ -102675,28 +102729,59 @@ var ts;
|
|
|
102675
102729
|
return ambientModuleDeclare.name.text;
|
|
102676
102730
|
}
|
|
102677
102731
|
}
|
|
102678
|
-
function
|
|
102732
|
+
function getAllowedEndings(preferredEnding, compilerOptions, importMode) {
|
|
102733
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) >= ts.ModuleResolutionKind.Node16 && importMode === ts.ModuleKind.ESNext) {
|
|
102734
|
+
return [2];
|
|
102735
|
+
}
|
|
102736
|
+
switch (preferredEnding) {
|
|
102737
|
+
case 2: return [2, 0, 1];
|
|
102738
|
+
case 1: return [1, 0, 2];
|
|
102739
|
+
case 0: return [0, 1, 2];
|
|
102740
|
+
default: ts.Debug.assertNever(preferredEnding);
|
|
102741
|
+
}
|
|
102742
|
+
}
|
|
102743
|
+
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
102679
102744
|
for (var key in paths) {
|
|
102680
|
-
|
|
102681
|
-
var
|
|
102682
|
-
var pattern = ts.removeFileExtension(ts.normalizePath(patternText_1));
|
|
102745
|
+
var _loop_36 = function (patternText_1) {
|
|
102746
|
+
var pattern = ts.normalizePath(patternText_1);
|
|
102683
102747
|
var indexOfStar = pattern.indexOf("*");
|
|
102748
|
+
var candidates = allowedEndings.map(function (ending) { return ({
|
|
102749
|
+
ending: ending,
|
|
102750
|
+
value: removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions)
|
|
102751
|
+
}); });
|
|
102752
|
+
if (ts.tryGetExtensionFromPath(pattern)) {
|
|
102753
|
+
candidates.push({ ending: undefined, value: relativeToBaseUrl });
|
|
102754
|
+
}
|
|
102684
102755
|
if (indexOfStar !== -1) {
|
|
102685
|
-
var prefix = pattern.
|
|
102686
|
-
var suffix = pattern.
|
|
102687
|
-
|
|
102688
|
-
|
|
102689
|
-
|
|
102690
|
-
|
|
102691
|
-
|
|
102692
|
-
|
|
102756
|
+
var prefix = pattern.substring(0, indexOfStar);
|
|
102757
|
+
var suffix = pattern.substring(indexOfStar + 1);
|
|
102758
|
+
for (var _b = 0, candidates_3 = candidates; _b < candidates_3.length; _b++) {
|
|
102759
|
+
var _c = candidates_3[_b], ending = _c.ending, value = _c.value;
|
|
102760
|
+
if (value.length >= prefix.length + suffix.length &&
|
|
102761
|
+
ts.startsWith(value, prefix) &&
|
|
102762
|
+
ts.endsWith(value, suffix) &&
|
|
102763
|
+
validateEnding({ ending: ending, value: value })) {
|
|
102764
|
+
var matchedStar = value.substring(prefix.length, value.length - suffix.length);
|
|
102765
|
+
return { value: key.replace("*", matchedStar) };
|
|
102766
|
+
}
|
|
102693
102767
|
}
|
|
102694
102768
|
}
|
|
102695
|
-
else if (
|
|
102696
|
-
return
|
|
102769
|
+
else if (ts.some(candidates, function (c) { return c.ending !== 0 && pattern === c.value; }) ||
|
|
102770
|
+
ts.some(candidates, function (c) { return c.ending === 0 && pattern === c.value && validateEnding(c); })) {
|
|
102771
|
+
return { value: key };
|
|
102697
102772
|
}
|
|
102773
|
+
};
|
|
102774
|
+
for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
|
|
102775
|
+
var patternText_1 = _a[_i];
|
|
102776
|
+
var state_12 = _loop_36(patternText_1);
|
|
102777
|
+
if (typeof state_12 === "object")
|
|
102778
|
+
return state_12.value;
|
|
102698
102779
|
}
|
|
102699
102780
|
}
|
|
102781
|
+
function validateEnding(_a) {
|
|
102782
|
+
var ending = _a.ending, value = _a.value;
|
|
102783
|
+
return ending !== 0 || value === removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions, host);
|
|
102784
|
+
}
|
|
102700
102785
|
}
|
|
102701
102786
|
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports, conditions, mode) {
|
|
102702
102787
|
if (mode === void 0) { mode = 0; }
|
|
@@ -102779,10 +102864,10 @@ var ts;
|
|
|
102779
102864
|
if (!parts) {
|
|
102780
102865
|
return undefined;
|
|
102781
102866
|
}
|
|
102867
|
+
var preferences = getPreferences(host, userPreferences, options, importingSourceFile);
|
|
102782
102868
|
var moduleSpecifier = path;
|
|
102783
102869
|
var isPackageRootPath = false;
|
|
102784
102870
|
if (!packageNameOnly) {
|
|
102785
|
-
var preferences = getPreferences(host, userPreferences, options, importingSourceFile);
|
|
102786
102871
|
var packageRootIndex = parts.packageRootIndex;
|
|
102787
102872
|
var moduleFileName = void 0;
|
|
102788
102873
|
while (true) {
|
|
@@ -102825,11 +102910,13 @@ var ts;
|
|
|
102825
102910
|
var packageRootPath = path.substring(0, packageRootIndex);
|
|
102826
102911
|
var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
|
|
102827
102912
|
var moduleFileToTry = path;
|
|
102913
|
+
var maybeBlockedByTypesVersions = false;
|
|
102828
102914
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
102829
102915
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
102830
102916
|
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
102917
|
+
var importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
102831
102918
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
102832
|
-
var conditions = ["node",
|
|
102919
|
+
var conditions = ["node", importMode === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
102833
102920
|
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
102834
102921
|
? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
|
|
102835
102922
|
: undefined;
|
|
@@ -102848,13 +102935,16 @@ var ts;
|
|
|
102848
102935
|
: undefined;
|
|
102849
102936
|
if (versionPaths) {
|
|
102850
102937
|
var subModuleName = path.slice(packageRootPath.length + 1);
|
|
102851
|
-
var fromPaths = tryGetModuleNameFromPaths(
|
|
102852
|
-
if (fromPaths
|
|
102938
|
+
var fromPaths = tryGetModuleNameFromPaths(subModuleName, versionPaths.paths, getAllowedEndings(preferences.ending, options, importMode), host, options);
|
|
102939
|
+
if (fromPaths === undefined) {
|
|
102940
|
+
maybeBlockedByTypesVersions = true;
|
|
102941
|
+
}
|
|
102942
|
+
else {
|
|
102853
102943
|
moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths);
|
|
102854
102944
|
}
|
|
102855
102945
|
}
|
|
102856
102946
|
var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js";
|
|
102857
|
-
if (ts.isString(mainFileRelative)) {
|
|
102947
|
+
if (ts.isString(mainFileRelative) && !(maybeBlockedByTypesVersions && ts.matchPatternOrExact(ts.tryParsePatterns(versionPaths.paths), mainFileRelative))) {
|
|
102858
102948
|
var mainExportFile = ts.toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
|
|
102859
102949
|
if (ts.removeFileExtension(mainExportFile) === ts.removeFileExtension(getCanonicalFileName(moduleFileToTry))) {
|
|
102860
102950
|
return { packageRootPath: packageRootPath, moduleFileToTry: moduleFileToTry };
|