I've been trying to mimic the example provided in the TypeScript wiki on Using the Type Checker but I'm having trouble detecting arrow functions.
For instance:
/**
* Hello
*/
export const hello = (): string => 'hello';
My visitor doesn't recognize this as an arrow function:
function visit(node: ts.Node) {
console.log(node.kind, ts.isArrowFunction(node)); // -> 236, false
However, standard functions are being correctly identified:
For example:
/**
* Hello
*/
export function hello (): string {return 'hello'};
This is recognized by the visitor using isFunctionDeclaration
function visit(node: ts.Node) {
console.log(node.kind, ts.isFunctionDeclaration(node)); // -> 255, true
What am I missing here? How can I successfully detect arrow functions?