|
@@ -1009,7 +1009,7 @@ var OptionsNormalizer = function () {
|
|
|
}
|
|
|
|
|
|
_createClass(OptionsNormalizer, null, [{
|
|
|
- key: 'normalizeOptionsPreset',
|
|
|
+ key: "normalizeOptionsPreset",
|
|
|
value: function normalizeOptionsPreset(options) {
|
|
|
var normalizedOptions = Object.assign({}, options);
|
|
|
normalizedOptions = OptionsNormalizer.unicodeArrayRule(normalizedOptions);
|
|
@@ -1018,27 +1018,27 @@ var OptionsNormalizer = function () {
|
|
|
return normalizedOptions;
|
|
|
}
|
|
|
}, {
|
|
|
- key: 'selfDefendingRule',
|
|
|
+ key: "selfDefendingRule",
|
|
|
value: function selfDefendingRule(options) {
|
|
|
- if (options['selfDefending']) {
|
|
|
+ if (options.selfDefending) {
|
|
|
Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
|
|
|
}
|
|
|
return options;
|
|
|
}
|
|
|
}, {
|
|
|
- key: 'unicodeArrayRule',
|
|
|
+ key: "unicodeArrayRule",
|
|
|
value: function unicodeArrayRule(options) {
|
|
|
- if (!options['unicodeArray']) {
|
|
|
+ if (!options.unicodeArray) {
|
|
|
Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
|
|
|
}
|
|
|
return options;
|
|
|
}
|
|
|
}, {
|
|
|
- key: 'unicodeArrayThresholdRule',
|
|
|
+ key: "unicodeArrayThresholdRule",
|
|
|
value: function unicodeArrayThresholdRule(options) {
|
|
|
var minValue = 0,
|
|
|
maxValue = 1;
|
|
|
- options['unicodeArrayThreshold'] = Math.min(Math.max(options['unicodeArrayThreshold'], minValue), maxValue);
|
|
|
+ options.unicodeArrayThreshold = Math.min(Math.max(options.unicodeArrayThreshold, minValue), maxValue);
|
|
|
return options;
|
|
|
}
|
|
|
}]);
|
|
@@ -2285,8 +2285,6 @@ exports.LiteralObfuscator = LiteralObfuscator;
|
|
|
"use strict";
|
|
|
"use strict";
|
|
|
|
|
|
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
|
|
-
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -2350,18 +2348,11 @@ var MemberExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
}, {
|
|
|
key: 'obfuscateLiteralProperty',
|
|
|
value: function obfuscateLiteralProperty(node) {
|
|
|
- switch (_typeof(node.value)) {
|
|
|
- case 'string':
|
|
|
- if (node['x-verbatim-property']) {
|
|
|
- break;
|
|
|
- }
|
|
|
- node['x-verbatim-property'] = {
|
|
|
- content: this.replaceLiteralValueWithUnicodeValue(node.value),
|
|
|
- precedence: escodegen.Precedence.Primary
|
|
|
- };
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ if (typeof node.value === 'string' && !node['x-verbatim-property']) {
|
|
|
+ node['x-verbatim-property'] = {
|
|
|
+ content: this.replaceLiteralValueWithUnicodeValue(node.value),
|
|
|
+ precedence: escodegen.Precedence.Primary
|
|
|
+ };
|
|
|
}
|
|
|
}
|
|
|
}]);
|
|
@@ -2444,8 +2435,6 @@ exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;
|
|
|
"use strict";
|
|
|
"use strict";
|
|
|
|
|
|
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
|
|
-
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -2492,18 +2481,11 @@ var ObjectExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
}, {
|
|
|
key: 'obfuscateLiteralPropertyKey',
|
|
|
value: function obfuscateLiteralPropertyKey(node) {
|
|
|
- switch (_typeof(node.value)) {
|
|
|
- case 'string':
|
|
|
- if (node['x-verbatim-property']) {
|
|
|
- break;
|
|
|
- }
|
|
|
- node['x-verbatim-property'] = {
|
|
|
- content: Utils_1.Utils.stringToUnicode(node.value),
|
|
|
- precedence: escodegen.Precedence.Primary
|
|
|
- };
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ if (typeof node.value === 'string' && !node['x-verbatim-property']) {
|
|
|
+ node['x-verbatim-property'] = {
|
|
|
+ content: Utils_1.Utils.stringToUnicode(node.value),
|
|
|
+ precedence: escodegen.Precedence.Primary
|
|
|
+ };
|
|
|
}
|
|
|
}
|
|
|
}, {
|