Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private processAST(ast: any) {
switch(ast.type) {
case AST_NODE_TYPES.ClassDeclaration:
this.processClassDeclaration(ast as ClassDeclaration);
break;
case AST_NODE_TYPES.TSEnumDeclaration:
this.processTSEnumDeclaration(ast as TSEnumDeclaration);
break;
case AST_NODE_TYPES.ExportNamedDeclaration:
this.processExportNamedDeclaration(ast as ExportNamedDeclaration);
break;
case AST_NODE_TYPES.TSModuleBlock:
this.processTSModuleBlock(ast as TSModuleBlock);
break;
case AST_NODE_TYPES.TSModuleDeclaration:
this.processTSModuleDeclaration(ast as TSModuleDeclaration);
break;
default:
break;
}
}
private processTSModuleDeclaration(ast: TSModuleDeclaration) {
this.moduleName = this.getId(ast.id);
let info: TsModuleInfo = { type: AST_NODE_TYPES.TSModuleDeclaration, name: this.moduleName, properties: {}, funcs: {}, classes: {} };
this.moduleMap[this.moduleName] = info;
this.processAST(ast.body);
this.moduleName = '';
}