@typescript-deploys/pr-build 5.0.0-pr-52282-27 → 5.0.0-pr-52632-9
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 +32 -36
- package/lib/tsserver.js +32 -36
- package/lib/tsserverlibrary.js +32 -36
- package/lib/typescript.js +32 -36
- package/lib/typingsInstaller.js +0 -1
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -42122,7 +42122,6 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
|
42122
42122
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
42123
42123
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
42124
42124
|
SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity";
|
|
42125
|
-
SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature";
|
|
42126
42125
|
SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
|
|
42127
42126
|
return SignatureCheckMode3;
|
|
42128
42127
|
})(SignatureCheckMode || {});
|
|
@@ -58230,24 +58229,16 @@ function createTypeChecker(host) {
|
|
|
58230
58229
|
void 0
|
|
58231
58230
|
) !== 0 /* False */;
|
|
58232
58231
|
}
|
|
58233
|
-
function
|
|
58234
|
-
|
|
58235
|
-
const paramType = getTypeOfParameter(s.parameters[0]);
|
|
58236
|
-
const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType;
|
|
58237
|
-
return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */);
|
|
58238
|
-
}
|
|
58239
|
-
return false;
|
|
58232
|
+
function isAnySignature(s) {
|
|
58233
|
+
return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s));
|
|
58240
58234
|
}
|
|
58241
58235
|
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
58242
58236
|
if (source === target) {
|
|
58243
58237
|
return -1 /* True */;
|
|
58244
58238
|
}
|
|
58245
|
-
if (
|
|
58239
|
+
if (isAnySignature(target)) {
|
|
58246
58240
|
return -1 /* True */;
|
|
58247
58241
|
}
|
|
58248
|
-
if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) {
|
|
58249
|
-
return 0 /* False */;
|
|
58250
|
-
}
|
|
58251
58242
|
const targetCount = getParameterCount(target);
|
|
58252
58243
|
const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount);
|
|
58253
58244
|
if (sourceHasMoreParameters) {
|
|
@@ -58465,9 +58456,7 @@ function createTypeChecker(host) {
|
|
|
58465
58456
|
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
|
|
58466
58457
|
const s = source.flags;
|
|
58467
58458
|
const t = target.flags;
|
|
58468
|
-
if (t &
|
|
58469
|
-
return true;
|
|
58470
|
-
if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */))
|
|
58459
|
+
if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType)
|
|
58471
58460
|
return true;
|
|
58472
58461
|
if (t & 131072 /* Never */)
|
|
58473
58462
|
return false;
|
|
@@ -60707,11 +60696,10 @@ function createTypeChecker(host) {
|
|
|
60707
60696
|
return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2));
|
|
60708
60697
|
}
|
|
60709
60698
|
function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
|
|
60710
|
-
const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
|
|
60711
60699
|
return compareSignaturesRelated(
|
|
60712
60700
|
erase ? getErasedSignature(source2) : source2,
|
|
60713
60701
|
erase ? getErasedSignature(target2) : target2,
|
|
60714
|
-
|
|
60702
|
+
relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0,
|
|
60715
60703
|
reportErrors2,
|
|
60716
60704
|
reportError,
|
|
60717
60705
|
incompatibleReporter,
|
|
@@ -60836,7 +60824,7 @@ function createTypeChecker(host) {
|
|
|
60836
60824
|
if (sourceInfo) {
|
|
60837
60825
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
60838
60826
|
}
|
|
60839
|
-
if (!(intersectionState & 1 /* Source */) &&
|
|
60827
|
+
if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) {
|
|
60840
60828
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
60841
60829
|
}
|
|
60842
60830
|
if (reportErrors2) {
|
|
@@ -61366,7 +61354,17 @@ function createTypeChecker(host) {
|
|
|
61366
61354
|
return propType;
|
|
61367
61355
|
}
|
|
61368
61356
|
if (everyType(type, isTupleType)) {
|
|
61369
|
-
return mapType(type, (t) =>
|
|
61357
|
+
return mapType(type, (t) => {
|
|
61358
|
+
const tupleType = t;
|
|
61359
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
61360
|
+
if (!restType) {
|
|
61361
|
+
return undefinedType;
|
|
61362
|
+
}
|
|
61363
|
+
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
61364
|
+
return getUnionType([restType, undefinedType]);
|
|
61365
|
+
}
|
|
61366
|
+
return restType;
|
|
61367
|
+
});
|
|
61370
61368
|
}
|
|
61371
61369
|
return void 0;
|
|
61372
61370
|
}
|
|
@@ -62541,7 +62539,13 @@ function createTypeChecker(host) {
|
|
|
62541
62539
|
return true;
|
|
62542
62540
|
}
|
|
62543
62541
|
if (constraintType.flags & 262144 /* TypeParameter */) {
|
|
62544
|
-
inferWithPriority(getIndexType(
|
|
62542
|
+
inferWithPriority(getIndexType(
|
|
62543
|
+
source,
|
|
62544
|
+
/*stringsOnly*/
|
|
62545
|
+
void 0,
|
|
62546
|
+
/*noIndexSignatures*/
|
|
62547
|
+
!!source.pattern
|
|
62548
|
+
), constraintType, 32 /* MappedTypeConstraint */);
|
|
62545
62549
|
const extendedConstraint = getConstraintOfType(constraintType);
|
|
62546
62550
|
if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
|
|
62547
62551
|
return true;
|
|
@@ -64008,7 +64012,7 @@ function createTypeChecker(host) {
|
|
|
64008
64012
|
}
|
|
64009
64013
|
return declaredType;
|
|
64010
64014
|
}
|
|
64011
|
-
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
|
|
64015
|
+
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) {
|
|
64012
64016
|
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
|
|
64013
64017
|
}
|
|
64014
64018
|
return void 0;
|
|
@@ -64723,29 +64727,18 @@ function createTypeChecker(host) {
|
|
|
64723
64727
|
return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived));
|
|
64724
64728
|
}
|
|
64725
64729
|
function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
|
|
64730
|
+
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
64726
64731
|
if (!assumeTrue) {
|
|
64727
|
-
|
|
64728
|
-
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
64729
|
-
}
|
|
64730
|
-
const trueType2 = getNarrowedType(
|
|
64731
|
-
type,
|
|
64732
|
-
candidate,
|
|
64733
|
-
/*assumeTrue*/
|
|
64734
|
-
true,
|
|
64735
|
-
/*checkDerived*/
|
|
64736
|
-
false
|
|
64737
|
-
);
|
|
64738
|
-
return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
|
|
64732
|
+
return filterType(type, (t) => !isRelated(t, candidate));
|
|
64739
64733
|
}
|
|
64740
64734
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
64741
64735
|
return candidate;
|
|
64742
64736
|
}
|
|
64743
|
-
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
64744
64737
|
const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
|
|
64745
64738
|
const narrowedType = mapType(candidate, (c) => {
|
|
64746
64739
|
const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
|
|
64747
64740
|
const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
|
|
64748
|
-
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t)
|
|
64741
|
+
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
|
|
64749
64742
|
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
|
|
64750
64743
|
});
|
|
64751
64744
|
return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
|
|
@@ -72501,7 +72494,7 @@ function createTypeChecker(host) {
|
|
|
72501
72494
|
return leftType;
|
|
72502
72495
|
} else {
|
|
72503
72496
|
checkAssignmentOperator(rightType);
|
|
72504
|
-
return rightType;
|
|
72497
|
+
return getRegularTypeOfObjectLiteral(rightType);
|
|
72505
72498
|
}
|
|
72506
72499
|
case 27 /* CommaToken */:
|
|
72507
72500
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) {
|
|
@@ -100449,6 +100442,9 @@ function transformModule(context) {
|
|
|
100449
100442
|
return visitEachChild(node, visitor, context);
|
|
100450
100443
|
}
|
|
100451
100444
|
function visitImportCallExpression(node) {
|
|
100445
|
+
if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) {
|
|
100446
|
+
return visitEachChild(node, visitor, context);
|
|
100447
|
+
}
|
|
100452
100448
|
const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions);
|
|
100453
100449
|
const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression);
|
|
100454
100450
|
const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
package/lib/tsserver.js
CHANGED
|
@@ -46686,7 +46686,6 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
|
46686
46686
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
46687
46687
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
46688
46688
|
SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity";
|
|
46689
|
-
SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature";
|
|
46690
46689
|
SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
|
|
46691
46690
|
return SignatureCheckMode3;
|
|
46692
46691
|
})(SignatureCheckMode || {});
|
|
@@ -62794,24 +62793,16 @@ function createTypeChecker(host) {
|
|
|
62794
62793
|
void 0
|
|
62795
62794
|
) !== 0 /* False */;
|
|
62796
62795
|
}
|
|
62797
|
-
function
|
|
62798
|
-
|
|
62799
|
-
const paramType = getTypeOfParameter(s.parameters[0]);
|
|
62800
|
-
const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType;
|
|
62801
|
-
return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */);
|
|
62802
|
-
}
|
|
62803
|
-
return false;
|
|
62796
|
+
function isAnySignature(s) {
|
|
62797
|
+
return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s));
|
|
62804
62798
|
}
|
|
62805
62799
|
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
62806
62800
|
if (source === target) {
|
|
62807
62801
|
return -1 /* True */;
|
|
62808
62802
|
}
|
|
62809
|
-
if (
|
|
62803
|
+
if (isAnySignature(target)) {
|
|
62810
62804
|
return -1 /* True */;
|
|
62811
62805
|
}
|
|
62812
|
-
if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) {
|
|
62813
|
-
return 0 /* False */;
|
|
62814
|
-
}
|
|
62815
62806
|
const targetCount = getParameterCount(target);
|
|
62816
62807
|
const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount);
|
|
62817
62808
|
if (sourceHasMoreParameters) {
|
|
@@ -63029,9 +63020,7 @@ function createTypeChecker(host) {
|
|
|
63029
63020
|
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
|
|
63030
63021
|
const s = source.flags;
|
|
63031
63022
|
const t = target.flags;
|
|
63032
|
-
if (t &
|
|
63033
|
-
return true;
|
|
63034
|
-
if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */))
|
|
63023
|
+
if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType)
|
|
63035
63024
|
return true;
|
|
63036
63025
|
if (t & 131072 /* Never */)
|
|
63037
63026
|
return false;
|
|
@@ -65271,11 +65260,10 @@ function createTypeChecker(host) {
|
|
|
65271
65260
|
return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2));
|
|
65272
65261
|
}
|
|
65273
65262
|
function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
|
|
65274
|
-
const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
|
|
65275
65263
|
return compareSignaturesRelated(
|
|
65276
65264
|
erase ? getErasedSignature(source2) : source2,
|
|
65277
65265
|
erase ? getErasedSignature(target2) : target2,
|
|
65278
|
-
|
|
65266
|
+
relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0,
|
|
65279
65267
|
reportErrors2,
|
|
65280
65268
|
reportError,
|
|
65281
65269
|
incompatibleReporter,
|
|
@@ -65400,7 +65388,7 @@ function createTypeChecker(host) {
|
|
|
65400
65388
|
if (sourceInfo) {
|
|
65401
65389
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
65402
65390
|
}
|
|
65403
|
-
if (!(intersectionState & 1 /* Source */) &&
|
|
65391
|
+
if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) {
|
|
65404
65392
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
65405
65393
|
}
|
|
65406
65394
|
if (reportErrors2) {
|
|
@@ -65930,7 +65918,17 @@ function createTypeChecker(host) {
|
|
|
65930
65918
|
return propType;
|
|
65931
65919
|
}
|
|
65932
65920
|
if (everyType(type, isTupleType)) {
|
|
65933
|
-
return mapType(type, (t) =>
|
|
65921
|
+
return mapType(type, (t) => {
|
|
65922
|
+
const tupleType = t;
|
|
65923
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
65924
|
+
if (!restType) {
|
|
65925
|
+
return undefinedType;
|
|
65926
|
+
}
|
|
65927
|
+
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
65928
|
+
return getUnionType([restType, undefinedType]);
|
|
65929
|
+
}
|
|
65930
|
+
return restType;
|
|
65931
|
+
});
|
|
65934
65932
|
}
|
|
65935
65933
|
return void 0;
|
|
65936
65934
|
}
|
|
@@ -67105,7 +67103,13 @@ function createTypeChecker(host) {
|
|
|
67105
67103
|
return true;
|
|
67106
67104
|
}
|
|
67107
67105
|
if (constraintType.flags & 262144 /* TypeParameter */) {
|
|
67108
|
-
inferWithPriority(getIndexType(
|
|
67106
|
+
inferWithPriority(getIndexType(
|
|
67107
|
+
source,
|
|
67108
|
+
/*stringsOnly*/
|
|
67109
|
+
void 0,
|
|
67110
|
+
/*noIndexSignatures*/
|
|
67111
|
+
!!source.pattern
|
|
67112
|
+
), constraintType, 32 /* MappedTypeConstraint */);
|
|
67109
67113
|
const extendedConstraint = getConstraintOfType(constraintType);
|
|
67110
67114
|
if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
|
|
67111
67115
|
return true;
|
|
@@ -68572,7 +68576,7 @@ function createTypeChecker(host) {
|
|
|
68572
68576
|
}
|
|
68573
68577
|
return declaredType;
|
|
68574
68578
|
}
|
|
68575
|
-
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
|
|
68579
|
+
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) {
|
|
68576
68580
|
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
|
|
68577
68581
|
}
|
|
68578
68582
|
return void 0;
|
|
@@ -69287,29 +69291,18 @@ function createTypeChecker(host) {
|
|
|
69287
69291
|
return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived));
|
|
69288
69292
|
}
|
|
69289
69293
|
function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
|
|
69294
|
+
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
69290
69295
|
if (!assumeTrue) {
|
|
69291
|
-
|
|
69292
|
-
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
69293
|
-
}
|
|
69294
|
-
const trueType2 = getNarrowedType(
|
|
69295
|
-
type,
|
|
69296
|
-
candidate,
|
|
69297
|
-
/*assumeTrue*/
|
|
69298
|
-
true,
|
|
69299
|
-
/*checkDerived*/
|
|
69300
|
-
false
|
|
69301
|
-
);
|
|
69302
|
-
return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
|
|
69296
|
+
return filterType(type, (t) => !isRelated(t, candidate));
|
|
69303
69297
|
}
|
|
69304
69298
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
69305
69299
|
return candidate;
|
|
69306
69300
|
}
|
|
69307
|
-
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
69308
69301
|
const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
|
|
69309
69302
|
const narrowedType = mapType(candidate, (c) => {
|
|
69310
69303
|
const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
|
|
69311
69304
|
const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
|
|
69312
|
-
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t)
|
|
69305
|
+
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
|
|
69313
69306
|
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
|
|
69314
69307
|
});
|
|
69315
69308
|
return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
|
|
@@ -77065,7 +77058,7 @@ function createTypeChecker(host) {
|
|
|
77065
77058
|
return leftType;
|
|
77066
77059
|
} else {
|
|
77067
77060
|
checkAssignmentOperator(rightType);
|
|
77068
|
-
return rightType;
|
|
77061
|
+
return getRegularTypeOfObjectLiteral(rightType);
|
|
77069
77062
|
}
|
|
77070
77063
|
case 27 /* CommaToken */:
|
|
77071
77064
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) {
|
|
@@ -105184,6 +105177,9 @@ function transformModule(context) {
|
|
|
105184
105177
|
return visitEachChild(node, visitor, context);
|
|
105185
105178
|
}
|
|
105186
105179
|
function visitImportCallExpression(node) {
|
|
105180
|
+
if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) {
|
|
105181
|
+
return visitEachChild(node, visitor, context);
|
|
105182
|
+
}
|
|
105187
105183
|
const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions);
|
|
105188
105184
|
const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression);
|
|
105189
105185
|
const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -60603,24 +60603,16 @@ ${lanes.join("\n")}
|
|
|
60603
60603
|
void 0
|
|
60604
60604
|
) !== 0 /* False */;
|
|
60605
60605
|
}
|
|
60606
|
-
function
|
|
60607
|
-
|
|
60608
|
-
const paramType = getTypeOfParameter(s.parameters[0]);
|
|
60609
|
-
const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType;
|
|
60610
|
-
return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */);
|
|
60611
|
-
}
|
|
60612
|
-
return false;
|
|
60606
|
+
function isAnySignature(s) {
|
|
60607
|
+
return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s));
|
|
60613
60608
|
}
|
|
60614
60609
|
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
60615
60610
|
if (source === target) {
|
|
60616
60611
|
return -1 /* True */;
|
|
60617
60612
|
}
|
|
60618
|
-
if (
|
|
60613
|
+
if (isAnySignature(target)) {
|
|
60619
60614
|
return -1 /* True */;
|
|
60620
60615
|
}
|
|
60621
|
-
if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) {
|
|
60622
|
-
return 0 /* False */;
|
|
60623
|
-
}
|
|
60624
60616
|
const targetCount = getParameterCount(target);
|
|
60625
60617
|
const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount);
|
|
60626
60618
|
if (sourceHasMoreParameters) {
|
|
@@ -60838,9 +60830,7 @@ ${lanes.join("\n")}
|
|
|
60838
60830
|
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
|
|
60839
60831
|
const s = source.flags;
|
|
60840
60832
|
const t = target.flags;
|
|
60841
|
-
if (t &
|
|
60842
|
-
return true;
|
|
60843
|
-
if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */))
|
|
60833
|
+
if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType)
|
|
60844
60834
|
return true;
|
|
60845
60835
|
if (t & 131072 /* Never */)
|
|
60846
60836
|
return false;
|
|
@@ -63080,11 +63070,10 @@ ${lanes.join("\n")}
|
|
|
63080
63070
|
return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2));
|
|
63081
63071
|
}
|
|
63082
63072
|
function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
|
|
63083
|
-
const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
|
|
63084
63073
|
return compareSignaturesRelated(
|
|
63085
63074
|
erase ? getErasedSignature(source2) : source2,
|
|
63086
63075
|
erase ? getErasedSignature(target2) : target2,
|
|
63087
|
-
|
|
63076
|
+
relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0,
|
|
63088
63077
|
reportErrors2,
|
|
63089
63078
|
reportError,
|
|
63090
63079
|
incompatibleReporter,
|
|
@@ -63209,7 +63198,7 @@ ${lanes.join("\n")}
|
|
|
63209
63198
|
if (sourceInfo) {
|
|
63210
63199
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
63211
63200
|
}
|
|
63212
|
-
if (!(intersectionState & 1 /* Source */) &&
|
|
63201
|
+
if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) {
|
|
63213
63202
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63214
63203
|
}
|
|
63215
63204
|
if (reportErrors2) {
|
|
@@ -63739,7 +63728,17 @@ ${lanes.join("\n")}
|
|
|
63739
63728
|
return propType;
|
|
63740
63729
|
}
|
|
63741
63730
|
if (everyType(type, isTupleType)) {
|
|
63742
|
-
return mapType(type, (t) =>
|
|
63731
|
+
return mapType(type, (t) => {
|
|
63732
|
+
const tupleType = t;
|
|
63733
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
63734
|
+
if (!restType) {
|
|
63735
|
+
return undefinedType;
|
|
63736
|
+
}
|
|
63737
|
+
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
63738
|
+
return getUnionType([restType, undefinedType]);
|
|
63739
|
+
}
|
|
63740
|
+
return restType;
|
|
63741
|
+
});
|
|
63743
63742
|
}
|
|
63744
63743
|
return void 0;
|
|
63745
63744
|
}
|
|
@@ -64914,7 +64913,13 @@ ${lanes.join("\n")}
|
|
|
64914
64913
|
return true;
|
|
64915
64914
|
}
|
|
64916
64915
|
if (constraintType.flags & 262144 /* TypeParameter */) {
|
|
64917
|
-
inferWithPriority(getIndexType(
|
|
64916
|
+
inferWithPriority(getIndexType(
|
|
64917
|
+
source,
|
|
64918
|
+
/*stringsOnly*/
|
|
64919
|
+
void 0,
|
|
64920
|
+
/*noIndexSignatures*/
|
|
64921
|
+
!!source.pattern
|
|
64922
|
+
), constraintType, 32 /* MappedTypeConstraint */);
|
|
64918
64923
|
const extendedConstraint = getConstraintOfType(constraintType);
|
|
64919
64924
|
if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
|
|
64920
64925
|
return true;
|
|
@@ -66381,7 +66386,7 @@ ${lanes.join("\n")}
|
|
|
66381
66386
|
}
|
|
66382
66387
|
return declaredType;
|
|
66383
66388
|
}
|
|
66384
|
-
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
|
|
66389
|
+
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) {
|
|
66385
66390
|
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
|
|
66386
66391
|
}
|
|
66387
66392
|
return void 0;
|
|
@@ -67096,29 +67101,18 @@ ${lanes.join("\n")}
|
|
|
67096
67101
|
return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived));
|
|
67097
67102
|
}
|
|
67098
67103
|
function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
|
|
67104
|
+
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
67099
67105
|
if (!assumeTrue) {
|
|
67100
|
-
|
|
67101
|
-
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
67102
|
-
}
|
|
67103
|
-
const trueType2 = getNarrowedType(
|
|
67104
|
-
type,
|
|
67105
|
-
candidate,
|
|
67106
|
-
/*assumeTrue*/
|
|
67107
|
-
true,
|
|
67108
|
-
/*checkDerived*/
|
|
67109
|
-
false
|
|
67110
|
-
);
|
|
67111
|
-
return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
|
|
67106
|
+
return filterType(type, (t) => !isRelated(t, candidate));
|
|
67112
67107
|
}
|
|
67113
67108
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
67114
67109
|
return candidate;
|
|
67115
67110
|
}
|
|
67116
|
-
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
67117
67111
|
const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
|
|
67118
67112
|
const narrowedType = mapType(candidate, (c) => {
|
|
67119
67113
|
const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
|
|
67120
67114
|
const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
|
|
67121
|
-
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t)
|
|
67115
|
+
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
|
|
67122
67116
|
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
|
|
67123
67117
|
});
|
|
67124
67118
|
return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
|
|
@@ -74874,7 +74868,7 @@ ${lanes.join("\n")}
|
|
|
74874
74868
|
return leftType;
|
|
74875
74869
|
} else {
|
|
74876
74870
|
checkAssignmentOperator(rightType);
|
|
74877
|
-
return rightType;
|
|
74871
|
+
return getRegularTypeOfObjectLiteral(rightType);
|
|
74878
74872
|
}
|
|
74879
74873
|
case 27 /* CommaToken */:
|
|
74880
74874
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) {
|
|
@@ -84593,7 +84587,6 @@ ${lanes.join("\n")}
|
|
|
84593
84587
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
84594
84588
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
84595
84589
|
SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity";
|
|
84596
|
-
SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature";
|
|
84597
84590
|
SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
|
|
84598
84591
|
return SignatureCheckMode3;
|
|
84599
84592
|
})(SignatureCheckMode || {});
|
|
@@ -103260,6 +103253,9 @@ ${lanes.join("\n")}
|
|
|
103260
103253
|
return visitEachChild(node, visitor, context);
|
|
103261
103254
|
}
|
|
103262
103255
|
function visitImportCallExpression(node) {
|
|
103256
|
+
if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) {
|
|
103257
|
+
return visitEachChild(node, visitor, context);
|
|
103258
|
+
}
|
|
103263
103259
|
const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions);
|
|
103264
103260
|
const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression);
|
|
103265
103261
|
const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
package/lib/typescript.js
CHANGED
|
@@ -60603,24 +60603,16 @@ ${lanes.join("\n")}
|
|
|
60603
60603
|
void 0
|
|
60604
60604
|
) !== 0 /* False */;
|
|
60605
60605
|
}
|
|
60606
|
-
function
|
|
60607
|
-
|
|
60608
|
-
const paramType = getTypeOfParameter(s.parameters[0]);
|
|
60609
|
-
const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType;
|
|
60610
|
-
return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */);
|
|
60611
|
-
}
|
|
60612
|
-
return false;
|
|
60606
|
+
function isAnySignature(s) {
|
|
60607
|
+
return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s));
|
|
60613
60608
|
}
|
|
60614
60609
|
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
60615
60610
|
if (source === target) {
|
|
60616
60611
|
return -1 /* True */;
|
|
60617
60612
|
}
|
|
60618
|
-
if (
|
|
60613
|
+
if (isAnySignature(target)) {
|
|
60619
60614
|
return -1 /* True */;
|
|
60620
60615
|
}
|
|
60621
|
-
if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) {
|
|
60622
|
-
return 0 /* False */;
|
|
60623
|
-
}
|
|
60624
60616
|
const targetCount = getParameterCount(target);
|
|
60625
60617
|
const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount);
|
|
60626
60618
|
if (sourceHasMoreParameters) {
|
|
@@ -60838,9 +60830,7 @@ ${lanes.join("\n")}
|
|
|
60838
60830
|
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
|
|
60839
60831
|
const s = source.flags;
|
|
60840
60832
|
const t = target.flags;
|
|
60841
|
-
if (t &
|
|
60842
|
-
return true;
|
|
60843
|
-
if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */))
|
|
60833
|
+
if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType)
|
|
60844
60834
|
return true;
|
|
60845
60835
|
if (t & 131072 /* Never */)
|
|
60846
60836
|
return false;
|
|
@@ -63080,11 +63070,10 @@ ${lanes.join("\n")}
|
|
|
63080
63070
|
return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2));
|
|
63081
63071
|
}
|
|
63082
63072
|
function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
|
|
63083
|
-
const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
|
|
63084
63073
|
return compareSignaturesRelated(
|
|
63085
63074
|
erase ? getErasedSignature(source2) : source2,
|
|
63086
63075
|
erase ? getErasedSignature(target2) : target2,
|
|
63087
|
-
|
|
63076
|
+
relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0,
|
|
63088
63077
|
reportErrors2,
|
|
63089
63078
|
reportError,
|
|
63090
63079
|
incompatibleReporter,
|
|
@@ -63209,7 +63198,7 @@ ${lanes.join("\n")}
|
|
|
63209
63198
|
if (sourceInfo) {
|
|
63210
63199
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
63211
63200
|
}
|
|
63212
|
-
if (!(intersectionState & 1 /* Source */) &&
|
|
63201
|
+
if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) {
|
|
63213
63202
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63214
63203
|
}
|
|
63215
63204
|
if (reportErrors2) {
|
|
@@ -63739,7 +63728,17 @@ ${lanes.join("\n")}
|
|
|
63739
63728
|
return propType;
|
|
63740
63729
|
}
|
|
63741
63730
|
if (everyType(type, isTupleType)) {
|
|
63742
|
-
return mapType(type, (t) =>
|
|
63731
|
+
return mapType(type, (t) => {
|
|
63732
|
+
const tupleType = t;
|
|
63733
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
63734
|
+
if (!restType) {
|
|
63735
|
+
return undefinedType;
|
|
63736
|
+
}
|
|
63737
|
+
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
63738
|
+
return getUnionType([restType, undefinedType]);
|
|
63739
|
+
}
|
|
63740
|
+
return restType;
|
|
63741
|
+
});
|
|
63743
63742
|
}
|
|
63744
63743
|
return void 0;
|
|
63745
63744
|
}
|
|
@@ -64914,7 +64913,13 @@ ${lanes.join("\n")}
|
|
|
64914
64913
|
return true;
|
|
64915
64914
|
}
|
|
64916
64915
|
if (constraintType.flags & 262144 /* TypeParameter */) {
|
|
64917
|
-
inferWithPriority(getIndexType(
|
|
64916
|
+
inferWithPriority(getIndexType(
|
|
64917
|
+
source,
|
|
64918
|
+
/*stringsOnly*/
|
|
64919
|
+
void 0,
|
|
64920
|
+
/*noIndexSignatures*/
|
|
64921
|
+
!!source.pattern
|
|
64922
|
+
), constraintType, 32 /* MappedTypeConstraint */);
|
|
64918
64923
|
const extendedConstraint = getConstraintOfType(constraintType);
|
|
64919
64924
|
if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
|
|
64920
64925
|
return true;
|
|
@@ -66381,7 +66386,7 @@ ${lanes.join("\n")}
|
|
|
66381
66386
|
}
|
|
66382
66387
|
return declaredType;
|
|
66383
66388
|
}
|
|
66384
|
-
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
|
|
66389
|
+
if (isVariableDeclaration(node) && node.parent.parent.kind === 246 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) {
|
|
66385
66390
|
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
|
|
66386
66391
|
}
|
|
66387
66392
|
return void 0;
|
|
@@ -67096,29 +67101,18 @@ ${lanes.join("\n")}
|
|
|
67096
67101
|
return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived));
|
|
67097
67102
|
}
|
|
67098
67103
|
function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
|
|
67104
|
+
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
67099
67105
|
if (!assumeTrue) {
|
|
67100
|
-
|
|
67101
|
-
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
67102
|
-
}
|
|
67103
|
-
const trueType2 = getNarrowedType(
|
|
67104
|
-
type,
|
|
67105
|
-
candidate,
|
|
67106
|
-
/*assumeTrue*/
|
|
67107
|
-
true,
|
|
67108
|
-
/*checkDerived*/
|
|
67109
|
-
false
|
|
67110
|
-
);
|
|
67111
|
-
return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
|
|
67106
|
+
return filterType(type, (t) => !isRelated(t, candidate));
|
|
67112
67107
|
}
|
|
67113
67108
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
67114
67109
|
return candidate;
|
|
67115
67110
|
}
|
|
67116
|
-
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
67117
67111
|
const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
|
|
67118
67112
|
const narrowedType = mapType(candidate, (c) => {
|
|
67119
67113
|
const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
|
|
67120
67114
|
const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
|
|
67121
|
-
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t)
|
|
67115
|
+
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
|
|
67122
67116
|
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
|
|
67123
67117
|
});
|
|
67124
67118
|
return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
|
|
@@ -74874,7 +74868,7 @@ ${lanes.join("\n")}
|
|
|
74874
74868
|
return leftType;
|
|
74875
74869
|
} else {
|
|
74876
74870
|
checkAssignmentOperator(rightType);
|
|
74877
|
-
return rightType;
|
|
74871
|
+
return getRegularTypeOfObjectLiteral(rightType);
|
|
74878
74872
|
}
|
|
74879
74873
|
case 27 /* CommaToken */:
|
|
74880
74874
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) {
|
|
@@ -84593,7 +84587,6 @@ ${lanes.join("\n")}
|
|
|
84593
84587
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
84594
84588
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
84595
84589
|
SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity";
|
|
84596
|
-
SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature";
|
|
84597
84590
|
SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
|
|
84598
84591
|
return SignatureCheckMode3;
|
|
84599
84592
|
})(SignatureCheckMode || {});
|
|
@@ -103260,6 +103253,9 @@ ${lanes.join("\n")}
|
|
|
103260
103253
|
return visitEachChild(node, visitor, context);
|
|
103261
103254
|
}
|
|
103262
103255
|
function visitImportCallExpression(node) {
|
|
103256
|
+
if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) {
|
|
103257
|
+
return visitEachChild(node, visitor, context);
|
|
103258
|
+
}
|
|
103263
103259
|
const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions);
|
|
103264
103260
|
const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression);
|
|
103265
103261
|
const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -32571,7 +32571,6 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
|
32571
32571
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
32572
32572
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
32573
32573
|
SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity";
|
|
32574
|
-
SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature";
|
|
32575
32574
|
SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
|
|
32576
32575
|
return SignatureCheckMode3;
|
|
32577
32576
|
})(SignatureCheckMode || {});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.0.0-pr-
|
|
5
|
+
"version": "5.0.0-pr-52632-9",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|