typescript 5.7.2 → 5.7.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 +35 -22
- package/lib/typescript.js +35 -22
- package/package.json +2 -2
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.7";
|
21
|
-
var version = "5.7.
|
21
|
+
var version = "5.7.3";
|
22
22
|
|
23
23
|
// src/compiler/core.ts
|
24
24
|
var emptyArray = [];
|
@@ -11143,6 +11143,7 @@ function sortAndDeduplicateDiagnostics(diagnostics) {
|
|
11143
11143
|
}
|
11144
11144
|
var targetToLibMap = /* @__PURE__ */ new Map([
|
11145
11145
|
[99 /* ESNext */, "lib.esnext.full.d.ts"],
|
11146
|
+
[11 /* ES2024 */, "lib.es2024.full.d.ts"],
|
11146
11147
|
[10 /* ES2023 */, "lib.es2023.full.d.ts"],
|
11147
11148
|
[9 /* ES2022 */, "lib.es2022.full.d.ts"],
|
11148
11149
|
[8 /* ES2021 */, "lib.es2021.full.d.ts"],
|
@@ -11158,6 +11159,7 @@ function getDefaultLibFileName(options) {
|
|
11158
11159
|
const target = getEmitScriptTarget(options);
|
11159
11160
|
switch (target) {
|
11160
11161
|
case 99 /* ESNext */:
|
11162
|
+
case 11 /* ES2024 */:
|
11161
11163
|
case 10 /* ES2023 */:
|
11162
11164
|
case 9 /* ES2022 */:
|
11163
11165
|
case 8 /* ES2021 */:
|
@@ -46776,6 +46778,12 @@ function createTypeChecker(host) {
|
|
46776
46778
|
/*isReadonly*/
|
46777
46779
|
true
|
46778
46780
|
);
|
46781
|
+
var anyBaseTypeIndexInfo = createIndexInfo(
|
46782
|
+
stringType,
|
46783
|
+
anyType,
|
46784
|
+
/*isReadonly*/
|
46785
|
+
false
|
46786
|
+
);
|
46779
46787
|
var iterationTypesCache = /* @__PURE__ */ new Map();
|
46780
46788
|
var noIterationTypes = {
|
46781
46789
|
get yieldType() {
|
@@ -50319,7 +50327,7 @@ function createTypeChecker(host) {
|
|
50319
50327
|
return true;
|
50320
50328
|
}
|
50321
50329
|
if (requiresAddingUndefined && annotationType) {
|
50322
|
-
annotationType =
|
50330
|
+
annotationType = addOptionality(annotationType, !isParameter(node));
|
50323
50331
|
}
|
50324
50332
|
return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type);
|
50325
50333
|
}
|
@@ -56577,12 +56585,7 @@ function createTypeChecker(host) {
|
|
56577
56585
|
addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
|
56578
56586
|
callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));
|
56579
56587
|
constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));
|
56580
|
-
const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [
|
56581
|
-
stringType,
|
56582
|
-
anyType,
|
56583
|
-
/*isReadonly*/
|
56584
|
-
false
|
56585
|
-
)];
|
56588
|
+
const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo];
|
56586
56589
|
indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, (info) => !findIndexInfo(indexInfos, info.keyType)));
|
56587
56590
|
}
|
56588
56591
|
}
|
@@ -57108,12 +57111,7 @@ function createTypeChecker(host) {
|
|
57108
57111
|
members = createSymbolTable(getNamedOrIndexSignatureMembers(members));
|
57109
57112
|
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
|
57110
57113
|
} else if (baseConstructorType === anyType) {
|
57111
|
-
baseConstructorIndexInfo =
|
57112
|
-
stringType,
|
57113
|
-
anyType,
|
57114
|
-
/*isReadonly*/
|
57115
|
-
false
|
57116
|
-
);
|
57114
|
+
baseConstructorIndexInfo = anyBaseTypeIndexInfo;
|
57117
57115
|
}
|
57118
57116
|
}
|
57119
57117
|
const indexSymbol = getIndexSymbolFromSymbolTable(members);
|
@@ -70460,12 +70458,13 @@ function createTypeChecker(host) {
|
|
70460
70458
|
const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found : void 0;
|
70461
70459
|
const jsxFactoryNamespace = getJsxNamespace(node);
|
70462
70460
|
const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node;
|
70461
|
+
const shouldFactoryRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
|
70463
70462
|
let jsxFactorySym;
|
70464
70463
|
if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
|
70465
70464
|
jsxFactorySym = resolveName(
|
70466
70465
|
jsxFactoryLocation,
|
70467
70466
|
jsxFactoryNamespace,
|
70468
|
-
|
70467
|
+
shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
|
70469
70468
|
jsxFactoryRefErr,
|
70470
70469
|
/*isUse*/
|
70471
70470
|
true
|
@@ -70484,7 +70483,7 @@ function createTypeChecker(host) {
|
|
70484
70483
|
resolveName(
|
70485
70484
|
jsxFactoryLocation,
|
70486
70485
|
localJsxNamespace,
|
70487
|
-
|
70486
|
+
shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
|
70488
70487
|
jsxFactoryRefErr,
|
70489
70488
|
/*isUse*/
|
70490
70489
|
true
|
@@ -74045,6 +74044,13 @@ function createTypeChecker(host) {
|
|
74045
74044
|
return getIntersectionType(x);
|
74046
74045
|
}
|
74047
74046
|
function reportNonexistentProperty(propNode, containingType, isUncheckedJS) {
|
74047
|
+
const links = getNodeLinks(propNode);
|
74048
|
+
const cache = links.nonExistentPropCheckCache || (links.nonExistentPropCheckCache = /* @__PURE__ */ new Set());
|
74049
|
+
const key = `${getTypeId(containingType)}|${isUncheckedJS}`;
|
74050
|
+
if (cache.has(key)) {
|
74051
|
+
return;
|
74052
|
+
}
|
74053
|
+
cache.add(key);
|
74048
74054
|
let errorInfo;
|
74049
74055
|
let relatedInfo;
|
74050
74056
|
if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 402784252 /* Primitive */)) {
|
@@ -76003,12 +76009,14 @@ function createTypeChecker(host) {
|
|
76003
76009
|
const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node));
|
76004
76010
|
if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType;
|
76005
76011
|
const jsxFragmentFactoryName = getJsxNamespace(node);
|
76006
|
-
|
76012
|
+
const shouldResolveFactoryReference = (compilerOptions.jsx === 2 /* React */ || compilerOptions.jsxFragmentFactory !== void 0) && jsxFragmentFactoryName !== "null";
|
76013
|
+
if (!shouldResolveFactoryReference) return sourceFileLinks.jsxFragmentType = anyType;
|
76014
|
+
const shouldModuleRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
|
76007
76015
|
const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0;
|
76008
76016
|
const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName(
|
76009
76017
|
node,
|
76010
76018
|
jsxFragmentFactoryName,
|
76011
|
-
|
76019
|
+
shouldModuleRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
|
76012
76020
|
/*nameNotFoundMessage*/
|
76013
76021
|
jsxFactoryRefErr,
|
76014
76022
|
/*isUse*/
|
@@ -78574,7 +78582,9 @@ function createTypeChecker(host) {
|
|
78574
78582
|
switch (node.kind) {
|
78575
78583
|
case 223 /* AwaitExpression */:
|
78576
78584
|
case 213 /* CallExpression */:
|
78585
|
+
case 215 /* TaggedTemplateExpression */:
|
78577
78586
|
case 212 /* ElementAccessExpression */:
|
78587
|
+
case 236 /* MetaProperty */:
|
78578
78588
|
case 214 /* NewExpression */:
|
78579
78589
|
case 211 /* PropertyAccessExpression */:
|
78580
78590
|
case 229 /* YieldExpression */:
|
@@ -78590,6 +78600,8 @@ function createTypeChecker(host) {
|
|
78590
78600
|
case 56 /* AmpersandAmpersandToken */:
|
78591
78601
|
case 77 /* AmpersandAmpersandEqualsToken */:
|
78592
78602
|
return 3 /* Sometimes */;
|
78603
|
+
case 28 /* CommaToken */:
|
78604
|
+
return getSyntacticNullishnessSemantics(node.right);
|
78593
78605
|
}
|
78594
78606
|
return 2 /* Never */;
|
78595
78607
|
case 227 /* ConditionalExpression */:
|
@@ -84702,7 +84714,7 @@ function createTypeChecker(host) {
|
|
84702
84714
|
}
|
84703
84715
|
}
|
84704
84716
|
}
|
84705
|
-
if (isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
|
84717
|
+
if (!importClause.isTypeOnly && moduleKind === 199 /* NodeNext */ && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
|
84706
84718
|
error(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
|
84707
84719
|
}
|
84708
84720
|
} else if (noUncheckedSideEffectImports && !importClause) {
|
@@ -86986,6 +86998,7 @@ function createTypeChecker(host) {
|
|
86986
86998
|
result || (result = []);
|
86987
86999
|
for (const info of infoList) {
|
86988
87000
|
if (info.declaration) continue;
|
87001
|
+
if (info === anyBaseTypeIndexInfo) continue;
|
86989
87002
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
86990
87003
|
if (node && infoList === staticInfos) {
|
86991
87004
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
|
@@ -131703,9 +131716,9 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
131703
131716
|
}
|
131704
131717
|
if (!result && node.kind === 303 /* PropertyAssignment */) {
|
131705
131718
|
const initializer = node.initializer;
|
131706
|
-
const
|
131707
|
-
if (
|
131708
|
-
result = serializeExistingTypeNode(
|
131719
|
+
const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
|
131720
|
+
if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) {
|
131721
|
+
result = serializeExistingTypeNode(assertionNode, context);
|
131709
131722
|
}
|
131710
131723
|
}
|
131711
131724
|
return result ?? inferTypeOfDeclaration(
|
package/lib/typescript.js
CHANGED
@@ -2278,7 +2278,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
2278
2278
|
|
2279
2279
|
// src/compiler/corePublic.ts
|
2280
2280
|
var versionMajorMinor = "5.7";
|
2281
|
-
var version = "5.7.
|
2281
|
+
var version = "5.7.3";
|
2282
2282
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
2283
2283
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
2284
2284
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
@@ -14547,6 +14547,7 @@ function sortAndDeduplicateDiagnostics(diagnostics) {
|
|
14547
14547
|
}
|
14548
14548
|
var targetToLibMap = /* @__PURE__ */ new Map([
|
14549
14549
|
[99 /* ESNext */, "lib.esnext.full.d.ts"],
|
14550
|
+
[11 /* ES2024 */, "lib.es2024.full.d.ts"],
|
14550
14551
|
[10 /* ES2023 */, "lib.es2023.full.d.ts"],
|
14551
14552
|
[9 /* ES2022 */, "lib.es2022.full.d.ts"],
|
14552
14553
|
[8 /* ES2021 */, "lib.es2021.full.d.ts"],
|
@@ -14562,6 +14563,7 @@ function getDefaultLibFileName(options) {
|
|
14562
14563
|
const target = getEmitScriptTarget(options);
|
14563
14564
|
switch (target) {
|
14564
14565
|
case 99 /* ESNext */:
|
14566
|
+
case 11 /* ES2024 */:
|
14565
14567
|
case 10 /* ES2023 */:
|
14566
14568
|
case 9 /* ES2022 */:
|
14567
14569
|
case 8 /* ES2021 */:
|
@@ -51379,6 +51381,12 @@ function createTypeChecker(host) {
|
|
51379
51381
|
/*isReadonly*/
|
51380
51382
|
true
|
51381
51383
|
);
|
51384
|
+
var anyBaseTypeIndexInfo = createIndexInfo(
|
51385
|
+
stringType,
|
51386
|
+
anyType,
|
51387
|
+
/*isReadonly*/
|
51388
|
+
false
|
51389
|
+
);
|
51382
51390
|
var iterationTypesCache = /* @__PURE__ */ new Map();
|
51383
51391
|
var noIterationTypes = {
|
51384
51392
|
get yieldType() {
|
@@ -54922,7 +54930,7 @@ function createTypeChecker(host) {
|
|
54922
54930
|
return true;
|
54923
54931
|
}
|
54924
54932
|
if (requiresAddingUndefined && annotationType) {
|
54925
|
-
annotationType =
|
54933
|
+
annotationType = addOptionality(annotationType, !isParameter(node));
|
54926
54934
|
}
|
54927
54935
|
return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type);
|
54928
54936
|
}
|
@@ -61180,12 +61188,7 @@ function createTypeChecker(host) {
|
|
61180
61188
|
addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
|
61181
61189
|
callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));
|
61182
61190
|
constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));
|
61183
|
-
const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [
|
61184
|
-
stringType,
|
61185
|
-
anyType,
|
61186
|
-
/*isReadonly*/
|
61187
|
-
false
|
61188
|
-
)];
|
61191
|
+
const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo];
|
61189
61192
|
indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, (info) => !findIndexInfo(indexInfos, info.keyType)));
|
61190
61193
|
}
|
61191
61194
|
}
|
@@ -61711,12 +61714,7 @@ function createTypeChecker(host) {
|
|
61711
61714
|
members = createSymbolTable(getNamedOrIndexSignatureMembers(members));
|
61712
61715
|
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
|
61713
61716
|
} else if (baseConstructorType === anyType) {
|
61714
|
-
baseConstructorIndexInfo =
|
61715
|
-
stringType,
|
61716
|
-
anyType,
|
61717
|
-
/*isReadonly*/
|
61718
|
-
false
|
61719
|
-
);
|
61717
|
+
baseConstructorIndexInfo = anyBaseTypeIndexInfo;
|
61720
61718
|
}
|
61721
61719
|
}
|
61722
61720
|
const indexSymbol = getIndexSymbolFromSymbolTable(members);
|
@@ -75063,12 +75061,13 @@ function createTypeChecker(host) {
|
|
75063
75061
|
const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found : void 0;
|
75064
75062
|
const jsxFactoryNamespace = getJsxNamespace(node);
|
75065
75063
|
const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node;
|
75064
|
+
const shouldFactoryRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
|
75066
75065
|
let jsxFactorySym;
|
75067
75066
|
if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
|
75068
75067
|
jsxFactorySym = resolveName(
|
75069
75068
|
jsxFactoryLocation,
|
75070
75069
|
jsxFactoryNamespace,
|
75071
|
-
|
75070
|
+
shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
|
75072
75071
|
jsxFactoryRefErr,
|
75073
75072
|
/*isUse*/
|
75074
75073
|
true
|
@@ -75087,7 +75086,7 @@ function createTypeChecker(host) {
|
|
75087
75086
|
resolveName(
|
75088
75087
|
jsxFactoryLocation,
|
75089
75088
|
localJsxNamespace,
|
75090
|
-
|
75089
|
+
shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
|
75091
75090
|
jsxFactoryRefErr,
|
75092
75091
|
/*isUse*/
|
75093
75092
|
true
|
@@ -78648,6 +78647,13 @@ function createTypeChecker(host) {
|
|
78648
78647
|
return getIntersectionType(x);
|
78649
78648
|
}
|
78650
78649
|
function reportNonexistentProperty(propNode, containingType, isUncheckedJS) {
|
78650
|
+
const links = getNodeLinks(propNode);
|
78651
|
+
const cache = links.nonExistentPropCheckCache || (links.nonExistentPropCheckCache = /* @__PURE__ */ new Set());
|
78652
|
+
const key = `${getTypeId(containingType)}|${isUncheckedJS}`;
|
78653
|
+
if (cache.has(key)) {
|
78654
|
+
return;
|
78655
|
+
}
|
78656
|
+
cache.add(key);
|
78651
78657
|
let errorInfo;
|
78652
78658
|
let relatedInfo;
|
78653
78659
|
if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 402784252 /* Primitive */)) {
|
@@ -80606,12 +80612,14 @@ function createTypeChecker(host) {
|
|
80606
80612
|
const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node));
|
80607
80613
|
if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType;
|
80608
80614
|
const jsxFragmentFactoryName = getJsxNamespace(node);
|
80609
|
-
|
80615
|
+
const shouldResolveFactoryReference = (compilerOptions.jsx === 2 /* React */ || compilerOptions.jsxFragmentFactory !== void 0) && jsxFragmentFactoryName !== "null";
|
80616
|
+
if (!shouldResolveFactoryReference) return sourceFileLinks.jsxFragmentType = anyType;
|
80617
|
+
const shouldModuleRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
|
80610
80618
|
const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0;
|
80611
80619
|
const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName(
|
80612
80620
|
node,
|
80613
80621
|
jsxFragmentFactoryName,
|
80614
|
-
|
80622
|
+
shouldModuleRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
|
80615
80623
|
/*nameNotFoundMessage*/
|
80616
80624
|
jsxFactoryRefErr,
|
80617
80625
|
/*isUse*/
|
@@ -83177,7 +83185,9 @@ function createTypeChecker(host) {
|
|
83177
83185
|
switch (node.kind) {
|
83178
83186
|
case 223 /* AwaitExpression */:
|
83179
83187
|
case 213 /* CallExpression */:
|
83188
|
+
case 215 /* TaggedTemplateExpression */:
|
83180
83189
|
case 212 /* ElementAccessExpression */:
|
83190
|
+
case 236 /* MetaProperty */:
|
83181
83191
|
case 214 /* NewExpression */:
|
83182
83192
|
case 211 /* PropertyAccessExpression */:
|
83183
83193
|
case 229 /* YieldExpression */:
|
@@ -83193,6 +83203,8 @@ function createTypeChecker(host) {
|
|
83193
83203
|
case 56 /* AmpersandAmpersandToken */:
|
83194
83204
|
case 77 /* AmpersandAmpersandEqualsToken */:
|
83195
83205
|
return 3 /* Sometimes */;
|
83206
|
+
case 28 /* CommaToken */:
|
83207
|
+
return getSyntacticNullishnessSemantics(node.right);
|
83196
83208
|
}
|
83197
83209
|
return 2 /* Never */;
|
83198
83210
|
case 227 /* ConditionalExpression */:
|
@@ -89305,7 +89317,7 @@ function createTypeChecker(host) {
|
|
89305
89317
|
}
|
89306
89318
|
}
|
89307
89319
|
}
|
89308
|
-
if (isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
|
89320
|
+
if (!importClause.isTypeOnly && moduleKind === 199 /* NodeNext */ && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
|
89309
89321
|
error2(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
|
89310
89322
|
}
|
89311
89323
|
} else if (noUncheckedSideEffectImports && !importClause) {
|
@@ -91589,6 +91601,7 @@ function createTypeChecker(host) {
|
|
91589
91601
|
result || (result = []);
|
91590
91602
|
for (const info of infoList) {
|
91591
91603
|
if (info.declaration) continue;
|
91604
|
+
if (info === anyBaseTypeIndexInfo) continue;
|
91592
91605
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
91593
91606
|
if (node && infoList === staticInfos) {
|
91594
91607
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
|
@@ -136663,9 +136676,9 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
136663
136676
|
}
|
136664
136677
|
if (!result && node.kind === 303 /* PropertyAssignment */) {
|
136665
136678
|
const initializer = node.initializer;
|
136666
|
-
const
|
136667
|
-
if (
|
136668
|
-
result = serializeExistingTypeNode(
|
136679
|
+
const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
|
136680
|
+
if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) {
|
136681
|
+
result = serializeExistingTypeNode(assertionNode, context);
|
136669
136682
|
}
|
136670
136683
|
}
|
136671
136684
|
return result ?? inferTypeOfDeclaration(
|
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.7.
|
5
|
+
"version": "5.7.3",
|
6
6
|
"license": "Apache-2.0",
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
8
8
|
"keywords": [
|
@@ -116,5 +116,5 @@
|
|
116
116
|
"node": "20.1.0",
|
117
117
|
"npm": "8.19.4"
|
118
118
|
},
|
119
|
-
"gitHead": "
|
119
|
+
"gitHead": "a5e123d9e0690fcea92878ea8a0a382922009fc9"
|
120
120
|
}
|