compileCode(code, fakePath) | Compiles a code string to typescript AST |
compileFile(sourceFilePath) | Compiles a single file to typescript AST |
findAllNodes(source, predicate) | Finds all nodes satisfying the predicate |
findNode(source, predicate) | Finds the first node (via DFS) satisfying the predicate |
findNodeAfterComment(node, comment) | Finds all nodes following a comment |
getLeadingComments(node) | A more regorges ts.getLeadingCommentRanges: Finds mid - statement comments as well |
getTsConfigCompilerOptions(tsConfigJsonPath) | Calculates the effective tsconfig compiler options |
isSame(a, b, ignore) | Compared 2 code snippet (or ASTs) |
match(code, pattern) | Finds a node matching the pattern. The pattern is a valid TS statement It may include: - //[ignore] to skip some of its structure, - //[return] to return an inner node instead of the root |