typescript 5.3.2 → 5.3.3
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 +23 -25
- package/lib/tsserver.js +24 -26
- package/lib/typescript.d.ts +6 -3
- package/lib/typescript.js +24 -26
- package/lib/typingsInstaller.js +2 -2
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.3";
|
|
21
|
-
var version = "5.3.
|
|
21
|
+
var version = "5.3.3";
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3678,7 +3678,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3678
3678
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3679
3679
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3680
3680
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3681
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3681
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
3682
3682
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3683
3683
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3684
3684
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -15971,7 +15971,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
15971
15971
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
15972
15972
|
}
|
|
15973
15973
|
function getObjectFlags(type) {
|
|
15974
|
-
return type.flags &
|
|
15974
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
15975
15975
|
}
|
|
15976
15976
|
function isUMDExportSymbol(symbol) {
|
|
15977
15977
|
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
|
|
@@ -56944,7 +56944,7 @@ function createTypeChecker(host) {
|
|
|
56944
56944
|
}
|
|
56945
56945
|
}
|
|
56946
56946
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
56947
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
56947
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
56948
56948
|
if (templates.length) {
|
|
56949
56949
|
let i = types.length;
|
|
56950
56950
|
while (i > 0) {
|
|
@@ -57344,19 +57344,14 @@ function createTypeChecker(host) {
|
|
|
57344
57344
|
function getConstituentCountOfTypes(types) {
|
|
57345
57345
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
57346
57346
|
}
|
|
57347
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
57348
|
-
if (types.length !== 2) {
|
|
57349
|
-
return false;
|
|
57350
|
-
}
|
|
57351
|
-
const [t1, t2] = types;
|
|
57352
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
57353
|
-
}
|
|
57354
57347
|
function getTypeFromIntersectionTypeNode(node) {
|
|
57355
57348
|
const links = getNodeLinks(node);
|
|
57356
57349
|
if (!links.resolvedType) {
|
|
57357
57350
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
57358
57351
|
const types = map(node.types, getTypeFromTypeNode);
|
|
57359
|
-
const
|
|
57352
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
57353
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
57354
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
57360
57355
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
57361
57356
|
}
|
|
57362
57357
|
return links.resolvedType;
|
|
@@ -57568,11 +57563,6 @@ function createTypeChecker(host) {
|
|
|
57568
57563
|
}
|
|
57569
57564
|
function createTemplateLiteralType(texts, types) {
|
|
57570
57565
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
57571
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
57572
|
-
types,
|
|
57573
|
-
/*excludeKinds*/
|
|
57574
|
-
98304 /* Nullable */
|
|
57575
|
-
);
|
|
57576
57566
|
type.texts = texts;
|
|
57577
57567
|
type.types = types;
|
|
57578
57568
|
return type;
|
|
@@ -57867,7 +57857,15 @@ function createTypeChecker(host) {
|
|
|
57867
57857
|
}
|
|
57868
57858
|
function isPatternLiteralPlaceholderType(type) {
|
|
57869
57859
|
if (type.flags & 2097152 /* Intersection */) {
|
|
57870
|
-
|
|
57860
|
+
let seenPlaceholder = false;
|
|
57861
|
+
for (const t of type.types) {
|
|
57862
|
+
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
57863
|
+
seenPlaceholder = true;
|
|
57864
|
+
} else if (!(t.flags & 524288 /* Object */)) {
|
|
57865
|
+
return false;
|
|
57866
|
+
}
|
|
57867
|
+
}
|
|
57868
|
+
return seenPlaceholder;
|
|
57871
57869
|
}
|
|
57872
57870
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
57873
57871
|
}
|
|
@@ -57884,7 +57882,7 @@ function createTypeChecker(host) {
|
|
|
57884
57882
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
57885
57883
|
}
|
|
57886
57884
|
function getGenericObjectFlags(type) {
|
|
57887
|
-
if (type.flags &
|
|
57885
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57888
57886
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
57889
57887
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
57890
57888
|
}
|
|
@@ -57896,7 +57894,7 @@ function createTypeChecker(host) {
|
|
|
57896
57894
|
}
|
|
57897
57895
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
57898
57896
|
}
|
|
57899
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57897
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57900
57898
|
}
|
|
57901
57899
|
function getSimplifiedType(type, writing) {
|
|
57902
57900
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -58922,7 +58920,7 @@ function createTypeChecker(host) {
|
|
|
58922
58920
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
58923
58921
|
target.instantiations.set(id, result);
|
|
58924
58922
|
const resultObjectFlags = getObjectFlags(result);
|
|
58925
|
-
if (result.flags &
|
|
58923
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58926
58924
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
58927
58925
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58928
58926
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -63636,8 +63634,8 @@ function createTypeChecker(host) {
|
|
|
63636
63634
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
63637
63635
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
63638
63636
|
}
|
|
63639
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
63640
|
-
if (type.flags &
|
|
63637
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
63638
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
63641
63639
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
63642
63640
|
}
|
|
63643
63641
|
return result;
|
|
@@ -66155,10 +66153,10 @@ function createTypeChecker(host) {
|
|
|
66155
66153
|
if (isMatchingConstructorReference(right)) {
|
|
66156
66154
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
66157
66155
|
}
|
|
66158
|
-
if (isBooleanLiteral(right)) {
|
|
66156
|
+
if (isBooleanLiteral(right) && !isAccessExpression(left)) {
|
|
66159
66157
|
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
66160
66158
|
}
|
|
66161
|
-
if (isBooleanLiteral(left)) {
|
|
66159
|
+
if (isBooleanLiteral(left) && !isAccessExpression(right)) {
|
|
66162
66160
|
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
66163
66161
|
}
|
|
66164
66162
|
break;
|
package/lib/tsserver.js
CHANGED
|
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2328
|
|
|
2329
2329
|
// src/compiler/corePublic.ts
|
|
2330
2330
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = "5.3.
|
|
2331
|
+
var version = "5.3.3";
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6670,7 +6670,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
6670
6670
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
6671
6671
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
6672
6672
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
6673
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
6673
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
6674
6674
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
6675
6675
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
6676
6676
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -20036,7 +20036,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
20036
20036
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
20037
20037
|
}
|
|
20038
20038
|
function getObjectFlags(type) {
|
|
20039
|
-
return type.flags &
|
|
20039
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
20040
20040
|
}
|
|
20041
20041
|
function forSomeAncestorDirectory(directory, callback) {
|
|
20042
20042
|
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
|
|
@@ -61648,7 +61648,7 @@ function createTypeChecker(host) {
|
|
|
61648
61648
|
}
|
|
61649
61649
|
}
|
|
61650
61650
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
61651
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
61651
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
61652
61652
|
if (templates.length) {
|
|
61653
61653
|
let i = types.length;
|
|
61654
61654
|
while (i > 0) {
|
|
@@ -62048,19 +62048,14 @@ function createTypeChecker(host) {
|
|
|
62048
62048
|
function getConstituentCountOfTypes(types) {
|
|
62049
62049
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
62050
62050
|
}
|
|
62051
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
62052
|
-
if (types.length !== 2) {
|
|
62053
|
-
return false;
|
|
62054
|
-
}
|
|
62055
|
-
const [t1, t2] = types;
|
|
62056
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
62057
|
-
}
|
|
62058
62051
|
function getTypeFromIntersectionTypeNode(node) {
|
|
62059
62052
|
const links = getNodeLinks(node);
|
|
62060
62053
|
if (!links.resolvedType) {
|
|
62061
62054
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
62062
62055
|
const types = map(node.types, getTypeFromTypeNode);
|
|
62063
|
-
const
|
|
62056
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
62057
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
62058
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
62064
62059
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
62065
62060
|
}
|
|
62066
62061
|
return links.resolvedType;
|
|
@@ -62272,11 +62267,6 @@ function createTypeChecker(host) {
|
|
|
62272
62267
|
}
|
|
62273
62268
|
function createTemplateLiteralType(texts, types) {
|
|
62274
62269
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
62275
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
62276
|
-
types,
|
|
62277
|
-
/*excludeKinds*/
|
|
62278
|
-
98304 /* Nullable */
|
|
62279
|
-
);
|
|
62280
62270
|
type.texts = texts;
|
|
62281
62271
|
type.types = types;
|
|
62282
62272
|
return type;
|
|
@@ -62571,7 +62561,15 @@ function createTypeChecker(host) {
|
|
|
62571
62561
|
}
|
|
62572
62562
|
function isPatternLiteralPlaceholderType(type) {
|
|
62573
62563
|
if (type.flags & 2097152 /* Intersection */) {
|
|
62574
|
-
|
|
62564
|
+
let seenPlaceholder = false;
|
|
62565
|
+
for (const t of type.types) {
|
|
62566
|
+
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
62567
|
+
seenPlaceholder = true;
|
|
62568
|
+
} else if (!(t.flags & 524288 /* Object */)) {
|
|
62569
|
+
return false;
|
|
62570
|
+
}
|
|
62571
|
+
}
|
|
62572
|
+
return seenPlaceholder;
|
|
62575
62573
|
}
|
|
62576
62574
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
62577
62575
|
}
|
|
@@ -62588,7 +62586,7 @@ function createTypeChecker(host) {
|
|
|
62588
62586
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
62589
62587
|
}
|
|
62590
62588
|
function getGenericObjectFlags(type) {
|
|
62591
|
-
if (type.flags &
|
|
62589
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
62592
62590
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
62593
62591
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
62594
62592
|
}
|
|
@@ -62600,7 +62598,7 @@ function createTypeChecker(host) {
|
|
|
62600
62598
|
}
|
|
62601
62599
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
62602
62600
|
}
|
|
62603
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
62601
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
62604
62602
|
}
|
|
62605
62603
|
function getSimplifiedType(type, writing) {
|
|
62606
62604
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -63626,7 +63624,7 @@ function createTypeChecker(host) {
|
|
|
63626
63624
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
63627
63625
|
target.instantiations.set(id, result);
|
|
63628
63626
|
const resultObjectFlags = getObjectFlags(result);
|
|
63629
|
-
if (result.flags &
|
|
63627
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
63630
63628
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
63631
63629
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
63632
63630
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -68340,8 +68338,8 @@ function createTypeChecker(host) {
|
|
|
68340
68338
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
68341
68339
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
68342
68340
|
}
|
|
68343
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
68344
|
-
if (type.flags &
|
|
68341
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
68342
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
68345
68343
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
68346
68344
|
}
|
|
68347
68345
|
return result;
|
|
@@ -70859,10 +70857,10 @@ function createTypeChecker(host) {
|
|
|
70859
70857
|
if (isMatchingConstructorReference(right)) {
|
|
70860
70858
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
70861
70859
|
}
|
|
70862
|
-
if (isBooleanLiteral(right)) {
|
|
70860
|
+
if (isBooleanLiteral(right) && !isAccessExpression(left)) {
|
|
70863
70861
|
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
70864
70862
|
}
|
|
70865
|
-
if (isBooleanLiteral(left)) {
|
|
70863
|
+
if (isBooleanLiteral(left) && !isAccessExpression(right)) {
|
|
70866
70864
|
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
70867
70865
|
}
|
|
70868
70866
|
break;
|
|
@@ -137311,7 +137309,7 @@ function transpileModule(input, transpileOptions) {
|
|
|
137311
137309
|
options
|
|
137312
137310
|
),
|
|
137313
137311
|
setExternalModuleIndicator: getSetExternalModuleIndicator(options),
|
|
137314
|
-
jsDocParsingMode:
|
|
137312
|
+
jsDocParsingMode: transpileOptions.jsDocParsingMode ?? 0 /* ParseAll */
|
|
137315
137313
|
}
|
|
137316
137314
|
);
|
|
137317
137315
|
if (transpileOptions.moduleName) {
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6018,9 +6018,11 @@ declare namespace ts {
|
|
|
6018
6018
|
/** @deprecated */
|
|
6019
6019
|
type AssertionKey = ImportAttributeName;
|
|
6020
6020
|
/** @deprecated */
|
|
6021
|
-
|
|
6021
|
+
interface AssertEntry extends ImportAttribute {
|
|
6022
|
+
}
|
|
6022
6023
|
/** @deprecated */
|
|
6023
|
-
|
|
6024
|
+
interface AssertClause extends ImportAttributes {
|
|
6025
|
+
}
|
|
6024
6026
|
type ImportAttributeName = Identifier | StringLiteral;
|
|
6025
6027
|
interface ImportAttribute extends Node {
|
|
6026
6028
|
readonly kind: SyntaxKind.ImportAttribute;
|
|
@@ -10416,7 +10418,7 @@ declare namespace ts {
|
|
|
10416
10418
|
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
|
10417
10419
|
writeFile?(fileName: string, content: string): void;
|
|
10418
10420
|
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
|
10419
|
-
jsDocParsingMode?: JSDocParsingMode;
|
|
10421
|
+
jsDocParsingMode?: JSDocParsingMode | undefined;
|
|
10420
10422
|
}
|
|
10421
10423
|
type WithMetadata<T> = T & {
|
|
10422
10424
|
metadata?: unknown;
|
|
@@ -11612,6 +11614,7 @@ declare namespace ts {
|
|
|
11612
11614
|
moduleName?: string;
|
|
11613
11615
|
renamedDependencies?: MapLike<string>;
|
|
11614
11616
|
transformers?: CustomTransformers;
|
|
11617
|
+
jsDocParsingMode?: JSDocParsingMode;
|
|
11615
11618
|
}
|
|
11616
11619
|
interface TranspileOutput {
|
|
11617
11620
|
outputText: string;
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.3";
|
|
38
|
-
version = "5.3.
|
|
38
|
+
version = "5.3.3";
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4435,7 +4435,7 @@ ${lanes.join("\n")}
|
|
|
4435
4435
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
4436
4436
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
4437
4437
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
4438
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
4438
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
4439
4439
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
4440
4440
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
4441
4441
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -17337,7 +17337,7 @@ ${lanes.join("\n")}
|
|
|
17337
17337
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
17338
17338
|
}
|
|
17339
17339
|
function getObjectFlags(type) {
|
|
17340
|
-
return type.flags &
|
|
17340
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
17341
17341
|
}
|
|
17342
17342
|
function forSomeAncestorDirectory(directory, callback) {
|
|
17343
17343
|
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
|
|
@@ -59415,7 +59415,7 @@ ${lanes.join("\n")}
|
|
|
59415
59415
|
}
|
|
59416
59416
|
}
|
|
59417
59417
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59418
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
59418
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
59419
59419
|
if (templates.length) {
|
|
59420
59420
|
let i = types.length;
|
|
59421
59421
|
while (i > 0) {
|
|
@@ -59815,19 +59815,14 @@ ${lanes.join("\n")}
|
|
|
59815
59815
|
function getConstituentCountOfTypes(types) {
|
|
59816
59816
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
59817
59817
|
}
|
|
59818
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
59819
|
-
if (types.length !== 2) {
|
|
59820
|
-
return false;
|
|
59821
|
-
}
|
|
59822
|
-
const [t1, t2] = types;
|
|
59823
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
59824
|
-
}
|
|
59825
59818
|
function getTypeFromIntersectionTypeNode(node) {
|
|
59826
59819
|
const links = getNodeLinks(node);
|
|
59827
59820
|
if (!links.resolvedType) {
|
|
59828
59821
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
59829
59822
|
const types = map(node.types, getTypeFromTypeNode);
|
|
59830
|
-
const
|
|
59823
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
59824
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
59825
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
59831
59826
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
59832
59827
|
}
|
|
59833
59828
|
return links.resolvedType;
|
|
@@ -60039,11 +60034,6 @@ ${lanes.join("\n")}
|
|
|
60039
60034
|
}
|
|
60040
60035
|
function createTemplateLiteralType(texts, types) {
|
|
60041
60036
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
60042
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
60043
|
-
types,
|
|
60044
|
-
/*excludeKinds*/
|
|
60045
|
-
98304 /* Nullable */
|
|
60046
|
-
);
|
|
60047
60037
|
type.texts = texts;
|
|
60048
60038
|
type.types = types;
|
|
60049
60039
|
return type;
|
|
@@ -60338,7 +60328,15 @@ ${lanes.join("\n")}
|
|
|
60338
60328
|
}
|
|
60339
60329
|
function isPatternLiteralPlaceholderType(type) {
|
|
60340
60330
|
if (type.flags & 2097152 /* Intersection */) {
|
|
60341
|
-
|
|
60331
|
+
let seenPlaceholder = false;
|
|
60332
|
+
for (const t of type.types) {
|
|
60333
|
+
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
60334
|
+
seenPlaceholder = true;
|
|
60335
|
+
} else if (!(t.flags & 524288 /* Object */)) {
|
|
60336
|
+
return false;
|
|
60337
|
+
}
|
|
60338
|
+
}
|
|
60339
|
+
return seenPlaceholder;
|
|
60342
60340
|
}
|
|
60343
60341
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
60344
60342
|
}
|
|
@@ -60355,7 +60353,7 @@ ${lanes.join("\n")}
|
|
|
60355
60353
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
60356
60354
|
}
|
|
60357
60355
|
function getGenericObjectFlags(type) {
|
|
60358
|
-
if (type.flags &
|
|
60356
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
60359
60357
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
60360
60358
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
60361
60359
|
}
|
|
@@ -60367,7 +60365,7 @@ ${lanes.join("\n")}
|
|
|
60367
60365
|
}
|
|
60368
60366
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
60369
60367
|
}
|
|
60370
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60368
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60371
60369
|
}
|
|
60372
60370
|
function getSimplifiedType(type, writing) {
|
|
60373
60371
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -61393,7 +61391,7 @@ ${lanes.join("\n")}
|
|
|
61393
61391
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
61394
61392
|
target.instantiations.set(id, result);
|
|
61395
61393
|
const resultObjectFlags = getObjectFlags(result);
|
|
61396
|
-
if (result.flags &
|
|
61394
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61397
61395
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
61398
61396
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61399
61397
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -66107,8 +66105,8 @@ ${lanes.join("\n")}
|
|
|
66107
66105
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
66108
66106
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
66109
66107
|
}
|
|
66110
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
66111
|
-
if (type.flags &
|
|
66108
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
66109
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66112
66110
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
66113
66111
|
}
|
|
66114
66112
|
return result;
|
|
@@ -68626,10 +68624,10 @@ ${lanes.join("\n")}
|
|
|
68626
68624
|
if (isMatchingConstructorReference(right)) {
|
|
68627
68625
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
68628
68626
|
}
|
|
68629
|
-
if (isBooleanLiteral(right)) {
|
|
68627
|
+
if (isBooleanLiteral(right) && !isAccessExpression(left)) {
|
|
68630
68628
|
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
68631
68629
|
}
|
|
68632
|
-
if (isBooleanLiteral(left)) {
|
|
68630
|
+
if (isBooleanLiteral(left) && !isAccessExpression(right)) {
|
|
68633
68631
|
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
68634
68632
|
}
|
|
68635
68633
|
break;
|
|
@@ -135680,7 +135678,7 @@ ${lanes.join("\n")}
|
|
|
135680
135678
|
options
|
|
135681
135679
|
),
|
|
135682
135680
|
setExternalModuleIndicator: getSetExternalModuleIndicator(options),
|
|
135683
|
-
jsDocParsingMode:
|
|
135681
|
+
jsDocParsingMode: transpileOptions.jsDocParsingMode ?? 0 /* ParseAll */
|
|
135684
135682
|
}
|
|
135685
135683
|
);
|
|
135686
135684
|
if (transpileOptions.moduleName) {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.3";
|
|
57
|
-
var version = "5.3.
|
|
57
|
+
var version = "5.3.3";
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3112,7 +3112,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3112
3112
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3113
3113
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3114
3114
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3115
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3115
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
3116
3116
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3117
3117
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3118
3118
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.3.
|
|
5
|
+
"version": "5.3.3",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|