mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Clean up findPrecedingToken and avoid returning whitespace-only jsx text token (#21903)
This commit is contained in:
@@ -5153,6 +5153,7 @@ namespace ts {
|
||||
/**
|
||||
* True if node is of some token syntax kind.
|
||||
* For example, this is true for an IfKeyword but not for an IfStatement.
|
||||
* Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
|
||||
*/
|
||||
export function isToken(n: Node): boolean {
|
||||
return n.kind >= SyntaxKind.FirstToken && n.kind <= SyntaxKind.LastToken;
|
||||
|
||||
Reference in New Issue
Block a user