@typescript-deploys/pr-build 5.2.0-pr-54753-32 → 5.2.0-pr-52095-19
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 +65 -55
- package/lib/tsserver.js +65 -55
- package/lib/tsserverlibrary.js +65 -55
- package/lib/typescript.js +65 -55
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -53914,12 +53914,7 @@ function createTypeChecker(host) {
|
|
|
53914
53914
|
for (const current of type.types) {
|
|
53915
53915
|
for (const prop of getPropertiesOfType(current)) {
|
|
53916
53916
|
if (!members.has(prop.escapedName)) {
|
|
53917
|
-
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
53918
|
-
type,
|
|
53919
|
-
prop.escapedName,
|
|
53920
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
53921
|
-
!!(type.flags & 2097152 /* Intersection */)
|
|
53922
|
-
);
|
|
53917
|
+
const combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName);
|
|
53923
53918
|
if (combinedProp) {
|
|
53924
53919
|
members.set(prop.escapedName, combinedProp);
|
|
53925
53920
|
}
|
|
@@ -54399,17 +54394,13 @@ function createTypeChecker(host) {
|
|
|
54399
54394
|
return result;
|
|
54400
54395
|
}
|
|
54401
54396
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
54402
|
-
var _a, _b
|
|
54397
|
+
var _a, _b;
|
|
54403
54398
|
let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0;
|
|
54404
54399
|
if (!property) {
|
|
54405
54400
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
54406
54401
|
if (property) {
|
|
54407
54402
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
54408
54403
|
properties.set(name, property);
|
|
54409
|
-
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
54410
|
-
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
54411
|
-
properties2.set(name, property);
|
|
54412
|
-
}
|
|
54413
54404
|
}
|
|
54414
54405
|
}
|
|
54415
54406
|
return property;
|
|
@@ -54529,22 +54520,7 @@ function createTypeChecker(host) {
|
|
|
54529
54520
|
}
|
|
54530
54521
|
return getPropertyOfObjectType(globalObjectType, name);
|
|
54531
54522
|
}
|
|
54532
|
-
if (type.flags &
|
|
54533
|
-
const prop = getPropertyOfUnionOrIntersectionType(
|
|
54534
|
-
type,
|
|
54535
|
-
name,
|
|
54536
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
54537
|
-
true
|
|
54538
|
-
);
|
|
54539
|
-
if (prop) {
|
|
54540
|
-
return prop;
|
|
54541
|
-
}
|
|
54542
|
-
if (!skipObjectFunctionPropertyAugment) {
|
|
54543
|
-
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
54544
|
-
}
|
|
54545
|
-
return void 0;
|
|
54546
|
-
}
|
|
54547
|
-
if (type.flags & 1048576 /* Union */) {
|
|
54523
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
54548
54524
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
54549
54525
|
}
|
|
54550
54526
|
return void 0;
|
|
@@ -67277,41 +67253,75 @@ function createTypeChecker(host) {
|
|
|
67277
67253
|
return mapType(
|
|
67278
67254
|
type,
|
|
67279
67255
|
(t) => {
|
|
67280
|
-
|
|
67281
|
-
|
|
67282
|
-
|
|
67283
|
-
|
|
67284
|
-
const
|
|
67285
|
-
|
|
67286
|
-
|
|
67287
|
-
|
|
67288
|
-
|
|
67289
|
-
|
|
67290
|
-
|
|
67291
|
-
|
|
67292
|
-
}
|
|
67293
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
67294
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
67295
|
-
t,
|
|
67296
|
-
t.target.fixedLength,
|
|
67297
|
-
/*endSkipCount*/
|
|
67298
|
-
0,
|
|
67299
|
-
/*writing*/
|
|
67300
|
-
false,
|
|
67301
|
-
/*noReductions*/
|
|
67302
|
-
true
|
|
67303
|
-
);
|
|
67304
|
-
if (restType) {
|
|
67305
|
-
return restType;
|
|
67256
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
67257
|
+
return void 0;
|
|
67258
|
+
}
|
|
67259
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
67260
|
+
const intersection = t;
|
|
67261
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
67262
|
+
let concretePropertyTypes;
|
|
67263
|
+
let applicableIndexInfoCandidates;
|
|
67264
|
+
for (const t2 of intersection.types) {
|
|
67265
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
67266
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
67267
|
+
continue;
|
|
67306
67268
|
}
|
|
67269
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
67270
|
+
if (typeOfConcreteProperty) {
|
|
67271
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
67272
|
+
continue;
|
|
67273
|
+
}
|
|
67274
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
67275
|
+
}
|
|
67276
|
+
if (concretePropertyTypes) {
|
|
67277
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
67278
|
+
}
|
|
67279
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
67280
|
+
if (types.length > 0) {
|
|
67281
|
+
return getIntersectionType(types);
|
|
67307
67282
|
}
|
|
67308
|
-
return
|
|
67283
|
+
return void 0;
|
|
67309
67284
|
}
|
|
67310
|
-
return
|
|
67285
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
67311
67286
|
},
|
|
67312
67287
|
/*noReductions*/
|
|
67313
67288
|
true
|
|
67314
67289
|
);
|
|
67290
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
67291
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
67292
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
67293
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
67294
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
67295
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
67296
|
+
}
|
|
67297
|
+
return void 0;
|
|
67298
|
+
}
|
|
67299
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
67300
|
+
const prop = getPropertyOfType(t, name);
|
|
67301
|
+
if (prop) {
|
|
67302
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
67303
|
+
}
|
|
67304
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
67305
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
67306
|
+
t,
|
|
67307
|
+
t.target.fixedLength,
|
|
67308
|
+
/*endSkipCount*/
|
|
67309
|
+
0,
|
|
67310
|
+
/*writing*/
|
|
67311
|
+
false,
|
|
67312
|
+
/*noReductions*/
|
|
67313
|
+
true
|
|
67314
|
+
);
|
|
67315
|
+
if (restType) {
|
|
67316
|
+
return restType;
|
|
67317
|
+
}
|
|
67318
|
+
}
|
|
67319
|
+
return void 0;
|
|
67320
|
+
}
|
|
67321
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
67322
|
+
var _a;
|
|
67323
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
67324
|
+
}
|
|
67315
67325
|
}
|
|
67316
67326
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
67317
67327
|
Debug.assert(isObjectLiteralMethod(node));
|
package/lib/tsserver.js
CHANGED
|
@@ -58623,12 +58623,7 @@ function createTypeChecker(host) {
|
|
|
58623
58623
|
for (const current of type.types) {
|
|
58624
58624
|
for (const prop of getPropertiesOfType(current)) {
|
|
58625
58625
|
if (!members.has(prop.escapedName)) {
|
|
58626
|
-
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
58627
|
-
type,
|
|
58628
|
-
prop.escapedName,
|
|
58629
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
58630
|
-
!!(type.flags & 2097152 /* Intersection */)
|
|
58631
|
-
);
|
|
58626
|
+
const combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName);
|
|
58632
58627
|
if (combinedProp) {
|
|
58633
58628
|
members.set(prop.escapedName, combinedProp);
|
|
58634
58629
|
}
|
|
@@ -59108,17 +59103,13 @@ function createTypeChecker(host) {
|
|
|
59108
59103
|
return result;
|
|
59109
59104
|
}
|
|
59110
59105
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
59111
|
-
var _a, _b
|
|
59106
|
+
var _a, _b;
|
|
59112
59107
|
let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0;
|
|
59113
59108
|
if (!property) {
|
|
59114
59109
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
59115
59110
|
if (property) {
|
|
59116
59111
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
59117
59112
|
properties.set(name, property);
|
|
59118
|
-
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
59119
|
-
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
59120
|
-
properties2.set(name, property);
|
|
59121
|
-
}
|
|
59122
59113
|
}
|
|
59123
59114
|
}
|
|
59124
59115
|
return property;
|
|
@@ -59238,22 +59229,7 @@ function createTypeChecker(host) {
|
|
|
59238
59229
|
}
|
|
59239
59230
|
return getPropertyOfObjectType(globalObjectType, name);
|
|
59240
59231
|
}
|
|
59241
|
-
if (type.flags &
|
|
59242
|
-
const prop = getPropertyOfUnionOrIntersectionType(
|
|
59243
|
-
type,
|
|
59244
|
-
name,
|
|
59245
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
59246
|
-
true
|
|
59247
|
-
);
|
|
59248
|
-
if (prop) {
|
|
59249
|
-
return prop;
|
|
59250
|
-
}
|
|
59251
|
-
if (!skipObjectFunctionPropertyAugment) {
|
|
59252
|
-
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
59253
|
-
}
|
|
59254
|
-
return void 0;
|
|
59255
|
-
}
|
|
59256
|
-
if (type.flags & 1048576 /* Union */) {
|
|
59232
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
59257
59233
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
59258
59234
|
}
|
|
59259
59235
|
return void 0;
|
|
@@ -71986,41 +71962,75 @@ function createTypeChecker(host) {
|
|
|
71986
71962
|
return mapType(
|
|
71987
71963
|
type,
|
|
71988
71964
|
(t) => {
|
|
71989
|
-
|
|
71990
|
-
|
|
71991
|
-
|
|
71992
|
-
|
|
71993
|
-
const
|
|
71994
|
-
|
|
71995
|
-
|
|
71996
|
-
|
|
71997
|
-
|
|
71998
|
-
|
|
71999
|
-
|
|
72000
|
-
|
|
72001
|
-
}
|
|
72002
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
72003
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
72004
|
-
t,
|
|
72005
|
-
t.target.fixedLength,
|
|
72006
|
-
/*endSkipCount*/
|
|
72007
|
-
0,
|
|
72008
|
-
/*writing*/
|
|
72009
|
-
false,
|
|
72010
|
-
/*noReductions*/
|
|
72011
|
-
true
|
|
72012
|
-
);
|
|
72013
|
-
if (restType) {
|
|
72014
|
-
return restType;
|
|
71965
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
71966
|
+
return void 0;
|
|
71967
|
+
}
|
|
71968
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
71969
|
+
const intersection = t;
|
|
71970
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
71971
|
+
let concretePropertyTypes;
|
|
71972
|
+
let applicableIndexInfoCandidates;
|
|
71973
|
+
for (const t2 of intersection.types) {
|
|
71974
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
71975
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
71976
|
+
continue;
|
|
72015
71977
|
}
|
|
71978
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
71979
|
+
if (typeOfConcreteProperty) {
|
|
71980
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
71981
|
+
continue;
|
|
71982
|
+
}
|
|
71983
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
71984
|
+
}
|
|
71985
|
+
if (concretePropertyTypes) {
|
|
71986
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
71987
|
+
}
|
|
71988
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
71989
|
+
if (types.length > 0) {
|
|
71990
|
+
return getIntersectionType(types);
|
|
72016
71991
|
}
|
|
72017
|
-
return
|
|
71992
|
+
return void 0;
|
|
72018
71993
|
}
|
|
72019
|
-
return
|
|
71994
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
72020
71995
|
},
|
|
72021
71996
|
/*noReductions*/
|
|
72022
71997
|
true
|
|
72023
71998
|
);
|
|
71999
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
72000
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
72001
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
72002
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
72003
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
72004
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
72005
|
+
}
|
|
72006
|
+
return void 0;
|
|
72007
|
+
}
|
|
72008
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
72009
|
+
const prop = getPropertyOfType(t, name);
|
|
72010
|
+
if (prop) {
|
|
72011
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
72012
|
+
}
|
|
72013
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
72014
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
72015
|
+
t,
|
|
72016
|
+
t.target.fixedLength,
|
|
72017
|
+
/*endSkipCount*/
|
|
72018
|
+
0,
|
|
72019
|
+
/*writing*/
|
|
72020
|
+
false,
|
|
72021
|
+
/*noReductions*/
|
|
72022
|
+
true
|
|
72023
|
+
);
|
|
72024
|
+
if (restType) {
|
|
72025
|
+
return restType;
|
|
72026
|
+
}
|
|
72027
|
+
}
|
|
72028
|
+
return void 0;
|
|
72029
|
+
}
|
|
72030
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
72031
|
+
var _a;
|
|
72032
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
72033
|
+
}
|
|
72024
72034
|
}
|
|
72025
72035
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
72026
72036
|
Debug.assert(isObjectLiteralMethod(node));
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -56388,12 +56388,7 @@ ${lanes.join("\n")}
|
|
|
56388
56388
|
for (const current of type.types) {
|
|
56389
56389
|
for (const prop of getPropertiesOfType(current)) {
|
|
56390
56390
|
if (!members.has(prop.escapedName)) {
|
|
56391
|
-
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
56392
|
-
type,
|
|
56393
|
-
prop.escapedName,
|
|
56394
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
56395
|
-
!!(type.flags & 2097152 /* Intersection */)
|
|
56396
|
-
);
|
|
56391
|
+
const combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName);
|
|
56397
56392
|
if (combinedProp) {
|
|
56398
56393
|
members.set(prop.escapedName, combinedProp);
|
|
56399
56394
|
}
|
|
@@ -56873,17 +56868,13 @@ ${lanes.join("\n")}
|
|
|
56873
56868
|
return result;
|
|
56874
56869
|
}
|
|
56875
56870
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
56876
|
-
var _a, _b
|
|
56871
|
+
var _a, _b;
|
|
56877
56872
|
let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0;
|
|
56878
56873
|
if (!property) {
|
|
56879
56874
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
56880
56875
|
if (property) {
|
|
56881
56876
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
56882
56877
|
properties.set(name, property);
|
|
56883
|
-
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
56884
|
-
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
56885
|
-
properties2.set(name, property);
|
|
56886
|
-
}
|
|
56887
56878
|
}
|
|
56888
56879
|
}
|
|
56889
56880
|
return property;
|
|
@@ -57003,22 +56994,7 @@ ${lanes.join("\n")}
|
|
|
57003
56994
|
}
|
|
57004
56995
|
return getPropertyOfObjectType(globalObjectType, name);
|
|
57005
56996
|
}
|
|
57006
|
-
if (type.flags &
|
|
57007
|
-
const prop = getPropertyOfUnionOrIntersectionType(
|
|
57008
|
-
type,
|
|
57009
|
-
name,
|
|
57010
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
57011
|
-
true
|
|
57012
|
-
);
|
|
57013
|
-
if (prop) {
|
|
57014
|
-
return prop;
|
|
57015
|
-
}
|
|
57016
|
-
if (!skipObjectFunctionPropertyAugment) {
|
|
57017
|
-
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
57018
|
-
}
|
|
57019
|
-
return void 0;
|
|
57020
|
-
}
|
|
57021
|
-
if (type.flags & 1048576 /* Union */) {
|
|
56997
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57022
56998
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
57023
56999
|
}
|
|
57024
57000
|
return void 0;
|
|
@@ -69751,41 +69727,75 @@ ${lanes.join("\n")}
|
|
|
69751
69727
|
return mapType(
|
|
69752
69728
|
type,
|
|
69753
69729
|
(t) => {
|
|
69754
|
-
|
|
69755
|
-
|
|
69756
|
-
|
|
69757
|
-
|
|
69758
|
-
const
|
|
69759
|
-
|
|
69760
|
-
|
|
69761
|
-
|
|
69762
|
-
|
|
69763
|
-
|
|
69764
|
-
|
|
69765
|
-
|
|
69766
|
-
}
|
|
69767
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69768
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
69769
|
-
t,
|
|
69770
|
-
t.target.fixedLength,
|
|
69771
|
-
/*endSkipCount*/
|
|
69772
|
-
0,
|
|
69773
|
-
/*writing*/
|
|
69774
|
-
false,
|
|
69775
|
-
/*noReductions*/
|
|
69776
|
-
true
|
|
69777
|
-
);
|
|
69778
|
-
if (restType) {
|
|
69779
|
-
return restType;
|
|
69730
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
69731
|
+
return void 0;
|
|
69732
|
+
}
|
|
69733
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
69734
|
+
const intersection = t;
|
|
69735
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
69736
|
+
let concretePropertyTypes;
|
|
69737
|
+
let applicableIndexInfoCandidates;
|
|
69738
|
+
for (const t2 of intersection.types) {
|
|
69739
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
69740
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
69741
|
+
continue;
|
|
69780
69742
|
}
|
|
69743
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
69744
|
+
if (typeOfConcreteProperty) {
|
|
69745
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
69746
|
+
continue;
|
|
69747
|
+
}
|
|
69748
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
69749
|
+
}
|
|
69750
|
+
if (concretePropertyTypes) {
|
|
69751
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
69752
|
+
}
|
|
69753
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
69754
|
+
if (types.length > 0) {
|
|
69755
|
+
return getIntersectionType(types);
|
|
69781
69756
|
}
|
|
69782
|
-
return
|
|
69757
|
+
return void 0;
|
|
69783
69758
|
}
|
|
69784
|
-
return
|
|
69759
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
69785
69760
|
},
|
|
69786
69761
|
/*noReductions*/
|
|
69787
69762
|
true
|
|
69788
69763
|
);
|
|
69764
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
69765
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
69766
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
69767
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
69768
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
69769
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
69770
|
+
}
|
|
69771
|
+
return void 0;
|
|
69772
|
+
}
|
|
69773
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
69774
|
+
const prop = getPropertyOfType(t, name);
|
|
69775
|
+
if (prop) {
|
|
69776
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
69777
|
+
}
|
|
69778
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69779
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
69780
|
+
t,
|
|
69781
|
+
t.target.fixedLength,
|
|
69782
|
+
/*endSkipCount*/
|
|
69783
|
+
0,
|
|
69784
|
+
/*writing*/
|
|
69785
|
+
false,
|
|
69786
|
+
/*noReductions*/
|
|
69787
|
+
true
|
|
69788
|
+
);
|
|
69789
|
+
if (restType) {
|
|
69790
|
+
return restType;
|
|
69791
|
+
}
|
|
69792
|
+
}
|
|
69793
|
+
return void 0;
|
|
69794
|
+
}
|
|
69795
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
69796
|
+
var _a;
|
|
69797
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
69798
|
+
}
|
|
69789
69799
|
}
|
|
69790
69800
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
69791
69801
|
Debug.assert(isObjectLiteralMethod(node));
|
package/lib/typescript.js
CHANGED
|
@@ -56388,12 +56388,7 @@ ${lanes.join("\n")}
|
|
|
56388
56388
|
for (const current of type.types) {
|
|
56389
56389
|
for (const prop of getPropertiesOfType(current)) {
|
|
56390
56390
|
if (!members.has(prop.escapedName)) {
|
|
56391
|
-
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
56392
|
-
type,
|
|
56393
|
-
prop.escapedName,
|
|
56394
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
56395
|
-
!!(type.flags & 2097152 /* Intersection */)
|
|
56396
|
-
);
|
|
56391
|
+
const combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName);
|
|
56397
56392
|
if (combinedProp) {
|
|
56398
56393
|
members.set(prop.escapedName, combinedProp);
|
|
56399
56394
|
}
|
|
@@ -56873,17 +56868,13 @@ ${lanes.join("\n")}
|
|
|
56873
56868
|
return result;
|
|
56874
56869
|
}
|
|
56875
56870
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
56876
|
-
var _a, _b
|
|
56871
|
+
var _a, _b;
|
|
56877
56872
|
let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0;
|
|
56878
56873
|
if (!property) {
|
|
56879
56874
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
56880
56875
|
if (property) {
|
|
56881
56876
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
56882
56877
|
properties.set(name, property);
|
|
56883
|
-
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
56884
|
-
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
56885
|
-
properties2.set(name, property);
|
|
56886
|
-
}
|
|
56887
56878
|
}
|
|
56888
56879
|
}
|
|
56889
56880
|
return property;
|
|
@@ -57003,22 +56994,7 @@ ${lanes.join("\n")}
|
|
|
57003
56994
|
}
|
|
57004
56995
|
return getPropertyOfObjectType(globalObjectType, name);
|
|
57005
56996
|
}
|
|
57006
|
-
if (type.flags &
|
|
57007
|
-
const prop = getPropertyOfUnionOrIntersectionType(
|
|
57008
|
-
type,
|
|
57009
|
-
name,
|
|
57010
|
-
/*skipObjectFunctionPropertyAugment*/
|
|
57011
|
-
true
|
|
57012
|
-
);
|
|
57013
|
-
if (prop) {
|
|
57014
|
-
return prop;
|
|
57015
|
-
}
|
|
57016
|
-
if (!skipObjectFunctionPropertyAugment) {
|
|
57017
|
-
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
57018
|
-
}
|
|
57019
|
-
return void 0;
|
|
57020
|
-
}
|
|
57021
|
-
if (type.flags & 1048576 /* Union */) {
|
|
56997
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57022
56998
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
57023
56999
|
}
|
|
57024
57000
|
return void 0;
|
|
@@ -69751,41 +69727,75 @@ ${lanes.join("\n")}
|
|
|
69751
69727
|
return mapType(
|
|
69752
69728
|
type,
|
|
69753
69729
|
(t) => {
|
|
69754
|
-
|
|
69755
|
-
|
|
69756
|
-
|
|
69757
|
-
|
|
69758
|
-
const
|
|
69759
|
-
|
|
69760
|
-
|
|
69761
|
-
|
|
69762
|
-
|
|
69763
|
-
|
|
69764
|
-
|
|
69765
|
-
|
|
69766
|
-
}
|
|
69767
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69768
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
69769
|
-
t,
|
|
69770
|
-
t.target.fixedLength,
|
|
69771
|
-
/*endSkipCount*/
|
|
69772
|
-
0,
|
|
69773
|
-
/*writing*/
|
|
69774
|
-
false,
|
|
69775
|
-
/*noReductions*/
|
|
69776
|
-
true
|
|
69777
|
-
);
|
|
69778
|
-
if (restType) {
|
|
69779
|
-
return restType;
|
|
69730
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
69731
|
+
return void 0;
|
|
69732
|
+
}
|
|
69733
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
69734
|
+
const intersection = t;
|
|
69735
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
69736
|
+
let concretePropertyTypes;
|
|
69737
|
+
let applicableIndexInfoCandidates;
|
|
69738
|
+
for (const t2 of intersection.types) {
|
|
69739
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
69740
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
69741
|
+
continue;
|
|
69780
69742
|
}
|
|
69743
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
69744
|
+
if (typeOfConcreteProperty) {
|
|
69745
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
69746
|
+
continue;
|
|
69747
|
+
}
|
|
69748
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
69749
|
+
}
|
|
69750
|
+
if (concretePropertyTypes) {
|
|
69751
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
69752
|
+
}
|
|
69753
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
69754
|
+
if (types.length > 0) {
|
|
69755
|
+
return getIntersectionType(types);
|
|
69781
69756
|
}
|
|
69782
|
-
return
|
|
69757
|
+
return void 0;
|
|
69783
69758
|
}
|
|
69784
|
-
return
|
|
69759
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
69785
69760
|
},
|
|
69786
69761
|
/*noReductions*/
|
|
69787
69762
|
true
|
|
69788
69763
|
);
|
|
69764
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
69765
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
69766
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
69767
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
69768
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
69769
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
69770
|
+
}
|
|
69771
|
+
return void 0;
|
|
69772
|
+
}
|
|
69773
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
69774
|
+
const prop = getPropertyOfType(t, name);
|
|
69775
|
+
if (prop) {
|
|
69776
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
69777
|
+
}
|
|
69778
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69779
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
69780
|
+
t,
|
|
69781
|
+
t.target.fixedLength,
|
|
69782
|
+
/*endSkipCount*/
|
|
69783
|
+
0,
|
|
69784
|
+
/*writing*/
|
|
69785
|
+
false,
|
|
69786
|
+
/*noReductions*/
|
|
69787
|
+
true
|
|
69788
|
+
);
|
|
69789
|
+
if (restType) {
|
|
69790
|
+
return restType;
|
|
69791
|
+
}
|
|
69792
|
+
}
|
|
69793
|
+
return void 0;
|
|
69794
|
+
}
|
|
69795
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
69796
|
+
var _a;
|
|
69797
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
69798
|
+
}
|
|
69789
69799
|
}
|
|
69790
69800
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
69791
69801
|
Debug.assert(isObjectLiteralMethod(node));
|
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.2.0-pr-
|
|
5
|
+
"version": "5.2.0-pr-52095-19",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "4c71532aed3e7c13c47ac849a5161e466ec26773"
|
|
118
118
|
}
|