Hookyns/tst-expression

Support for ArrayLiteralExpressions

avin-kavish opened this issue · 2 comments

Looks like it's missing the node type, and guard.

Here's a quick hack I wrote for that,

interface ArrayLiteralNode extends ExpressionNode {
  kind: tst.ExpressionKind.ArrayLiteralExpression
  elements: ExpressionNode[]
  multiLine: boolean
}

export function isArrayLiteral(
  node: ExpressionNode,
): node is ArrayLiteralNode {
  return node.kind === tst.ExpressionKind.ArrayLiteralExpression
}

Published tst-expression-transformer@1.2.2 and tst-expression@2.1.3.

BTW: Module changed from UMD to CommonJS, so it works with CommonJS and NodeNext modules.