@typescript-deploys/pr-build 4.7.0-pr-45974-15 → 4.7.0-pr-47898-11
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 +29 -54
- package/lib/tsserver.js +32 -54
- package/lib/tsserverlibrary.js +32 -54
- package/lib/typescript.js +32 -54
- package/lib/typescriptServices.js +32 -54
- package/lib/typingsInstaller.js +32 -54
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220215";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -34983,7 +34983,13 @@ var ts;
|
|
|
34983
34983
|
}
|
|
34984
34984
|
}
|
|
34985
34985
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
34986
|
-
|
|
34986
|
+
var features = state.features;
|
|
34987
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
34988
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
34989
|
+
}
|
|
34990
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, false);
|
|
34991
|
+
state.features = features;
|
|
34992
|
+
return result;
|
|
34987
34993
|
};
|
|
34988
34994
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
34989
34995
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -36122,7 +36128,7 @@ var ts;
|
|
|
36122
36128
|
return ts.isDottedName(expr)
|
|
36123
36129
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
36124
36130
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 && isNarrowableReference(expr.right)
|
|
36125
|
-
|| ts.isElementAccessExpression(expr) &&
|
|
36131
|
+
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
36126
36132
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
36127
36133
|
}
|
|
36128
36134
|
function containsNarrowableReference(expr) {
|
|
@@ -51856,7 +51862,10 @@ var ts;
|
|
|
51856
51862
|
case 204:
|
|
51857
51863
|
return ts.some(node.properties, isContextSensitive);
|
|
51858
51864
|
case 203:
|
|
51859
|
-
|
|
51865
|
+
if (node.elements.length > 0) {
|
|
51866
|
+
return ts.some(node.elements, isContextSensitive);
|
|
51867
|
+
}
|
|
51868
|
+
return true;
|
|
51860
51869
|
case 221:
|
|
51861
51870
|
return isContextSensitive(node.whenTrue) ||
|
|
51862
51871
|
isContextSensitive(node.whenFalse);
|
|
@@ -56583,9 +56592,8 @@ var ts;
|
|
|
56583
56592
|
return isMatchingReference(source.expression, target);
|
|
56584
56593
|
case 205:
|
|
56585
56594
|
case 206:
|
|
56586
|
-
|
|
56587
|
-
|
|
56588
|
-
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
56595
|
+
return ts.isAccessExpression(target) &&
|
|
56596
|
+
getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
|
|
56589
56597
|
isMatchingReference(source.expression, target.expression);
|
|
56590
56598
|
case 160:
|
|
56591
56599
|
return ts.isAccessExpression(target) &&
|
|
@@ -56597,49 +56605,12 @@ var ts;
|
|
|
56597
56605
|
return false;
|
|
56598
56606
|
}
|
|
56599
56607
|
function getAccessedPropertyName(access) {
|
|
56600
|
-
|
|
56601
|
-
|
|
56602
|
-
|
|
56603
|
-
|
|
56604
|
-
|
|
56605
|
-
|
|
56606
|
-
if (ts.isBindingElement(access)) {
|
|
56607
|
-
var name = getDestructuringPropertyName(access);
|
|
56608
|
-
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
56609
|
-
}
|
|
56610
|
-
if (ts.isParameter(access)) {
|
|
56611
|
-
return ("" + access.parent.parameters.indexOf(access));
|
|
56612
|
-
}
|
|
56613
|
-
return undefined;
|
|
56614
|
-
}
|
|
56615
|
-
function tryGetNameFromType(type) {
|
|
56616
|
-
return type.flags & 8192 ? type.escapedName :
|
|
56617
|
-
type.flags & 384 ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
56618
|
-
}
|
|
56619
|
-
function tryGetElementAccessExpressionName(node) {
|
|
56620
|
-
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
56621
|
-
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
56622
|
-
}
|
|
56623
|
-
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
56624
|
-
var symbol = resolveEntityName(node.argumentExpression, 111551, true);
|
|
56625
|
-
if (!symbol || !isConstVariable(symbol))
|
|
56626
|
-
return undefined;
|
|
56627
|
-
var declaration = symbol.valueDeclaration;
|
|
56628
|
-
if (declaration === undefined)
|
|
56629
|
-
return undefined;
|
|
56630
|
-
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
56631
|
-
if (type) {
|
|
56632
|
-
var name = tryGetNameFromType(type);
|
|
56633
|
-
if (name !== undefined) {
|
|
56634
|
-
return name;
|
|
56635
|
-
}
|
|
56636
|
-
}
|
|
56637
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
56638
|
-
var initializer = ts.getEffectiveInitializer(declaration);
|
|
56639
|
-
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
56640
|
-
}
|
|
56641
|
-
}
|
|
56642
|
-
return undefined;
|
|
56608
|
+
var propertyName;
|
|
56609
|
+
return access.kind === 205 ? access.name.escapedText :
|
|
56610
|
+
access.kind === 206 && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
56611
|
+
access.kind === 202 && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
56612
|
+
access.kind === 163 ? ("" + access.parent.parameters.indexOf(access)) :
|
|
56613
|
+
undefined;
|
|
56643
56614
|
}
|
|
56644
56615
|
function containsMatchingReference(source, target) {
|
|
56645
56616
|
while (ts.isAccessExpression(source)) {
|
|
@@ -60000,6 +59971,12 @@ var ts;
|
|
|
60000
59971
|
var elementTypes = [];
|
|
60001
59972
|
var elementFlags = [];
|
|
60002
59973
|
var contextualType = getApparentTypeOfContextualType(node);
|
|
59974
|
+
if (elementCount === 0 && contextualType && !checkMode) {
|
|
59975
|
+
var elementType = getElementTypeOfArrayType(contextualType);
|
|
59976
|
+
if (elementType) {
|
|
59977
|
+
return createArrayType(elementType);
|
|
59978
|
+
}
|
|
59979
|
+
}
|
|
60003
59980
|
var inDestructuringPattern = ts.isAssignmentTarget(node);
|
|
60004
59981
|
var inConstContext = isConstContext(node);
|
|
60005
59982
|
var hasOmittedExpression = false;
|
|
@@ -69329,7 +69306,7 @@ var ts;
|
|
|
69329
69306
|
}
|
|
69330
69307
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
69331
69308
|
var propName = member.name;
|
|
69332
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)
|
|
69309
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
69333
69310
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
69334
69311
|
if (!(type.flags & 3 || getFalsyFlags(type) & 32768)) {
|
|
69335
69312
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -69363,9 +69340,7 @@ var ts;
|
|
|
69363
69340
|
return false;
|
|
69364
69341
|
}
|
|
69365
69342
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
69366
|
-
var reference = ts.
|
|
69367
|
-
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
69368
|
-
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
69343
|
+
var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
69369
69344
|
ts.setParent(reference.expression, reference);
|
|
69370
69345
|
ts.setParent(reference, constructor);
|
|
69371
69346
|
reference.flowNode = constructor.returnFlowNode;
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220215";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -42845,7 +42845,16 @@ var ts;
|
|
|
42845
42845
|
// Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types"
|
|
42846
42846
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
42847
42847
|
// Don't do package.json lookup recursively, because Node.js' package lookup doesn't.
|
|
42848
|
-
|
|
42848
|
+
// Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions)
|
|
42849
|
+
// (technically it only emits a deprecation warning in esm packages right now, but that's probably
|
|
42850
|
+
// enough to mean we don't need to support it)
|
|
42851
|
+
var features = state.features;
|
|
42852
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
42853
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
42854
|
+
}
|
|
42855
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
|
|
42856
|
+
state.features = features;
|
|
42857
|
+
return result;
|
|
42849
42858
|
};
|
|
42850
42859
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
42851
42860
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -44192,7 +44201,7 @@ var ts;
|
|
|
44192
44201
|
return ts.isDottedName(expr)
|
|
44193
44202
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44194
44203
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44195
|
-
|| ts.isElementAccessExpression(expr) &&
|
|
44204
|
+
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44196
44205
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44197
44206
|
}
|
|
44198
44207
|
function containsNarrowableReference(expr) {
|
|
@@ -62336,7 +62345,10 @@ var ts;
|
|
|
62336
62345
|
case 204 /* ObjectLiteralExpression */:
|
|
62337
62346
|
return ts.some(node.properties, isContextSensitive);
|
|
62338
62347
|
case 203 /* ArrayLiteralExpression */:
|
|
62339
|
-
|
|
62348
|
+
if (node.elements.length > 0) {
|
|
62349
|
+
return ts.some(node.elements, isContextSensitive);
|
|
62350
|
+
}
|
|
62351
|
+
return true;
|
|
62340
62352
|
case 221 /* ConditionalExpression */:
|
|
62341
62353
|
return isContextSensitive(node.whenTrue) ||
|
|
62342
62354
|
isContextSensitive(node.whenFalse);
|
|
@@ -67842,9 +67854,8 @@ var ts;
|
|
|
67842
67854
|
return isMatchingReference(source.expression, target);
|
|
67843
67855
|
case 205 /* PropertyAccessExpression */:
|
|
67844
67856
|
case 206 /* ElementAccessExpression */:
|
|
67845
|
-
|
|
67846
|
-
|
|
67847
|
-
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
67857
|
+
return ts.isAccessExpression(target) &&
|
|
67858
|
+
getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
|
|
67848
67859
|
isMatchingReference(source.expression, target.expression);
|
|
67849
67860
|
case 160 /* QualifiedName */:
|
|
67850
67861
|
return ts.isAccessExpression(target) &&
|
|
@@ -67856,49 +67867,12 @@ var ts;
|
|
|
67856
67867
|
return false;
|
|
67857
67868
|
}
|
|
67858
67869
|
function getAccessedPropertyName(access) {
|
|
67859
|
-
|
|
67860
|
-
|
|
67861
|
-
|
|
67862
|
-
|
|
67863
|
-
|
|
67864
|
-
|
|
67865
|
-
if (ts.isBindingElement(access)) {
|
|
67866
|
-
var name = getDestructuringPropertyName(access);
|
|
67867
|
-
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
67868
|
-
}
|
|
67869
|
-
if (ts.isParameter(access)) {
|
|
67870
|
-
return ("" + access.parent.parameters.indexOf(access));
|
|
67871
|
-
}
|
|
67872
|
-
return undefined;
|
|
67873
|
-
}
|
|
67874
|
-
function tryGetNameFromType(type) {
|
|
67875
|
-
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
67876
|
-
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
67877
|
-
}
|
|
67878
|
-
function tryGetElementAccessExpressionName(node) {
|
|
67879
|
-
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
67880
|
-
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
67881
|
-
}
|
|
67882
|
-
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
67883
|
-
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
67884
|
-
if (!symbol || !isConstVariable(symbol))
|
|
67885
|
-
return undefined;
|
|
67886
|
-
var declaration = symbol.valueDeclaration;
|
|
67887
|
-
if (declaration === undefined)
|
|
67888
|
-
return undefined;
|
|
67889
|
-
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
67890
|
-
if (type) {
|
|
67891
|
-
var name = tryGetNameFromType(type);
|
|
67892
|
-
if (name !== undefined) {
|
|
67893
|
-
return name;
|
|
67894
|
-
}
|
|
67895
|
-
}
|
|
67896
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
67897
|
-
var initializer = ts.getEffectiveInitializer(declaration);
|
|
67898
|
-
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
67899
|
-
}
|
|
67900
|
-
}
|
|
67901
|
-
return undefined;
|
|
67870
|
+
var propertyName;
|
|
67871
|
+
return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
|
|
67872
|
+
access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
67873
|
+
access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
67874
|
+
access.kind === 163 /* Parameter */ ? ("" + access.parent.parameters.indexOf(access)) :
|
|
67875
|
+
undefined;
|
|
67902
67876
|
}
|
|
67903
67877
|
function containsMatchingReference(source, target) {
|
|
67904
67878
|
while (ts.isAccessExpression(source)) {
|
|
@@ -71847,6 +71821,12 @@ var ts;
|
|
|
71847
71821
|
var elementTypes = [];
|
|
71848
71822
|
var elementFlags = [];
|
|
71849
71823
|
var contextualType = getApparentTypeOfContextualType(node);
|
|
71824
|
+
if (elementCount === 0 && contextualType && !checkMode) {
|
|
71825
|
+
var elementType = getElementTypeOfArrayType(contextualType);
|
|
71826
|
+
if (elementType) {
|
|
71827
|
+
return createArrayType(elementType);
|
|
71828
|
+
}
|
|
71829
|
+
}
|
|
71850
71830
|
var inDestructuringPattern = ts.isAssignmentTarget(node);
|
|
71851
71831
|
var inConstContext = isConstContext(node);
|
|
71852
71832
|
var hasOmittedExpression = false;
|
|
@@ -82816,7 +82796,7 @@ var ts;
|
|
|
82816
82796
|
}
|
|
82817
82797
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
82818
82798
|
var propName = member.name;
|
|
82819
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)
|
|
82799
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
82820
82800
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
82821
82801
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
82822
82802
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -82851,9 +82831,7 @@ var ts;
|
|
|
82851
82831
|
return false;
|
|
82852
82832
|
}
|
|
82853
82833
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
82854
|
-
var reference = ts.
|
|
82855
|
-
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
82856
|
-
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
82834
|
+
var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
82857
82835
|
ts.setParent(reference.expression, reference);
|
|
82858
82836
|
ts.setParent(reference, constructor);
|
|
82859
82837
|
reference.flowNode = constructor.returnFlowNode;
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220215";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -43039,7 +43039,16 @@ var ts;
|
|
|
43039
43039
|
// Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types"
|
|
43040
43040
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
43041
43041
|
// Don't do package.json lookup recursively, because Node.js' package lookup doesn't.
|
|
43042
|
-
|
|
43042
|
+
// Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions)
|
|
43043
|
+
// (technically it only emits a deprecation warning in esm packages right now, but that's probably
|
|
43044
|
+
// enough to mean we don't need to support it)
|
|
43045
|
+
var features = state.features;
|
|
43046
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
43047
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
43048
|
+
}
|
|
43049
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
|
|
43050
|
+
state.features = features;
|
|
43051
|
+
return result;
|
|
43043
43052
|
};
|
|
43044
43053
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
43045
43054
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -44386,7 +44395,7 @@ var ts;
|
|
|
44386
44395
|
return ts.isDottedName(expr)
|
|
44387
44396
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44388
44397
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44389
|
-
|| ts.isElementAccessExpression(expr) &&
|
|
44398
|
+
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44390
44399
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44391
44400
|
}
|
|
44392
44401
|
function containsNarrowableReference(expr) {
|
|
@@ -62530,7 +62539,10 @@ var ts;
|
|
|
62530
62539
|
case 204 /* ObjectLiteralExpression */:
|
|
62531
62540
|
return ts.some(node.properties, isContextSensitive);
|
|
62532
62541
|
case 203 /* ArrayLiteralExpression */:
|
|
62533
|
-
|
|
62542
|
+
if (node.elements.length > 0) {
|
|
62543
|
+
return ts.some(node.elements, isContextSensitive);
|
|
62544
|
+
}
|
|
62545
|
+
return true;
|
|
62534
62546
|
case 221 /* ConditionalExpression */:
|
|
62535
62547
|
return isContextSensitive(node.whenTrue) ||
|
|
62536
62548
|
isContextSensitive(node.whenFalse);
|
|
@@ -68036,9 +68048,8 @@ var ts;
|
|
|
68036
68048
|
return isMatchingReference(source.expression, target);
|
|
68037
68049
|
case 205 /* PropertyAccessExpression */:
|
|
68038
68050
|
case 206 /* ElementAccessExpression */:
|
|
68039
|
-
|
|
68040
|
-
|
|
68041
|
-
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
68051
|
+
return ts.isAccessExpression(target) &&
|
|
68052
|
+
getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
|
|
68042
68053
|
isMatchingReference(source.expression, target.expression);
|
|
68043
68054
|
case 160 /* QualifiedName */:
|
|
68044
68055
|
return ts.isAccessExpression(target) &&
|
|
@@ -68050,49 +68061,12 @@ var ts;
|
|
|
68050
68061
|
return false;
|
|
68051
68062
|
}
|
|
68052
68063
|
function getAccessedPropertyName(access) {
|
|
68053
|
-
|
|
68054
|
-
|
|
68055
|
-
|
|
68056
|
-
|
|
68057
|
-
|
|
68058
|
-
|
|
68059
|
-
if (ts.isBindingElement(access)) {
|
|
68060
|
-
var name = getDestructuringPropertyName(access);
|
|
68061
|
-
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
68062
|
-
}
|
|
68063
|
-
if (ts.isParameter(access)) {
|
|
68064
|
-
return ("" + access.parent.parameters.indexOf(access));
|
|
68065
|
-
}
|
|
68066
|
-
return undefined;
|
|
68067
|
-
}
|
|
68068
|
-
function tryGetNameFromType(type) {
|
|
68069
|
-
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
68070
|
-
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
68071
|
-
}
|
|
68072
|
-
function tryGetElementAccessExpressionName(node) {
|
|
68073
|
-
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
68074
|
-
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
68075
|
-
}
|
|
68076
|
-
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
68077
|
-
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
68078
|
-
if (!symbol || !isConstVariable(symbol))
|
|
68079
|
-
return undefined;
|
|
68080
|
-
var declaration = symbol.valueDeclaration;
|
|
68081
|
-
if (declaration === undefined)
|
|
68082
|
-
return undefined;
|
|
68083
|
-
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
68084
|
-
if (type) {
|
|
68085
|
-
var name = tryGetNameFromType(type);
|
|
68086
|
-
if (name !== undefined) {
|
|
68087
|
-
return name;
|
|
68088
|
-
}
|
|
68089
|
-
}
|
|
68090
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
68091
|
-
var initializer = ts.getEffectiveInitializer(declaration);
|
|
68092
|
-
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
68093
|
-
}
|
|
68094
|
-
}
|
|
68095
|
-
return undefined;
|
|
68064
|
+
var propertyName;
|
|
68065
|
+
return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
|
|
68066
|
+
access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
68067
|
+
access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
68068
|
+
access.kind === 163 /* Parameter */ ? ("" + access.parent.parameters.indexOf(access)) :
|
|
68069
|
+
undefined;
|
|
68096
68070
|
}
|
|
68097
68071
|
function containsMatchingReference(source, target) {
|
|
68098
68072
|
while (ts.isAccessExpression(source)) {
|
|
@@ -72041,6 +72015,12 @@ var ts;
|
|
|
72041
72015
|
var elementTypes = [];
|
|
72042
72016
|
var elementFlags = [];
|
|
72043
72017
|
var contextualType = getApparentTypeOfContextualType(node);
|
|
72018
|
+
if (elementCount === 0 && contextualType && !checkMode) {
|
|
72019
|
+
var elementType = getElementTypeOfArrayType(contextualType);
|
|
72020
|
+
if (elementType) {
|
|
72021
|
+
return createArrayType(elementType);
|
|
72022
|
+
}
|
|
72023
|
+
}
|
|
72044
72024
|
var inDestructuringPattern = ts.isAssignmentTarget(node);
|
|
72045
72025
|
var inConstContext = isConstContext(node);
|
|
72046
72026
|
var hasOmittedExpression = false;
|
|
@@ -83010,7 +82990,7 @@ var ts;
|
|
|
83010
82990
|
}
|
|
83011
82991
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
83012
82992
|
var propName = member.name;
|
|
83013
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)
|
|
82993
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
83014
82994
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
83015
82995
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
83016
82996
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -83045,9 +83025,7 @@ var ts;
|
|
|
83045
83025
|
return false;
|
|
83046
83026
|
}
|
|
83047
83027
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
83048
|
-
var reference = ts.
|
|
83049
|
-
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
83050
|
-
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83028
|
+
var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83051
83029
|
ts.setParent(reference.expression, reference);
|
|
83052
83030
|
ts.setParent(reference, constructor);
|
|
83053
83031
|
reference.flowNode = constructor.returnFlowNode;
|
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220215";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -43039,7 +43039,16 @@ var ts;
|
|
|
43039
43039
|
// Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types"
|
|
43040
43040
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
43041
43041
|
// Don't do package.json lookup recursively, because Node.js' package lookup doesn't.
|
|
43042
|
-
|
|
43042
|
+
// Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions)
|
|
43043
|
+
// (technically it only emits a deprecation warning in esm packages right now, but that's probably
|
|
43044
|
+
// enough to mean we don't need to support it)
|
|
43045
|
+
var features = state.features;
|
|
43046
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
43047
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
43048
|
+
}
|
|
43049
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
|
|
43050
|
+
state.features = features;
|
|
43051
|
+
return result;
|
|
43043
43052
|
};
|
|
43044
43053
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
43045
43054
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -44386,7 +44395,7 @@ var ts;
|
|
|
44386
44395
|
return ts.isDottedName(expr)
|
|
44387
44396
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44388
44397
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44389
|
-
|| ts.isElementAccessExpression(expr) &&
|
|
44398
|
+
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44390
44399
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44391
44400
|
}
|
|
44392
44401
|
function containsNarrowableReference(expr) {
|
|
@@ -62530,7 +62539,10 @@ var ts;
|
|
|
62530
62539
|
case 204 /* ObjectLiteralExpression */:
|
|
62531
62540
|
return ts.some(node.properties, isContextSensitive);
|
|
62532
62541
|
case 203 /* ArrayLiteralExpression */:
|
|
62533
|
-
|
|
62542
|
+
if (node.elements.length > 0) {
|
|
62543
|
+
return ts.some(node.elements, isContextSensitive);
|
|
62544
|
+
}
|
|
62545
|
+
return true;
|
|
62534
62546
|
case 221 /* ConditionalExpression */:
|
|
62535
62547
|
return isContextSensitive(node.whenTrue) ||
|
|
62536
62548
|
isContextSensitive(node.whenFalse);
|
|
@@ -68036,9 +68048,8 @@ var ts;
|
|
|
68036
68048
|
return isMatchingReference(source.expression, target);
|
|
68037
68049
|
case 205 /* PropertyAccessExpression */:
|
|
68038
68050
|
case 206 /* ElementAccessExpression */:
|
|
68039
|
-
|
|
68040
|
-
|
|
68041
|
-
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
68051
|
+
return ts.isAccessExpression(target) &&
|
|
68052
|
+
getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
|
|
68042
68053
|
isMatchingReference(source.expression, target.expression);
|
|
68043
68054
|
case 160 /* QualifiedName */:
|
|
68044
68055
|
return ts.isAccessExpression(target) &&
|
|
@@ -68050,49 +68061,12 @@ var ts;
|
|
|
68050
68061
|
return false;
|
|
68051
68062
|
}
|
|
68052
68063
|
function getAccessedPropertyName(access) {
|
|
68053
|
-
|
|
68054
|
-
|
|
68055
|
-
|
|
68056
|
-
|
|
68057
|
-
|
|
68058
|
-
|
|
68059
|
-
if (ts.isBindingElement(access)) {
|
|
68060
|
-
var name = getDestructuringPropertyName(access);
|
|
68061
|
-
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
68062
|
-
}
|
|
68063
|
-
if (ts.isParameter(access)) {
|
|
68064
|
-
return ("" + access.parent.parameters.indexOf(access));
|
|
68065
|
-
}
|
|
68066
|
-
return undefined;
|
|
68067
|
-
}
|
|
68068
|
-
function tryGetNameFromType(type) {
|
|
68069
|
-
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
68070
|
-
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
68071
|
-
}
|
|
68072
|
-
function tryGetElementAccessExpressionName(node) {
|
|
68073
|
-
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
68074
|
-
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
68075
|
-
}
|
|
68076
|
-
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
68077
|
-
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
68078
|
-
if (!symbol || !isConstVariable(symbol))
|
|
68079
|
-
return undefined;
|
|
68080
|
-
var declaration = symbol.valueDeclaration;
|
|
68081
|
-
if (declaration === undefined)
|
|
68082
|
-
return undefined;
|
|
68083
|
-
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
68084
|
-
if (type) {
|
|
68085
|
-
var name = tryGetNameFromType(type);
|
|
68086
|
-
if (name !== undefined) {
|
|
68087
|
-
return name;
|
|
68088
|
-
}
|
|
68089
|
-
}
|
|
68090
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
68091
|
-
var initializer = ts.getEffectiveInitializer(declaration);
|
|
68092
|
-
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
68093
|
-
}
|
|
68094
|
-
}
|
|
68095
|
-
return undefined;
|
|
68064
|
+
var propertyName;
|
|
68065
|
+
return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
|
|
68066
|
+
access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
68067
|
+
access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
68068
|
+
access.kind === 163 /* Parameter */ ? ("" + access.parent.parameters.indexOf(access)) :
|
|
68069
|
+
undefined;
|
|
68096
68070
|
}
|
|
68097
68071
|
function containsMatchingReference(source, target) {
|
|
68098
68072
|
while (ts.isAccessExpression(source)) {
|
|
@@ -72041,6 +72015,12 @@ var ts;
|
|
|
72041
72015
|
var elementTypes = [];
|
|
72042
72016
|
var elementFlags = [];
|
|
72043
72017
|
var contextualType = getApparentTypeOfContextualType(node);
|
|
72018
|
+
if (elementCount === 0 && contextualType && !checkMode) {
|
|
72019
|
+
var elementType = getElementTypeOfArrayType(contextualType);
|
|
72020
|
+
if (elementType) {
|
|
72021
|
+
return createArrayType(elementType);
|
|
72022
|
+
}
|
|
72023
|
+
}
|
|
72044
72024
|
var inDestructuringPattern = ts.isAssignmentTarget(node);
|
|
72045
72025
|
var inConstContext = isConstContext(node);
|
|
72046
72026
|
var hasOmittedExpression = false;
|
|
@@ -83010,7 +82990,7 @@ var ts;
|
|
|
83010
82990
|
}
|
|
83011
82991
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
83012
82992
|
var propName = member.name;
|
|
83013
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)
|
|
82993
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
83014
82994
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
83015
82995
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
83016
82996
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -83045,9 +83025,7 @@ var ts;
|
|
|
83045
83025
|
return false;
|
|
83046
83026
|
}
|
|
83047
83027
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
83048
|
-
var reference = ts.
|
|
83049
|
-
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
83050
|
-
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83028
|
+
var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83051
83029
|
ts.setParent(reference.expression, reference);
|
|
83052
83030
|
ts.setParent(reference, constructor);
|
|
83053
83031
|
reference.flowNode = constructor.returnFlowNode;
|
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220215";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -43039,7 +43039,16 @@ var ts;
|
|
|
43039
43039
|
// Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types"
|
|
43040
43040
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
43041
43041
|
// Don't do package.json lookup recursively, because Node.js' package lookup doesn't.
|
|
43042
|
-
|
|
43042
|
+
// Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions)
|
|
43043
|
+
// (technically it only emits a deprecation warning in esm packages right now, but that's probably
|
|
43044
|
+
// enough to mean we don't need to support it)
|
|
43045
|
+
var features = state.features;
|
|
43046
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
43047
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
43048
|
+
}
|
|
43049
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
|
|
43050
|
+
state.features = features;
|
|
43051
|
+
return result;
|
|
43043
43052
|
};
|
|
43044
43053
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
43045
43054
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -44386,7 +44395,7 @@ var ts;
|
|
|
44386
44395
|
return ts.isDottedName(expr)
|
|
44387
44396
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44388
44397
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44389
|
-
|| ts.isElementAccessExpression(expr) &&
|
|
44398
|
+
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44390
44399
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44391
44400
|
}
|
|
44392
44401
|
function containsNarrowableReference(expr) {
|
|
@@ -62530,7 +62539,10 @@ var ts;
|
|
|
62530
62539
|
case 204 /* ObjectLiteralExpression */:
|
|
62531
62540
|
return ts.some(node.properties, isContextSensitive);
|
|
62532
62541
|
case 203 /* ArrayLiteralExpression */:
|
|
62533
|
-
|
|
62542
|
+
if (node.elements.length > 0) {
|
|
62543
|
+
return ts.some(node.elements, isContextSensitive);
|
|
62544
|
+
}
|
|
62545
|
+
return true;
|
|
62534
62546
|
case 221 /* ConditionalExpression */:
|
|
62535
62547
|
return isContextSensitive(node.whenTrue) ||
|
|
62536
62548
|
isContextSensitive(node.whenFalse);
|
|
@@ -68036,9 +68048,8 @@ var ts;
|
|
|
68036
68048
|
return isMatchingReference(source.expression, target);
|
|
68037
68049
|
case 205 /* PropertyAccessExpression */:
|
|
68038
68050
|
case 206 /* ElementAccessExpression */:
|
|
68039
|
-
|
|
68040
|
-
|
|
68041
|
-
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
68051
|
+
return ts.isAccessExpression(target) &&
|
|
68052
|
+
getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
|
|
68042
68053
|
isMatchingReference(source.expression, target.expression);
|
|
68043
68054
|
case 160 /* QualifiedName */:
|
|
68044
68055
|
return ts.isAccessExpression(target) &&
|
|
@@ -68050,49 +68061,12 @@ var ts;
|
|
|
68050
68061
|
return false;
|
|
68051
68062
|
}
|
|
68052
68063
|
function getAccessedPropertyName(access) {
|
|
68053
|
-
|
|
68054
|
-
|
|
68055
|
-
|
|
68056
|
-
|
|
68057
|
-
|
|
68058
|
-
|
|
68059
|
-
if (ts.isBindingElement(access)) {
|
|
68060
|
-
var name = getDestructuringPropertyName(access);
|
|
68061
|
-
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
68062
|
-
}
|
|
68063
|
-
if (ts.isParameter(access)) {
|
|
68064
|
-
return ("" + access.parent.parameters.indexOf(access));
|
|
68065
|
-
}
|
|
68066
|
-
return undefined;
|
|
68067
|
-
}
|
|
68068
|
-
function tryGetNameFromType(type) {
|
|
68069
|
-
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
68070
|
-
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
68071
|
-
}
|
|
68072
|
-
function tryGetElementAccessExpressionName(node) {
|
|
68073
|
-
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
68074
|
-
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
68075
|
-
}
|
|
68076
|
-
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
68077
|
-
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
68078
|
-
if (!symbol || !isConstVariable(symbol))
|
|
68079
|
-
return undefined;
|
|
68080
|
-
var declaration = symbol.valueDeclaration;
|
|
68081
|
-
if (declaration === undefined)
|
|
68082
|
-
return undefined;
|
|
68083
|
-
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
68084
|
-
if (type) {
|
|
68085
|
-
var name = tryGetNameFromType(type);
|
|
68086
|
-
if (name !== undefined) {
|
|
68087
|
-
return name;
|
|
68088
|
-
}
|
|
68089
|
-
}
|
|
68090
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
68091
|
-
var initializer = ts.getEffectiveInitializer(declaration);
|
|
68092
|
-
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
68093
|
-
}
|
|
68094
|
-
}
|
|
68095
|
-
return undefined;
|
|
68064
|
+
var propertyName;
|
|
68065
|
+
return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
|
|
68066
|
+
access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
68067
|
+
access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
68068
|
+
access.kind === 163 /* Parameter */ ? ("" + access.parent.parameters.indexOf(access)) :
|
|
68069
|
+
undefined;
|
|
68096
68070
|
}
|
|
68097
68071
|
function containsMatchingReference(source, target) {
|
|
68098
68072
|
while (ts.isAccessExpression(source)) {
|
|
@@ -72041,6 +72015,12 @@ var ts;
|
|
|
72041
72015
|
var elementTypes = [];
|
|
72042
72016
|
var elementFlags = [];
|
|
72043
72017
|
var contextualType = getApparentTypeOfContextualType(node);
|
|
72018
|
+
if (elementCount === 0 && contextualType && !checkMode) {
|
|
72019
|
+
var elementType = getElementTypeOfArrayType(contextualType);
|
|
72020
|
+
if (elementType) {
|
|
72021
|
+
return createArrayType(elementType);
|
|
72022
|
+
}
|
|
72023
|
+
}
|
|
72044
72024
|
var inDestructuringPattern = ts.isAssignmentTarget(node);
|
|
72045
72025
|
var inConstContext = isConstContext(node);
|
|
72046
72026
|
var hasOmittedExpression = false;
|
|
@@ -83010,7 +82990,7 @@ var ts;
|
|
|
83010
82990
|
}
|
|
83011
82991
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
83012
82992
|
var propName = member.name;
|
|
83013
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)
|
|
82993
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
83014
82994
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
83015
82995
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
83016
82996
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -83045,9 +83025,7 @@ var ts;
|
|
|
83045
83025
|
return false;
|
|
83046
83026
|
}
|
|
83047
83027
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
83048
|
-
var reference = ts.
|
|
83049
|
-
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
83050
|
-
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83028
|
+
var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83051
83029
|
ts.setParent(reference.expression, reference);
|
|
83052
83030
|
ts.setParent(reference, constructor);
|
|
83053
83031
|
reference.flowNode = constructor.returnFlowNode;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220215";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -42834,7 +42834,16 @@ var ts;
|
|
|
42834
42834
|
// Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types"
|
|
42835
42835
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
42836
42836
|
// Don't do package.json lookup recursively, because Node.js' package lookup doesn't.
|
|
42837
|
-
|
|
42837
|
+
// Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions)
|
|
42838
|
+
// (technically it only emits a deprecation warning in esm packages right now, but that's probably
|
|
42839
|
+
// enough to mean we don't need to support it)
|
|
42840
|
+
var features = state.features;
|
|
42841
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
42842
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
42843
|
+
}
|
|
42844
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
|
|
42845
|
+
state.features = features;
|
|
42846
|
+
return result;
|
|
42838
42847
|
};
|
|
42839
42848
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
42840
42849
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -44181,7 +44190,7 @@ var ts;
|
|
|
44181
44190
|
return ts.isDottedName(expr)
|
|
44182
44191
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44183
44192
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44184
|
-
|| ts.isElementAccessExpression(expr) &&
|
|
44193
|
+
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44185
44194
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44186
44195
|
}
|
|
44187
44196
|
function containsNarrowableReference(expr) {
|
|
@@ -62325,7 +62334,10 @@ var ts;
|
|
|
62325
62334
|
case 204 /* ObjectLiteralExpression */:
|
|
62326
62335
|
return ts.some(node.properties, isContextSensitive);
|
|
62327
62336
|
case 203 /* ArrayLiteralExpression */:
|
|
62328
|
-
|
|
62337
|
+
if (node.elements.length > 0) {
|
|
62338
|
+
return ts.some(node.elements, isContextSensitive);
|
|
62339
|
+
}
|
|
62340
|
+
return true;
|
|
62329
62341
|
case 221 /* ConditionalExpression */:
|
|
62330
62342
|
return isContextSensitive(node.whenTrue) ||
|
|
62331
62343
|
isContextSensitive(node.whenFalse);
|
|
@@ -67831,9 +67843,8 @@ var ts;
|
|
|
67831
67843
|
return isMatchingReference(source.expression, target);
|
|
67832
67844
|
case 205 /* PropertyAccessExpression */:
|
|
67833
67845
|
case 206 /* ElementAccessExpression */:
|
|
67834
|
-
|
|
67835
|
-
|
|
67836
|
-
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
67846
|
+
return ts.isAccessExpression(target) &&
|
|
67847
|
+
getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
|
|
67837
67848
|
isMatchingReference(source.expression, target.expression);
|
|
67838
67849
|
case 160 /* QualifiedName */:
|
|
67839
67850
|
return ts.isAccessExpression(target) &&
|
|
@@ -67845,49 +67856,12 @@ var ts;
|
|
|
67845
67856
|
return false;
|
|
67846
67857
|
}
|
|
67847
67858
|
function getAccessedPropertyName(access) {
|
|
67848
|
-
|
|
67849
|
-
|
|
67850
|
-
|
|
67851
|
-
|
|
67852
|
-
|
|
67853
|
-
|
|
67854
|
-
if (ts.isBindingElement(access)) {
|
|
67855
|
-
var name = getDestructuringPropertyName(access);
|
|
67856
|
-
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
67857
|
-
}
|
|
67858
|
-
if (ts.isParameter(access)) {
|
|
67859
|
-
return ("" + access.parent.parameters.indexOf(access));
|
|
67860
|
-
}
|
|
67861
|
-
return undefined;
|
|
67862
|
-
}
|
|
67863
|
-
function tryGetNameFromType(type) {
|
|
67864
|
-
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
67865
|
-
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
67866
|
-
}
|
|
67867
|
-
function tryGetElementAccessExpressionName(node) {
|
|
67868
|
-
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
67869
|
-
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
67870
|
-
}
|
|
67871
|
-
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
67872
|
-
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
67873
|
-
if (!symbol || !isConstVariable(symbol))
|
|
67874
|
-
return undefined;
|
|
67875
|
-
var declaration = symbol.valueDeclaration;
|
|
67876
|
-
if (declaration === undefined)
|
|
67877
|
-
return undefined;
|
|
67878
|
-
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
67879
|
-
if (type) {
|
|
67880
|
-
var name = tryGetNameFromType(type);
|
|
67881
|
-
if (name !== undefined) {
|
|
67882
|
-
return name;
|
|
67883
|
-
}
|
|
67884
|
-
}
|
|
67885
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
67886
|
-
var initializer = ts.getEffectiveInitializer(declaration);
|
|
67887
|
-
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
67888
|
-
}
|
|
67889
|
-
}
|
|
67890
|
-
return undefined;
|
|
67859
|
+
var propertyName;
|
|
67860
|
+
return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
|
|
67861
|
+
access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
67862
|
+
access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
67863
|
+
access.kind === 163 /* Parameter */ ? ("" + access.parent.parameters.indexOf(access)) :
|
|
67864
|
+
undefined;
|
|
67891
67865
|
}
|
|
67892
67866
|
function containsMatchingReference(source, target) {
|
|
67893
67867
|
while (ts.isAccessExpression(source)) {
|
|
@@ -71836,6 +71810,12 @@ var ts;
|
|
|
71836
71810
|
var elementTypes = [];
|
|
71837
71811
|
var elementFlags = [];
|
|
71838
71812
|
var contextualType = getApparentTypeOfContextualType(node);
|
|
71813
|
+
if (elementCount === 0 && contextualType && !checkMode) {
|
|
71814
|
+
var elementType = getElementTypeOfArrayType(contextualType);
|
|
71815
|
+
if (elementType) {
|
|
71816
|
+
return createArrayType(elementType);
|
|
71817
|
+
}
|
|
71818
|
+
}
|
|
71839
71819
|
var inDestructuringPattern = ts.isAssignmentTarget(node);
|
|
71840
71820
|
var inConstContext = isConstContext(node);
|
|
71841
71821
|
var hasOmittedExpression = false;
|
|
@@ -82805,7 +82785,7 @@ var ts;
|
|
|
82805
82785
|
}
|
|
82806
82786
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
82807
82787
|
var propName = member.name;
|
|
82808
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)
|
|
82788
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
82809
82789
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
82810
82790
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
82811
82791
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -82840,9 +82820,7 @@ var ts;
|
|
|
82840
82820
|
return false;
|
|
82841
82821
|
}
|
|
82842
82822
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
82843
|
-
var reference = ts.
|
|
82844
|
-
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
82845
|
-
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
82823
|
+
var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
82846
82824
|
ts.setParent(reference.expression, reference);
|
|
82847
82825
|
ts.setParent(reference, constructor);
|
|
82848
82826
|
reference.flowNode = constructor.returnFlowNode;
|
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": "4.7.0-pr-
|
|
5
|
+
"version": "4.7.0-pr-47898-11",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|