Skip to content

Commit b7432d1

Browse files
committed
rename util function
1 parent a99c37e commit b7432d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/compiler/checker.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13505,7 +13505,7 @@ namespace ts {
1350513505
if (type.flags & TypeFlags.Any) {
1350613506
return type;
1350713507
}
13508-
if (isExclamationEqualsOrExclamationEqualsEqualsKind(operator)) {
13508+
if (isNegatedEqualityToken(operator)) {
1350913509
assumeTrue = !assumeTrue;
1351013510
}
1351113511
const valueType = getTypeOfExpression(value);
@@ -13536,7 +13536,7 @@ namespace ts {
1353613536
}
1353713537

1353813538
function narrowTypeByConstructor(type: Type, expr: Expression, operator: SyntaxKind, assumeTrue: boolean): Type {
13539-
if (!assumeTrue || isExclamationEqualsOrExclamationEqualsEqualsKind(operator)) return type;
13539+
if (!assumeTrue || isNegatedEqualityToken(operator)) return type;
1354013540

1354113541
const rightType = getTypeOfExpression(expr);
1354213542
if (!isTypeSubtypeOf(rightType, globalFunctionType)) return type;
@@ -13566,7 +13566,7 @@ namespace ts {
1356613566
}
1356713567
return type;
1356813568
}
13569-
if (isExclamationEqualsOrExclamationEqualsEqualsKind(operator)) {
13569+
if (isNegatedEqualityToken(operator)) {
1357013570
assumeTrue = !assumeTrue;
1357113571
}
1357213572
if (assumeTrue && !(type.flags & TypeFlags.Union)) {

src/compiler/utilities.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6337,7 +6337,7 @@ namespace ts {
63376337
}
63386338

63396339
/** @internal */
6340-
export function isExclamationEqualsOrExclamationEqualsEqualsKind(kind: SyntaxKind): boolean {
6340+
export function isNegatedEqualityToken(kind: SyntaxKind): boolean {
63416341
return kind === SyntaxKind.ExclamationEqualsToken || kind === SyntaxKind.ExclamationEqualsEqualsToken;
63426342
}
63436343
}

0 commit comments

Comments
 (0)