ts-transform-visitor
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

TS Transform Visitor

A TypeScript utility function to easily create transformers using the visitor pattern.

How to use

import transform from "ts-transform-visitor";
import ts from "typescript";

export default transform("program", function(node) {
  if (ts.isDecorator(node)) return null;
});

The visit function can return either a node, an array of nodes or null to remove the current node. Returning nothing or undefined visits the children nodes.

Readme

Keywords

none

Package Sidebar

Install

npm i ts-transform-visitor

Weekly Downloads

3

Version

1.0.4

License

MIT

Unpacked Size

20.6 kB

Total Files

9

Last publish

Collaborators

  • dragoteryx