Skip to content

Commit db63b60

Browse files
committed
Fix javascript-obfuscator handling to use the latest method
1 parent d99132e commit db63b60

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/nodegen.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function function2node(data, options) {
244244
var nodeTemplate = fs.readFileSync(path.join(__dirname, '../templates/function/node.js.mustache'), 'utf-8');
245245
var nodeSourceCode = mustache.render(nodeTemplate, params);
246246
if (options.obfuscate) {
247-
nodeSourceCode = obfuscator.obfuscate(nodeSourceCode, { stringArrayEncoding: 'rc4' });
247+
nodeSourceCode = obfuscator.obfuscate(nodeSourceCode, { stringArrayEncoding: 'rc4' }).getObfuscatedCode();
248248
}
249249
fs.writeFileSync(path.join(data.dst, data.module, 'node.js'), nodeSourceCode);
250250

@@ -386,7 +386,7 @@ function swagger2node(data, options) {
386386
beautify: false
387387
});
388388
if (options.obfuscate) {
389-
nodejsSourceCode = obfuscator.obfuscate(nodejsSourceCode, { stringArrayEncoding: 'rc4' });
389+
nodejsSourceCode = obfuscator.obfuscate(nodejsSourceCode, { stringArrayEncoding: 'rc4' }).getObfuscatedCode();
390390
}
391391
fs.writeFileSync(path.join(data.dst, data.module, 'lib.js'), nodejsSourceCode);
392392

@@ -456,7 +456,7 @@ function swagger2node(data, options) {
456456
beautify: false
457457
});
458458
if (options.obfuscate) {
459-
nodeSourceCode = obfuscator.obfuscate(nodeSourceCode, { stringArrayEncoding: 'rc4' });
459+
nodeSourceCode = obfuscator.obfuscate(nodeSourceCode, { stringArrayEncoding: 'rc4' }).getObfuscatedCode();
460460
}
461461
fs.writeFileSync(path.join(data.dst, data.module, 'node.js'), nodeSourceCode);
462462

@@ -759,7 +759,7 @@ function wottd2node(data, options) {
759759
const nodeTemplate = fs.readFileSync(path.join(__dirname, '../templates/webofthings/node.js.mustache'), 'utf-8');
760760
let nodeSourceCode = mustache.render(nodeTemplate, data);
761761
if (options.obfuscate) {
762-
nodeSourceCode = obfuscator.obfuscate(nodeSourceCode, { stringArrayEncoding: 'rc4' });
762+
nodeSourceCode = obfuscator.obfuscate(nodeSourceCode, { stringArrayEncoding: 'rc4' }).getObfuscatedCode();
763763
}
764764
fs.writeFileSync(path.join(data.dst, data.module, 'node.js'), nodeSourceCode);
765765

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"cldr": "5.5.4",
4747
"colors": "1.4.0",
4848
"csv-string": "3.1.8",
49-
"javascript-obfuscator": "0.27.2",
49+
"javascript-obfuscator": "0.28.1",
5050
"jimp": "0.9.6",
5151
"js-string-escape": "1.0.1",
5252
"minimist": "1.2.5",

0 commit comments

Comments
 (0)