@typescript-deploys/pr-build 5.1.0-pr-53903-8 → 5.1.0-pr-53714-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 +11 -2
- package/lib/tsserver.js +11 -2
- package/lib/tsserverlibrary.js +11 -2
- package/lib/typescript.js +11 -2
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -39469,7 +39469,7 @@ function createBinder() {
|
|
|
39469
39469
|
case 36 /* ExclamationEqualsToken */:
|
|
39470
39470
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
39471
39471
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
39472
|
-
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
|
|
39472
|
+
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
|
|
39473
39473
|
case 104 /* InstanceOfKeyword */:
|
|
39474
39474
|
return isNarrowableOperand(expr.left);
|
|
39475
39475
|
case 103 /* InKeyword */:
|
|
@@ -65108,6 +65108,10 @@ function createTypeChecker(host) {
|
|
|
65108
65108
|
}
|
|
65109
65109
|
return type;
|
|
65110
65110
|
}
|
|
65111
|
+
function narrowTypeByBooleanComparison(type, expr, bool, operator, assumeTrue) {
|
|
65112
|
+
assumeTrue = assumeTrue !== (bool.kind === 112 /* TrueKeyword */) !== (operator !== 38 /* ExclamationEqualsEqualsToken */ && operator !== 36 /* ExclamationEqualsToken */);
|
|
65113
|
+
return narrowType(type, expr, assumeTrue);
|
|
65114
|
+
}
|
|
65111
65115
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
65112
65116
|
switch (expr.operatorToken.kind) {
|
|
65113
65117
|
case 64 /* EqualsToken */:
|
|
@@ -65155,6 +65159,12 @@ function createTypeChecker(host) {
|
|
|
65155
65159
|
if (isMatchingConstructorReference(right)) {
|
|
65156
65160
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
65157
65161
|
}
|
|
65162
|
+
if (isBooleanLiteral(right)) {
|
|
65163
|
+
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
65164
|
+
}
|
|
65165
|
+
if (isBooleanLiteral(left)) {
|
|
65166
|
+
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
65167
|
+
}
|
|
65158
65168
|
break;
|
|
65159
65169
|
case 104 /* InstanceOfKeyword */:
|
|
65160
65170
|
return narrowTypeByInstanceof(type, expr, assumeTrue);
|
|
@@ -66937,7 +66947,6 @@ function createTypeChecker(host) {
|
|
|
66937
66947
|
case 9 /* NumericLiteral */:
|
|
66938
66948
|
case 10 /* BigIntLiteral */:
|
|
66939
66949
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
66940
|
-
case 227 /* TemplateExpression */:
|
|
66941
66950
|
case 112 /* TrueKeyword */:
|
|
66942
66951
|
case 97 /* FalseKeyword */:
|
|
66943
66952
|
case 106 /* NullKeyword */:
|
package/lib/tsserver.js
CHANGED
|
@@ -44075,7 +44075,7 @@ function createBinder() {
|
|
|
44075
44075
|
case 36 /* ExclamationEqualsToken */:
|
|
44076
44076
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
44077
44077
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
44078
|
-
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
|
|
44078
|
+
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
|
|
44079
44079
|
case 104 /* InstanceOfKeyword */:
|
|
44080
44080
|
return isNarrowableOperand(expr.left);
|
|
44081
44081
|
case 103 /* InKeyword */:
|
|
@@ -69762,6 +69762,10 @@ function createTypeChecker(host) {
|
|
|
69762
69762
|
}
|
|
69763
69763
|
return type;
|
|
69764
69764
|
}
|
|
69765
|
+
function narrowTypeByBooleanComparison(type, expr, bool, operator, assumeTrue) {
|
|
69766
|
+
assumeTrue = assumeTrue !== (bool.kind === 112 /* TrueKeyword */) !== (operator !== 38 /* ExclamationEqualsEqualsToken */ && operator !== 36 /* ExclamationEqualsToken */);
|
|
69767
|
+
return narrowType(type, expr, assumeTrue);
|
|
69768
|
+
}
|
|
69765
69769
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
69766
69770
|
switch (expr.operatorToken.kind) {
|
|
69767
69771
|
case 64 /* EqualsToken */:
|
|
@@ -69809,6 +69813,12 @@ function createTypeChecker(host) {
|
|
|
69809
69813
|
if (isMatchingConstructorReference(right)) {
|
|
69810
69814
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
69811
69815
|
}
|
|
69816
|
+
if (isBooleanLiteral(right)) {
|
|
69817
|
+
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
69818
|
+
}
|
|
69819
|
+
if (isBooleanLiteral(left)) {
|
|
69820
|
+
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
69821
|
+
}
|
|
69812
69822
|
break;
|
|
69813
69823
|
case 104 /* InstanceOfKeyword */:
|
|
69814
69824
|
return narrowTypeByInstanceof(type, expr, assumeTrue);
|
|
@@ -71591,7 +71601,6 @@ function createTypeChecker(host) {
|
|
|
71591
71601
|
case 9 /* NumericLiteral */:
|
|
71592
71602
|
case 10 /* BigIntLiteral */:
|
|
71593
71603
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
71594
|
-
case 227 /* TemplateExpression */:
|
|
71595
71604
|
case 112 /* TrueKeyword */:
|
|
71596
71605
|
case 97 /* FalseKeyword */:
|
|
71597
71606
|
case 106 /* NullKeyword */:
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -41961,7 +41961,7 @@ ${lanes.join("\n")}
|
|
|
41961
41961
|
case 36 /* ExclamationEqualsToken */:
|
|
41962
41962
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
41963
41963
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
41964
|
-
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
|
|
41964
|
+
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
|
|
41965
41965
|
case 104 /* InstanceOfKeyword */:
|
|
41966
41966
|
return isNarrowableOperand(expr.left);
|
|
41967
41967
|
case 103 /* InKeyword */:
|
|
@@ -67556,6 +67556,10 @@ ${lanes.join("\n")}
|
|
|
67556
67556
|
}
|
|
67557
67557
|
return type;
|
|
67558
67558
|
}
|
|
67559
|
+
function narrowTypeByBooleanComparison(type, expr, bool, operator, assumeTrue) {
|
|
67560
|
+
assumeTrue = assumeTrue !== (bool.kind === 112 /* TrueKeyword */) !== (operator !== 38 /* ExclamationEqualsEqualsToken */ && operator !== 36 /* ExclamationEqualsToken */);
|
|
67561
|
+
return narrowType(type, expr, assumeTrue);
|
|
67562
|
+
}
|
|
67559
67563
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
67560
67564
|
switch (expr.operatorToken.kind) {
|
|
67561
67565
|
case 64 /* EqualsToken */:
|
|
@@ -67603,6 +67607,12 @@ ${lanes.join("\n")}
|
|
|
67603
67607
|
if (isMatchingConstructorReference(right)) {
|
|
67604
67608
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
67605
67609
|
}
|
|
67610
|
+
if (isBooleanLiteral(right)) {
|
|
67611
|
+
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
67612
|
+
}
|
|
67613
|
+
if (isBooleanLiteral(left)) {
|
|
67614
|
+
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
67615
|
+
}
|
|
67606
67616
|
break;
|
|
67607
67617
|
case 104 /* InstanceOfKeyword */:
|
|
67608
67618
|
return narrowTypeByInstanceof(type, expr, assumeTrue);
|
|
@@ -69385,7 +69395,6 @@ ${lanes.join("\n")}
|
|
|
69385
69395
|
case 9 /* NumericLiteral */:
|
|
69386
69396
|
case 10 /* BigIntLiteral */:
|
|
69387
69397
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
69388
|
-
case 227 /* TemplateExpression */:
|
|
69389
69398
|
case 112 /* TrueKeyword */:
|
|
69390
69399
|
case 97 /* FalseKeyword */:
|
|
69391
69400
|
case 106 /* NullKeyword */:
|
package/lib/typescript.js
CHANGED
|
@@ -41961,7 +41961,7 @@ ${lanes.join("\n")}
|
|
|
41961
41961
|
case 36 /* ExclamationEqualsToken */:
|
|
41962
41962
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
41963
41963
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
41964
|
-
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
|
|
41964
|
+
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
|
|
41965
41965
|
case 104 /* InstanceOfKeyword */:
|
|
41966
41966
|
return isNarrowableOperand(expr.left);
|
|
41967
41967
|
case 103 /* InKeyword */:
|
|
@@ -67556,6 +67556,10 @@ ${lanes.join("\n")}
|
|
|
67556
67556
|
}
|
|
67557
67557
|
return type;
|
|
67558
67558
|
}
|
|
67559
|
+
function narrowTypeByBooleanComparison(type, expr, bool, operator, assumeTrue) {
|
|
67560
|
+
assumeTrue = assumeTrue !== (bool.kind === 112 /* TrueKeyword */) !== (operator !== 38 /* ExclamationEqualsEqualsToken */ && operator !== 36 /* ExclamationEqualsToken */);
|
|
67561
|
+
return narrowType(type, expr, assumeTrue);
|
|
67562
|
+
}
|
|
67559
67563
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
67560
67564
|
switch (expr.operatorToken.kind) {
|
|
67561
67565
|
case 64 /* EqualsToken */:
|
|
@@ -67603,6 +67607,12 @@ ${lanes.join("\n")}
|
|
|
67603
67607
|
if (isMatchingConstructorReference(right)) {
|
|
67604
67608
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
67605
67609
|
}
|
|
67610
|
+
if (isBooleanLiteral(right)) {
|
|
67611
|
+
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
67612
|
+
}
|
|
67613
|
+
if (isBooleanLiteral(left)) {
|
|
67614
|
+
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
67615
|
+
}
|
|
67606
67616
|
break;
|
|
67607
67617
|
case 104 /* InstanceOfKeyword */:
|
|
67608
67618
|
return narrowTypeByInstanceof(type, expr, assumeTrue);
|
|
@@ -69385,7 +69395,6 @@ ${lanes.join("\n")}
|
|
|
69385
69395
|
case 9 /* NumericLiteral */:
|
|
69386
69396
|
case 10 /* BigIntLiteral */:
|
|
69387
69397
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
69388
|
-
case 227 /* TemplateExpression */:
|
|
69389
69398
|
case 112 /* TrueKeyword */:
|
|
69390
69399
|
case 97 /* FalseKeyword */:
|
|
69391
69400
|
case 106 /* NullKeyword */:
|
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.1.0-pr-
|
|
5
|
+
"version": "5.1.0-pr-53714-11",
|
|
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": "14.21.1",
|
|
115
115
|
"npm": "8.19.3"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "34a21d67a3b3359e5f84aef3f69b657639a2b572"
|
|
118
118
|
}
|