Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
TsCollector.prototype.processTSModuleBlock = function (ast) {
for (var _i = 0, _a = ast.body; _i < _a.length; _i++) {
var stt = _a[_i];
this.processAST(stt);
if (stt.type == ast_node_types_1.AST_NODE_TYPES.ExportNamedDeclaration && stt.declaration.type == ast_node_types_1.AST_NODE_TYPES.FunctionDeclaration) {
var funcName = stt.declaration.id.name;
this.moduleMap[this.moduleName].funcs[funcName] = 1;
}
}
};
TsCollector.prototype.processTSModuleDeclaration = function (ast) {
TsCollector.prototype.processClassDeclaration = function (ast) {
var info = { type: ast_node_types_1.AST_NODE_TYPES.ClassDeclaration, name: ast.id.name, properties: {}, funcs: {} };
for (var _i = 0, _a = ast.body.body; _i < _a.length; _i++) {
var cbb = _a[_i];
if (cbb.type == ast_node_types_1.AST_NODE_TYPES.ClassProperty) {
var cp = cbb;
var cpInfo = { type: ast_node_types_1.AST_NODE_TYPES.ClassProperty, name: cp.key.name, isStatic: cp.static, varType: cp.typeAnnotation };
info.properties[cpInfo.name] = cpInfo;
}
else if (cbb.type == ast_node_types_1.AST_NODE_TYPES.MethodDefinition) {
var md = cbb;
var mdInfo = { type: ast_node_types_1.AST_NODE_TYPES.MethodDefinition, name: md.key.name, isStatic: md.static, returnType: md.value.returnType };
info.funcs[mdInfo.name] = mdInfo;
}
}
this.classMap[ast.id.name] = info;
if (this.moduleName) {
this.classMap[this.moduleName + '.' + ast.id.name] = info;
this.moduleMap[this.moduleName].classes[ast.id.name] = info;
}
};