-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch tsutils so it's compatible with TypeScript 5.2
- Loading branch information
1 parent
6a03f1d
commit e21e401
Showing
3 changed files
with
141 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/node_modules/tsutils/util/usage.js b/node_modules/tsutils/util/usage.js | ||
index fa24e64..9818b0a 100644 | ||
--- a/node_modules/tsutils/util/usage.js | ||
+++ b/node_modules/tsutils/util/usage.js | ||
@@ -25,7 +25,7 @@ function getUsageDomain(node) { | ||
const parent = node.parent; | ||
switch (parent.kind) { | ||
case ts.SyntaxKind.TypeReference: | ||
- return node.originalKeywordKind !== ts.SyntaxKind.ConstKeyword ? 2 /* Type */ : undefined; | ||
+ return ts.identifierToKeywordKind(node) !== ts.SyntaxKind.ConstKeyword ? 2 /* Type */ : undefined; | ||
case ts.SyntaxKind.ExpressionWithTypeArguments: | ||
return parent.parent.token === ts.SyntaxKind.ImplementsKeyword || | ||
parent.parent.parent.kind === ts.SyntaxKind.InterfaceDeclaration | ||
@@ -116,7 +116,7 @@ function getDeclarationDomain(node) { | ||
case ts.SyntaxKind.ModuleDeclaration: | ||
return 1 /* Namespace */; | ||
case ts.SyntaxKind.Parameter: | ||
- if (node.parent.parent.kind === ts.SyntaxKind.IndexSignature || node.originalKeywordKind === ts.SyntaxKind.ThisKeyword) | ||
+ if (node.parent.parent.kind === ts.SyntaxKind.IndexSignature || ts.identifierToKeywordKind(node) === ts.SyntaxKind.ThisKeyword) | ||
return; | ||
// falls through | ||
case ts.SyntaxKind.BindingElement: | ||
@@ -525,7 +525,7 @@ class UsageWalker { | ||
case ts.SyntaxKind.Parameter: | ||
if (node.parent.kind !== ts.SyntaxKind.IndexSignature && | ||
(node.name.kind !== ts.SyntaxKind.Identifier || | ||
- node.name.originalKeywordKind !== ts.SyntaxKind.ThisKeyword)) | ||
+ ts.identifierToKeywordKind(node.name) !== ts.SyntaxKind.ThisKeyword)) | ||
this._handleBindingName(node.name, false, false); | ||
break; | ||
case ts.SyntaxKind.EnumMember: | ||
diff --git a/node_modules/tsutils/util/util.js b/node_modules/tsutils/util/util.js | ||
index 0109fea..81aa517 100644 | ||
--- a/node_modules/tsutils/util/util.js | ||
+++ b/node_modules/tsutils/util/util.js | ||
@@ -37,7 +37,7 @@ function isKeywordKind(kind) { | ||
} | ||
exports.isKeywordKind = isKeywordKind; | ||
function isThisParameter(parameter) { | ||
- return parameter.name.kind === ts.SyntaxKind.Identifier && parameter.name.originalKeywordKind === ts.SyntaxKind.ThisKeyword; | ||
+ return parameter.name.kind === ts.SyntaxKind.Identifier && ts.identifierToKeywordKind(parameter.name) === ts.SyntaxKind.ThisKeyword; | ||
} | ||
exports.isThisParameter = isThisParameter; | ||
function getModifier(node, kind) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters