Preserve the get syntax semantic.
The getter property converted to function when --transform-object-keys true enabled.
Obfuscate the following source code
"use strict";
const agents = {
get http() {
return 'http';
},
get https() {
return 'https';
},
};
by cli command line
javascript-obfuscator lib/http/test.js --output lib/http/test.bin.js --compact false --transform-object-keys true
got the following output
const a0_0x3677 = [
'http',
'https'
];
(function (_0x257c1e, _0x3677f0) {
const _0x414abf = function (_0x31802c) {
while (--_0x31802c) {
_0x257c1e['push'](_0x257c1e['shift']());
}
};
_0x414abf(++_0x3677f0);
}(a0_0x3677, 0x101));
const a0_0x414a = function (_0x257c1e, _0x3677f0) {
_0x257c1e = _0x257c1e - 0x0;
let _0x414abf = a0_0x3677[_0x257c1e];
return _0x414abf;
};
'use strict';
const a0_0x2057e1 = {};
a0_0x2057e1[a0_0x414a('0x1')] = function () {
return a0_0x414a('0x1');
}, a0_0x2057e1[a0_0x414a('0x0')] = function () {
return a0_0x414a('0x0');
};
const agents = a0_0x2057e1;
Released as 1.10.1
It works now! Many thanks! 馃憤