vanzy-protect
Version:
Epic Obfuscator Yeahhh
31 lines (30 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.drawClass = void 0;
const cfg_1 = require("../config/cfg");
const comment_1 = require("../obfuscate/comment");
const obfuscateName_1 = require("../obfuscate/obfuscateName");
const methodDefinition_1 = require("./methodDefinition");
const propertyDefinition_1 = require("./propertyDefinition");
function drawClass(expr) {
var data = 'class';
data += (0, comment_1.comment)(1) + ' ';
if ((0, cfg_1.cfg)().transforms.obfuscateNames) {
data += (0, obfuscateName_1.obfuscateName)(expr.id.name);
}
else {
data += expr.id.name;
}
data += '{' + (0, comment_1.comment)(2);
expr.body.body.forEach((i) => {
if (i.type === 'PropertyDefinition') {
data += (0, propertyDefinition_1.propertyDefinition)(i) + ';\n';
}
else if (i.type === 'MethodDefinition') {
data += (0, methodDefinition_1.methodDefinition)(i) + ';\n';
}
});
data += '}' + (0, comment_1.comment)(1);
return data;
}
exports.drawClass = drawClass;