Clean up findPrecedingToken and avoid returning whitespace-only jsx text token (#21903)

This commit is contained in:
Andy
2018-02-12 14:42:16 -08:00
committed by GitHub
parent d07523e9e5
commit 74f01abfcf
4 changed files with 35 additions and 29 deletions
+1
View File
@@ -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;