Skip to content

Instantly share code, notes, and snippets.

@longlho
Created March 31, 2019 19:49
Show Gist options
  • Save longlho/42aebf74021676dcc14201cc902f8d3c to your computer and use it in GitHub Desktop.
Save longlho/42aebf74021676dcc14201cc902f8d3c to your computer and use it in GitHub Desktop.
transformer-p2
const visitor: ts.Visitor = (node: ts.Node): ts.Node => {
if (ts.isImportDeclaration(node) && node.moduleSpecifier) {
const newNode = ts.getMutableClone(node) // Clone the node
}
return ts.visitEachChild(node, visitor)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment