@typescript-deploys/pr-build 4.7.0-pr-48168-4 → 4.7.0-pr-48168-8
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 +137 -68
- package/lib/tsserver.js +176 -80
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +176 -80
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +176 -80
- package/lib/typescriptServices.d.ts +0 -1
- package/lib/typescriptServices.js +176 -80
- package/lib/typingsInstaller.js +172 -73
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -11807,10 +11807,23 @@ var ts;
|
|
|
11807
11807
|
&& node.parent.parent.kind === 236;
|
|
11808
11808
|
}
|
|
11809
11809
|
ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
|
|
11810
|
+
function isCommonJsExportedExpression(node) {
|
|
11811
|
+
if (!isInJSFile(node))
|
|
11812
|
+
return false;
|
|
11813
|
+
return (ts.isObjectLiteralExpression(node.parent) && ts.isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === 2) ||
|
|
11814
|
+
isCommonJsExportPropertyAssignment(node.parent);
|
|
11815
|
+
}
|
|
11816
|
+
ts.isCommonJsExportedExpression = isCommonJsExportedExpression;
|
|
11817
|
+
function isCommonJsExportPropertyAssignment(node) {
|
|
11818
|
+
if (!isInJSFile(node))
|
|
11819
|
+
return false;
|
|
11820
|
+
return (ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 1);
|
|
11821
|
+
}
|
|
11822
|
+
ts.isCommonJsExportPropertyAssignment = isCommonJsExportPropertyAssignment;
|
|
11810
11823
|
function isValidESSymbolDeclaration(node) {
|
|
11811
|
-
return ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
|
|
11824
|
+
return (ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
|
|
11812
11825
|
ts.isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) :
|
|
11813
|
-
ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node);
|
|
11826
|
+
ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node)) || isCommonJsExportPropertyAssignment(node);
|
|
11814
11827
|
}
|
|
11815
11828
|
ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
|
|
11816
11829
|
function introducesArgumentsExoticObject(node) {
|
|
@@ -39030,6 +39043,8 @@ var ts;
|
|
|
39030
39043
|
var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
|
|
39031
39044
|
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? getRestrictiveTypeParameter(t) : t; });
|
|
39032
39045
|
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? wildcardType : t; });
|
|
39046
|
+
var uniqueLiteralType = createIntrinsicType(131072, "never");
|
|
39047
|
+
var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? uniqueLiteralType : t; });
|
|
39033
39048
|
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
39034
39049
|
var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
39035
39050
|
emptyJsxObjectType.objectFlags |= 2048;
|
|
@@ -42458,8 +42473,14 @@ var ts;
|
|
|
42458
42473
|
var readonlyToken = type.declaration.readonlyToken ? ts.factory.createToken(type.declaration.readonlyToken.kind) : undefined;
|
|
42459
42474
|
var questionToken = type.declaration.questionToken ? ts.factory.createToken(type.declaration.questionToken.kind) : undefined;
|
|
42460
42475
|
var appropriateConstraintTypeNode;
|
|
42476
|
+
var newTypeVariable;
|
|
42461
42477
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
42462
|
-
|
|
42478
|
+
if (!(getModifiersTypeFromMappedType(type).flags & 262144) && context.flags & 4) {
|
|
42479
|
+
var newParam = createTypeParameter(createSymbol(262144, "T"));
|
|
42480
|
+
var name = typeParameterToName(newParam, context);
|
|
42481
|
+
newTypeVariable = ts.factory.createTypeReferenceNode(name);
|
|
42482
|
+
}
|
|
42483
|
+
appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(140, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
|
|
42463
42484
|
}
|
|
42464
42485
|
else {
|
|
42465
42486
|
appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context);
|
|
@@ -42469,7 +42490,11 @@ var ts;
|
|
|
42469
42490
|
var templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type), !!(getMappedTypeModifiers(type) & 4)), context);
|
|
42470
42491
|
var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode, undefined);
|
|
42471
42492
|
context.approximateLength += 10;
|
|
42472
|
-
|
|
42493
|
+
var result = ts.setEmitFlags(mappedTypeNode, 1);
|
|
42494
|
+
if (isMappedTypeWithKeyofConstraintDeclaration(type) && !(getModifiersTypeFromMappedType(type).flags & 262144) && context.flags & 4) {
|
|
42495
|
+
return ts.factory.createConditionalTypeNode(typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context), ts.factory.createInferTypeNode(ts.factory.createTypeParameterDeclaration(ts.factory.cloneNode(newTypeVariable.typeName))), result, ts.factory.createKeywordTypeNode(143));
|
|
42496
|
+
}
|
|
42497
|
+
return result;
|
|
42473
42498
|
}
|
|
42474
42499
|
function createAnonymousTypeNode(type) {
|
|
42475
42500
|
var _a;
|
|
@@ -43925,7 +43950,7 @@ var ts;
|
|
|
43925
43950
|
}
|
|
43926
43951
|
}
|
|
43927
43952
|
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
|
|
43928
|
-
var _a, _b;
|
|
43953
|
+
var _a, _b, _c, _d;
|
|
43929
43954
|
var symbolName = ts.unescapeLeadingUnderscores(symbol.escapedName);
|
|
43930
43955
|
var isDefault = symbol.escapedName === "default";
|
|
43931
43956
|
if (isPrivate && !(context.flags & 131072) && ts.isStringANonContextualKeyword(symbolName) && !isDefault) {
|
|
@@ -43968,17 +43993,21 @@ var ts;
|
|
|
43968
43993
|
serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags);
|
|
43969
43994
|
}
|
|
43970
43995
|
else {
|
|
43971
|
-
var flags = !(symbol.flags & 2)
|
|
43972
|
-
:
|
|
43996
|
+
var flags = !(symbol.flags & 2)
|
|
43997
|
+
? ((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && ts.isSourceFile((_b = symbol.parent) === null || _b === void 0 ? void 0 : _b.valueDeclaration)
|
|
43998
|
+
? 2
|
|
43999
|
+
: undefined
|
|
44000
|
+
: isConstVariable(symbol)
|
|
44001
|
+
? 2
|
|
43973
44002
|
: 1;
|
|
43974
44003
|
var name = (needsPostExportDefault || !(symbol.flags & 4)) ? localName : getUnusedName(localName, symbol);
|
|
43975
44004
|
var textRange = symbol.declarations && ts.find(symbol.declarations, function (d) { return ts.isVariableDeclaration(d); });
|
|
43976
44005
|
if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
|
|
43977
44006
|
textRange = textRange.parent.parent;
|
|
43978
44007
|
}
|
|
43979
|
-
var propertyAccessRequire = (
|
|
44008
|
+
var propertyAccessRequire = (_c = symbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isPropertyAccessExpression);
|
|
43980
44009
|
if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
|
|
43981
|
-
&& ((
|
|
44010
|
+
&& ((_d = type.symbol) === null || _d === void 0 ? void 0 : _d.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
|
|
43982
44011
|
var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
|
|
43983
44012
|
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, alias, localName)])), 0);
|
|
43984
44013
|
context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551);
|
|
@@ -44025,8 +44054,8 @@ var ts;
|
|
|
44025
44054
|
}
|
|
44026
44055
|
if (symbol.flags & 8388608) {
|
|
44027
44056
|
if (symbol.declarations) {
|
|
44028
|
-
for (var _i = 0,
|
|
44029
|
-
var node =
|
|
44057
|
+
for (var _i = 0, _e = symbol.declarations; _i < _e.length; _i++) {
|
|
44058
|
+
var node = _e[_i];
|
|
44030
44059
|
var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
|
|
44031
44060
|
if (!resolvedModule)
|
|
44032
44061
|
continue;
|
|
@@ -45519,7 +45548,10 @@ var ts;
|
|
|
45519
45548
|
if (containsSameNamedThisProperty(expression.left, expression.right)) {
|
|
45520
45549
|
return anyType;
|
|
45521
45550
|
}
|
|
45522
|
-
var
|
|
45551
|
+
var isDirectExport = kind === 1 && (ts.isPropertyAccessExpression(expression.left) || ts.isElementAccessExpression(expression.left)) && (ts.isModuleExportsAccessExpression(expression.left.expression) || (ts.isIdentifier(expression.left.expression) && ts.isExportsIdentifier(expression.left.expression)));
|
|
45552
|
+
var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol)
|
|
45553
|
+
: isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right))
|
|
45554
|
+
: getWidenedLiteralType(checkExpressionCached(expression.right));
|
|
45523
45555
|
if (type.flags & 524288 &&
|
|
45524
45556
|
kind === 2 &&
|
|
45525
45557
|
symbol.escapedName === "export=") {
|
|
@@ -48122,10 +48154,10 @@ var ts;
|
|
|
48122
48154
|
else if (type !== firstType) {
|
|
48123
48155
|
checkFlags |= 64;
|
|
48124
48156
|
}
|
|
48125
|
-
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
48157
|
+
if (isLiteralType(type) || isPatternLiteralType(type) || type === uniqueLiteralType) {
|
|
48126
48158
|
checkFlags |= 128;
|
|
48127
48159
|
}
|
|
48128
|
-
if (type.flags & 131072) {
|
|
48160
|
+
if (type.flags & 131072 && type !== uniqueLiteralType) {
|
|
48129
48161
|
checkFlags |= 131072;
|
|
48130
48162
|
}
|
|
48131
48163
|
propTypes.push(type);
|
|
@@ -50376,10 +50408,18 @@ var ts;
|
|
|
50376
50408
|
info.keyType === stringType && include & 8 ? stringOrNumberType : info.keyType : neverType; });
|
|
50377
50409
|
return getUnionType(ts.concatenate(propertyTypes, indexKeyTypes), 1, undefined, undefined, origin);
|
|
50378
50410
|
}
|
|
50411
|
+
function isPossiblyReducibleByInstantiation(type) {
|
|
50412
|
+
return ts.some(type.types, function (t) {
|
|
50413
|
+
var uniqueFilled = getUniqueLiteralFilledInstantiation(t);
|
|
50414
|
+
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
50415
|
+
});
|
|
50416
|
+
}
|
|
50379
50417
|
function getIndexType(type, stringsOnly, noIndexSignatures) {
|
|
50380
50418
|
if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
|
|
50381
50419
|
type = getReducedType(type);
|
|
50382
|
-
return type.flags & 1048576 ?
|
|
50420
|
+
return type.flags & 1048576 ? isPossiblyReducibleByInstantiation(type)
|
|
50421
|
+
? getIndexTypeForGenericType(type, stringsOnly)
|
|
50422
|
+
: getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
50383
50423
|
type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
50384
50424
|
type.flags & 58982400 || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
|
|
50385
50425
|
ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
|
|
@@ -50949,6 +50989,10 @@ var ts;
|
|
|
50949
50989
|
}
|
|
50950
50990
|
return type;
|
|
50951
50991
|
}
|
|
50992
|
+
function maybeCloneTypeParameter(p) {
|
|
50993
|
+
var constraint = getConstraintOfTypeParameter(p);
|
|
50994
|
+
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
|
|
50995
|
+
}
|
|
50952
50996
|
function isTypicalNondistributiveConditional(root) {
|
|
50953
50997
|
return !root.isDistributive && isSingletonTupleType(root.node.checkType) && isSingletonTupleType(root.node.extendsType);
|
|
50954
50998
|
}
|
|
@@ -50962,26 +51006,38 @@ var ts;
|
|
|
50962
51006
|
var result;
|
|
50963
51007
|
var extraTypes;
|
|
50964
51008
|
var tailCount = 0;
|
|
50965
|
-
|
|
51009
|
+
var _loop_18 = function () {
|
|
50966
51010
|
if (tailCount === 1000) {
|
|
50967
51011
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
50968
51012
|
result = errorType;
|
|
50969
|
-
break;
|
|
51013
|
+
return "break";
|
|
50970
51014
|
}
|
|
50971
51015
|
var isUnwrapped = isTypicalNondistributiveConditional(root);
|
|
50972
51016
|
var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
|
|
50973
51017
|
var checkTypeInstantiable = isGenericType(checkType);
|
|
50974
51018
|
var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
|
|
50975
51019
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
50976
|
-
return wildcardType;
|
|
51020
|
+
return { value: wildcardType };
|
|
50977
51021
|
}
|
|
50978
51022
|
var combinedMapper = void 0;
|
|
50979
51023
|
if (root.inferTypeParameters) {
|
|
50980
|
-
var
|
|
50981
|
-
|
|
50982
|
-
|
|
51024
|
+
var freshParams = ts.sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
|
|
51025
|
+
var freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : undefined;
|
|
51026
|
+
var context = createInferenceContext(freshParams, undefined, 0);
|
|
51027
|
+
if (freshMapper) {
|
|
51028
|
+
var freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
|
|
51029
|
+
for (var _i = 0, freshParams_1 = freshParams; _i < freshParams_1.length; _i++) {
|
|
51030
|
+
var p = freshParams_1[_i];
|
|
51031
|
+
if (root.inferTypeParameters.indexOf(p) === -1) {
|
|
51032
|
+
p.mapper = freshCombinedMapper;
|
|
51033
|
+
}
|
|
51034
|
+
}
|
|
51035
|
+
}
|
|
51036
|
+
if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) {
|
|
51037
|
+
inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 | 1024);
|
|
50983
51038
|
}
|
|
50984
|
-
|
|
51039
|
+
var innerMapper = combineTypeMappers(freshMapper, context.mapper);
|
|
51040
|
+
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
|
|
50985
51041
|
}
|
|
50986
51042
|
var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), combinedMapper) : extendsType;
|
|
50987
51043
|
if (!checkTypeInstantiable && !isGenericType(inferredExtendsType)) {
|
|
@@ -50994,23 +51050,23 @@ var ts;
|
|
|
50994
51050
|
var newRoot = falseType_1.root;
|
|
50995
51051
|
if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
|
|
50996
51052
|
root = newRoot;
|
|
50997
|
-
continue;
|
|
51053
|
+
return "continue";
|
|
50998
51054
|
}
|
|
50999
51055
|
if (canTailRecurse(falseType_1, mapper)) {
|
|
51000
|
-
continue;
|
|
51056
|
+
return "continue";
|
|
51001
51057
|
}
|
|
51002
51058
|
}
|
|
51003
51059
|
result = instantiateType(falseType_1, mapper);
|
|
51004
|
-
break;
|
|
51060
|
+
return "break";
|
|
51005
51061
|
}
|
|
51006
51062
|
if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
|
|
51007
51063
|
var trueType_1 = getTypeFromTypeNode(root.node.trueType);
|
|
51008
51064
|
var trueMapper = combinedMapper || mapper;
|
|
51009
51065
|
if (canTailRecurse(trueType_1, trueMapper)) {
|
|
51010
|
-
continue;
|
|
51066
|
+
return "continue";
|
|
51011
51067
|
}
|
|
51012
51068
|
result = instantiateType(trueType_1, trueMapper);
|
|
51013
|
-
break;
|
|
51069
|
+
return "break";
|
|
51014
51070
|
}
|
|
51015
51071
|
}
|
|
51016
51072
|
result = createType(16777216);
|
|
@@ -51021,7 +51077,14 @@ var ts;
|
|
|
51021
51077
|
result.combinedMapper = combinedMapper;
|
|
51022
51078
|
result.aliasSymbol = aliasSymbol || root.aliasSymbol;
|
|
51023
51079
|
result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper);
|
|
51024
|
-
break;
|
|
51080
|
+
return "break";
|
|
51081
|
+
};
|
|
51082
|
+
while (true) {
|
|
51083
|
+
var state_5 = _loop_18();
|
|
51084
|
+
if (typeof state_5 === "object")
|
|
51085
|
+
return state_5.value;
|
|
51086
|
+
if (state_5 === "break")
|
|
51087
|
+
break;
|
|
51025
51088
|
}
|
|
51026
51089
|
return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
|
|
51027
51090
|
function canTailRecurse(newType, newMapper) {
|
|
@@ -51423,9 +51486,11 @@ var ts;
|
|
|
51423
51486
|
}
|
|
51424
51487
|
function getESSymbolLikeTypeForNode(node) {
|
|
51425
51488
|
if (ts.isValidESSymbolDeclaration(node)) {
|
|
51426
|
-
var symbol = getSymbolOfNode(node);
|
|
51427
|
-
|
|
51428
|
-
|
|
51489
|
+
var symbol = ts.isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
|
|
51490
|
+
if (symbol) {
|
|
51491
|
+
var links = getSymbolLinks(symbol);
|
|
51492
|
+
return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
|
|
51493
|
+
}
|
|
51429
51494
|
}
|
|
51430
51495
|
return esSymbolType;
|
|
51431
51496
|
}
|
|
@@ -52005,6 +52070,10 @@ var ts;
|
|
|
52005
52070
|
}
|
|
52006
52071
|
return type;
|
|
52007
52072
|
}
|
|
52073
|
+
function getUniqueLiteralFilledInstantiation(type) {
|
|
52074
|
+
return type.flags & (131068 | 3 | 131072) ? type :
|
|
52075
|
+
type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
52076
|
+
}
|
|
52008
52077
|
function getPermissiveInstantiation(type) {
|
|
52009
52078
|
return type.flags & (131068 | 3 | 131072) ? type :
|
|
52010
52079
|
type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
@@ -53301,7 +53370,7 @@ var ts;
|
|
|
53301
53370
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
53302
53371
|
checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
|
|
53303
53372
|
}
|
|
53304
|
-
var
|
|
53373
|
+
var _loop_19 = function (prop) {
|
|
53305
53374
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
53306
53375
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
53307
53376
|
if (reportErrors) {
|
|
@@ -53354,9 +53423,9 @@ var ts;
|
|
|
53354
53423
|
};
|
|
53355
53424
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
53356
53425
|
var prop = _b[_i];
|
|
53357
|
-
var
|
|
53358
|
-
if (typeof
|
|
53359
|
-
return
|
|
53426
|
+
var state_6 = _loop_19(prop);
|
|
53427
|
+
if (typeof state_6 === "object")
|
|
53428
|
+
return state_6.value;
|
|
53360
53429
|
}
|
|
53361
53430
|
return false;
|
|
53362
53431
|
}
|
|
@@ -54133,11 +54202,11 @@ var ts;
|
|
|
54133
54202
|
}
|
|
54134
54203
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
54135
54204
|
var matchingTypes = [];
|
|
54136
|
-
var
|
|
54205
|
+
var _loop_20 = function (combination) {
|
|
54137
54206
|
var hasMatch = false;
|
|
54138
54207
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
54139
54208
|
var type = _d[_c];
|
|
54140
|
-
var
|
|
54209
|
+
var _loop_21 = function (i) {
|
|
54141
54210
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
54142
54211
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
54143
54212
|
if (!targetProperty)
|
|
@@ -54150,8 +54219,8 @@ var ts;
|
|
|
54150
54219
|
}
|
|
54151
54220
|
};
|
|
54152
54221
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
54153
|
-
var
|
|
54154
|
-
switch (
|
|
54222
|
+
var state_8 = _loop_21(i);
|
|
54223
|
+
switch (state_8) {
|
|
54155
54224
|
case "continue-outer": continue outer;
|
|
54156
54225
|
}
|
|
54157
54226
|
}
|
|
@@ -54164,9 +54233,9 @@ var ts;
|
|
|
54164
54233
|
};
|
|
54165
54234
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
54166
54235
|
var combination = discriminantCombinations_1[_a];
|
|
54167
|
-
var
|
|
54168
|
-
if (typeof
|
|
54169
|
-
return
|
|
54236
|
+
var state_7 = _loop_20(combination);
|
|
54237
|
+
if (typeof state_7 === "object")
|
|
54238
|
+
return state_7.value;
|
|
54170
54239
|
}
|
|
54171
54240
|
var result = -1;
|
|
54172
54241
|
for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
|
|
@@ -54814,7 +54883,7 @@ var ts;
|
|
|
54814
54883
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 });
|
|
54815
54884
|
cache.variances = ts.emptyArray;
|
|
54816
54885
|
variances = [];
|
|
54817
|
-
var
|
|
54886
|
+
var _loop_22 = function (tp) {
|
|
54818
54887
|
var unmeasurable = false;
|
|
54819
54888
|
var unreliable = false;
|
|
54820
54889
|
var oldHandler = outofbandVarianceMarkerHandler;
|
|
@@ -54839,7 +54908,7 @@ var ts;
|
|
|
54839
54908
|
};
|
|
54840
54909
|
for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
|
|
54841
54910
|
var tp = typeParameters_1[_i];
|
|
54842
|
-
|
|
54911
|
+
_loop_22(tp);
|
|
54843
54912
|
}
|
|
54844
54913
|
cache.variances = variances;
|
|
54845
54914
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -56890,7 +56959,7 @@ var ts;
|
|
|
56890
56959
|
function mapTypesByKeyProperty(types, name) {
|
|
56891
56960
|
var map = new ts.Map();
|
|
56892
56961
|
var count = 0;
|
|
56893
|
-
var
|
|
56962
|
+
var _loop_23 = function (type) {
|
|
56894
56963
|
if (type.flags & (524288 | 2097152 | 58982400)) {
|
|
56895
56964
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
56896
56965
|
if (discriminant) {
|
|
@@ -56916,9 +56985,9 @@ var ts;
|
|
|
56916
56985
|
};
|
|
56917
56986
|
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
|
|
56918
56987
|
var type = types_16[_i];
|
|
56919
|
-
var
|
|
56920
|
-
if (typeof
|
|
56921
|
-
return
|
|
56988
|
+
var state_9 = _loop_23(type);
|
|
56989
|
+
if (typeof state_9 === "object")
|
|
56990
|
+
return state_9.value;
|
|
56922
56991
|
}
|
|
56923
56992
|
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
|
56924
56993
|
}
|
|
@@ -62299,7 +62368,7 @@ var ts;
|
|
|
62299
62368
|
var spreadIndex = getSpreadArgumentIndex(args);
|
|
62300
62369
|
if (spreadIndex >= 0) {
|
|
62301
62370
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
62302
|
-
var
|
|
62371
|
+
var _loop_24 = function (i) {
|
|
62303
62372
|
var arg = args[i];
|
|
62304
62373
|
var spreadType = arg.kind === 224 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
62305
62374
|
if (spreadType && isTupleType(spreadType)) {
|
|
@@ -62315,7 +62384,7 @@ var ts;
|
|
|
62315
62384
|
}
|
|
62316
62385
|
};
|
|
62317
62386
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
62318
|
-
|
|
62387
|
+
_loop_24(i);
|
|
62319
62388
|
}
|
|
62320
62389
|
return effectiveArgs_1;
|
|
62321
62390
|
}
|
|
@@ -62556,7 +62625,7 @@ var ts;
|
|
|
62556
62625
|
var min_3 = Number.MAX_VALUE;
|
|
62557
62626
|
var minIndex = 0;
|
|
62558
62627
|
var i_1 = 0;
|
|
62559
|
-
var
|
|
62628
|
+
var _loop_25 = function (c) {
|
|
62560
62629
|
var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
62561
62630
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
|
|
62562
62631
|
if (diags_2) {
|
|
@@ -62574,7 +62643,7 @@ var ts;
|
|
|
62574
62643
|
};
|
|
62575
62644
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
62576
62645
|
var c = candidatesForArgumentError_1[_a];
|
|
62577
|
-
|
|
62646
|
+
_loop_25(c);
|
|
62578
62647
|
}
|
|
62579
62648
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
62580
62649
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -62717,7 +62786,7 @@ var ts;
|
|
|
62717
62786
|
}
|
|
62718
62787
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
62719
62788
|
var parameters = [];
|
|
62720
|
-
var
|
|
62789
|
+
var _loop_26 = function (i) {
|
|
62721
62790
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
62722
62791
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
62723
62792
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -62725,7 +62794,7 @@ var ts;
|
|
|
62725
62794
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
62726
62795
|
};
|
|
62727
62796
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
62728
|
-
|
|
62797
|
+
_loop_26(i);
|
|
62729
62798
|
}
|
|
62730
62799
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
62731
62800
|
var flags = 0;
|
|
@@ -65589,7 +65658,7 @@ var ts;
|
|
|
65589
65658
|
}
|
|
65590
65659
|
function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {
|
|
65591
65660
|
var type = checkExpression(node, checkMode, forceTuple);
|
|
65592
|
-
return isConstContext(node) ? getRegularTypeOfLiteralType(type) :
|
|
65661
|
+
return isConstContext(node) || ts.isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) :
|
|
65593
65662
|
isTypeAssertion(node) ? type :
|
|
65594
65663
|
getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node));
|
|
65595
65664
|
}
|
|
@@ -66265,7 +66334,7 @@ var ts;
|
|
|
66265
66334
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
66266
66335
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
66267
66336
|
var indexSignatureMap_1 = new ts.Map();
|
|
66268
|
-
var
|
|
66337
|
+
var _loop_27 = function (declaration) {
|
|
66269
66338
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
66270
66339
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
66271
66340
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -66280,7 +66349,7 @@ var ts;
|
|
|
66280
66349
|
};
|
|
66281
66350
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
66282
66351
|
var declaration = _a[_i];
|
|
66283
|
-
|
|
66352
|
+
_loop_27(declaration);
|
|
66284
66353
|
}
|
|
66285
66354
|
indexSignatureMap_1.forEach(function (entry) {
|
|
66286
66355
|
if (entry.declarations.length > 1) {
|
|
@@ -69019,7 +69088,7 @@ var ts;
|
|
|
69019
69088
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 257) : undefined;
|
|
69020
69089
|
var localPropDeclaration = declaration && declaration.kind === 220 ||
|
|
69021
69090
|
name && name.kind === 161 || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
69022
|
-
var
|
|
69091
|
+
var _loop_28 = function (info) {
|
|
69023
69092
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
69024
69093
|
var errorNode = localPropDeclaration || localIndexDeclaration ||
|
|
69025
69094
|
(interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
|
|
@@ -69029,7 +69098,7 @@ var ts;
|
|
|
69029
69098
|
};
|
|
69030
69099
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
69031
69100
|
var info = indexInfos_9[_i];
|
|
69032
|
-
|
|
69101
|
+
_loop_28(info);
|
|
69033
69102
|
}
|
|
69034
69103
|
}
|
|
69035
69104
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -69037,7 +69106,7 @@ var ts;
|
|
|
69037
69106
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
69038
69107
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 257) : undefined;
|
|
69039
69108
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
69040
|
-
var
|
|
69109
|
+
var _loop_29 = function (info) {
|
|
69041
69110
|
if (info === checkInfo)
|
|
69042
69111
|
return "continue";
|
|
69043
69112
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -69049,7 +69118,7 @@ var ts;
|
|
|
69049
69118
|
};
|
|
69050
69119
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
69051
69120
|
var info = indexInfos_10[_i];
|
|
69052
|
-
|
|
69121
|
+
_loop_29(info);
|
|
69053
69122
|
}
|
|
69054
69123
|
}
|
|
69055
69124
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -69335,7 +69404,7 @@ var ts;
|
|
|
69335
69404
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
69336
69405
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
69337
69406
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
69338
|
-
var
|
|
69407
|
+
var _loop_30 = function (member) {
|
|
69339
69408
|
if (ts.hasAmbientModifier(member)) {
|
|
69340
69409
|
return "continue";
|
|
69341
69410
|
}
|
|
@@ -69350,7 +69419,7 @@ var ts;
|
|
|
69350
69419
|
};
|
|
69351
69420
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
69352
69421
|
var member = _a[_i];
|
|
69353
|
-
|
|
69422
|
+
_loop_30(member);
|
|
69354
69423
|
}
|
|
69355
69424
|
}
|
|
69356
69425
|
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
|
|
@@ -69425,7 +69494,7 @@ var ts;
|
|
|
69425
69494
|
}
|
|
69426
69495
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
69427
69496
|
var issuedMemberError = false;
|
|
69428
|
-
var
|
|
69497
|
+
var _loop_31 = function (member) {
|
|
69429
69498
|
if (ts.isStatic(member)) {
|
|
69430
69499
|
return "continue";
|
|
69431
69500
|
}
|
|
@@ -69443,7 +69512,7 @@ var ts;
|
|
|
69443
69512
|
};
|
|
69444
69513
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
69445
69514
|
var member = _a[_i];
|
|
69446
|
-
|
|
69515
|
+
_loop_31(member);
|
|
69447
69516
|
}
|
|
69448
69517
|
if (!issuedMemberError) {
|
|
69449
69518
|
checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
|
|
@@ -99766,7 +99835,7 @@ var ts;
|
|
|
99766
99835
|
importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
|
|
99767
99836
|
});
|
|
99768
99837
|
var sortedPaths = [];
|
|
99769
|
-
var
|
|
99838
|
+
var _loop_32 = function (directory) {
|
|
99770
99839
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
99771
99840
|
var pathsInDirectory;
|
|
99772
99841
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -99790,9 +99859,9 @@ var ts;
|
|
|
99790
99859
|
};
|
|
99791
99860
|
var out_directory_1;
|
|
99792
99861
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
99793
|
-
var
|
|
99862
|
+
var state_10 = _loop_32(directory);
|
|
99794
99863
|
directory = out_directory_1;
|
|
99795
|
-
if (
|
|
99864
|
+
if (state_10 === "break")
|
|
99796
99865
|
break;
|
|
99797
99866
|
}
|
|
99798
99867
|
if (allFileNames.size) {
|