Created
May 30, 2019 06:56
First version of our transform, which looks at each node and does nothing!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies: | |
import { Node, visitNode, SourceFile, TransformationContext, Transformer, TransformerFactory } from 'typescript'; | |
export function transformer (source: SourceFile): TransformerFactory<Node> { | |
return function (context: TransformationContext): Transformer<Node> { | |
return function (node: Node): Node { | |
return visitNode(node, visit); | |
}; | |
function visit (node: Node): Node | Array<Node> { | |
node = visitEachChild(node, visit, context); | |
return node; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment