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

This commit is contained in:
Andy authored and GitHub committed 2018-02-12 14:42:16 -08:00
1 parent d07523e9e5
commit 74f01abfcf
4 files changed
+35 -29

No files matched your search

+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;