@@ -42,7 +42,7 @@ function extractFunctionCalls(node: ts.Node, sourceFile: ts.SourceFile, indentLe
4242 }
4343 }
4444
45- // logThings (node, sourceFile, indentLevel);
45+ // logNode (node, sourceFile, indentLevel);
4646
4747 node . forEachChild ( child => extractFunctionCalls ( child , sourceFile , indentLevel + 1 ) ) ;
4848}
@@ -53,14 +53,13 @@ function extractFunctionCalls(node: ts.Node, sourceFile: ts.SourceFile, indentLe
5353 * @param sourceFile
5454 * @param indentLevel
5555 */
56- function logThings ( node : ts . Node , sourceFile : ts . SourceFile , indentLevel : number ) {
56+ function logNode ( node : ts . Node , sourceFile : ts . SourceFile , indentLevel : number ) {
5757 const indentation = "-" . repeat ( indentLevel ) ;
5858 const syntaxKind = ts . SyntaxKind [ node . kind ] ;
5959 const nodeText = node . getText ( sourceFile ) . split ( '\n' ) [ 0 ] ;
6060 console . log ( `${ indentation } ${ syntaxKind } : ${ nodeText } ` ) ;
6161}
6262
63-
6463/**
6564 * Update `allFunctions` and `currentFunction`
6665 * @param declaredFunction
@@ -87,14 +86,13 @@ function updateCalledFunctions(calledFunction: string): void {
8786 }
8887}
8988
90-
9189export function processFiles ( filenames : string [ ] ) {
9290
9391 // =================================================================================================
9492 // instead of: extractFunctionCalls(sourceFile, 0, sourceFile);
9593 // grab all the root nodes first
9694 // then do recursion for each
97- filenames . filter ( file => file . endsWith ( 'ts' ) ) . forEach ( ( filename ) => {
95+ filenames . forEach ( ( filename ) => {
9896
9997 const rootNodes : ts . Node [ ] = [ ] ;
10098
0 commit comments