mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
moving from format-unicorn on string-template package
This commit is contained in:
+6
-3
@@ -37,14 +37,17 @@ if (!(<any>global)._babelPolyfill) {
|
||||
|
||||
function t () {
|
||||
return function () {
|
||||
return 100 * 2;
|
||||
return 100 * 2 - 70;
|
||||
}
|
||||
}
|
||||
|
||||
var s = 100 + 50;
|
||||
var n = 100 + 50;
|
||||
var b = true + true;
|
||||
var s = 'str' + 'ing';
|
||||
var r = /re/ + /g/;
|
||||
|
||||
console.log(t()());
|
||||
console.log(s);
|
||||
console.log(n);
|
||||
})();
|
||||
`,
|
||||
Object.assign({}, NO_CUSTOM_NODES_PRESET, {
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import 'format-unicorn';
|
||||
import * as format from 'string-template';
|
||||
|
||||
import { DomainLockNodeTemplate } from '../../../../../src/templates/custom-nodes/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate';
|
||||
|
||||
@@ -14,7 +14,7 @@ const assert: Chai.AssertStatic = require('chai').assert;
|
||||
* @returns {Function}
|
||||
*/
|
||||
function getFunctionFromTemplate (templateData: any, callsControllerFunctionName: string, currentDomain: string) {
|
||||
let domainLockTemplate: string = DomainLockNodeTemplate().formatUnicorn(templateData);
|
||||
let domainLockTemplate: string = format(DomainLockNodeTemplate(), templateData);
|
||||
|
||||
return Function(`
|
||||
document = {
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import 'format-unicorn';
|
||||
import * as format from 'string-template';
|
||||
|
||||
import { AtobTemplate } from '../../../../../src/templates/custom-nodes/AtobTemplate';
|
||||
import { Rc4Template } from '../../../../../src/templates/custom-nodes/Rc4Template';
|
||||
@@ -23,7 +23,7 @@ function getFunctionFromTemplateBase64Encoding (
|
||||
stringArrayCallsWrapperName: string,
|
||||
index: string
|
||||
) {
|
||||
let stringArrayCallsWrapperTemplate: string = StringArrayCallsWrapperTemplate().formatUnicorn(templateData);
|
||||
let stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), templateData);
|
||||
|
||||
return Function(`
|
||||
var ${stringArrayName} = ['${Utils.btoa('test1')}'];
|
||||
@@ -49,7 +49,7 @@ function getFunctionFromTemplateRc4Encoding (
|
||||
index: string,
|
||||
key: string
|
||||
) {
|
||||
let stringArrayCallsWrapperTemplate: string = StringArrayCallsWrapperTemplate().formatUnicorn(templateData);
|
||||
let stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), templateData);
|
||||
|
||||
return Function(`
|
||||
var ${stringArrayName} = ['${Utils.btoa(Utils.rc4('test1', key))}'];
|
||||
@@ -63,12 +63,12 @@ function getFunctionFromTemplateRc4Encoding (
|
||||
describe('StringArrayCallsWrapperNodeTemplate (): string', () => {
|
||||
let stringArrayName: string = 'stringArrayName',
|
||||
stringArrayCallsWrapperName: string = 'stringArrayCallsWrapperName',
|
||||
atobDecodeNodeTemplate: string = StringArrayBase64DecodeNodeTemplate().formatUnicorn({
|
||||
atobDecodeNodeTemplate: string = format(StringArrayBase64DecodeNodeTemplate(), {
|
||||
atobPolyfill: AtobTemplate(),
|
||||
selfDefendingCode: '',
|
||||
stringArrayCallsWrapperName
|
||||
}),
|
||||
rc4DecodeNodeTemplate: string = StringArrayRc4DecodeNodeTemplate().formatUnicorn({
|
||||
rc4DecodeNodeTemplate: string = format(StringArrayRc4DecodeNodeTemplate(), {
|
||||
atobPolyfill: AtobTemplate(),
|
||||
rc4Polyfill: Rc4Template(),
|
||||
selfDefendingCode: '',
|
||||
|
||||
Reference in New Issue
Block a user