import * as ts from 'typescript' ; /**
 * TypeScript 2.0 will have more features to support type guard.
 * https://www.typescriptlang.org/docs/handbook/advanced-types.html
 * We could avoid 'as' cast if switching to 2.0
 */ export function isJsxAttribute ( node ) { return node && node . kind === ts . SyntaxKind . JsxAttribute ; } export function isJsxSpreadAttribute ( node ) { return node && node . kind === ts . SyntaxKind . JsxSpreadAttribute ; } export function isJsxExpression ( node ) { return node && node . kind === ts . SyntaxKind . JsxExpression ; } /**
 * There is no type of NumericLiteral in typescript, guarded as LiteralExpression.
 */ export function isNumericLiteral ( node ) { return node && node . kind === ts . SyntaxKind . NumericLiteral ; } export function isStringLiteral ( node ) { return node && node . kind === ts . SyntaxKind . StringLiteral ; } export function isJsxElement ( node ) { return node && node . kind === ts . SyntaxKind . JsxElement ; } export function isJsxSelfClosingElement ( node ) { return node && node . kind === ts . SyntaxKind . JsxSelfClosingElement ; } export function isJsxOpeningElement ( node ) { return node && node . kind === ts . SyntaxKind . JsxOpeningElement ; } export function isTrueKeyword ( node ) { return node && node . kind === ts . SyntaxKind . TrueKeyword ; } export function isFalseKeyword ( node ) { return node && node . kind === ts . SyntaxKind . FalseKeyword ; } export function isNullKeyword ( node ) { return node && node . kind === ts . SyntaxKind . NullKeyword ; }