mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
`stringArrayEncoding` option now accepts an array of encodings. Each string will be randomly encoded with passed encoding.
29 lines
774 B
TypeScript
29 lines
774 B
TypeScript
'use strict';
|
|
|
|
import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
|
|
|
|
(function () {
|
|
const JavaScriptObfuscator: any = require('../../index');
|
|
|
|
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
|
|
`
|
|
var string1 = 'foo';
|
|
var string2 = 'bar';
|
|
var string3 = 'baz';
|
|
var string4 = 'bark';
|
|
|
|
console.log(string1, string2, string3, string4);
|
|
`,
|
|
{
|
|
...NO_ADDITIONAL_NODES_PRESET,
|
|
compact: false,
|
|
stringArray: true,
|
|
stringArrayThreshold: 1,
|
|
stringArrayEncoding: []
|
|
}
|
|
).getObfuscatedCode();
|
|
|
|
console.log(obfuscatedCode);
|
|
console.log(eval(obfuscatedCode));
|
|
})();
|