mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
dev
This commit is contained in:
Vendored
+4
@@ -42,7 +42,11 @@ class Utils {
|
||||
}
|
||||
static stringToUnicode(string) {
|
||||
const radix = 16, unicodeSliceValue = -4;
|
||||
let regexp = new RegExp('[a-zA-Z]');
|
||||
return `'${string.replace(/[\s\S]/g, (escape) => {
|
||||
if (regexp.test(escape)) {
|
||||
return '\\x' + escape.charCodeAt(0).toString(radix);
|
||||
}
|
||||
return `\\u${('0000' + escape.charCodeAt(0).toString(radix)).slice(unicodeSliceValue)}`;
|
||||
})}'`;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -35,7 +35,7 @@ let obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
|
||||
console.log('inside', abc.item);
|
||||
}
|
||||
|
||||
console.log('between', abc);
|
||||
console.log('тест', abc);
|
||||
|
||||
var abc = {};
|
||||
|
||||
|
||||
@@ -100,7 +100,13 @@ export class Utils {
|
||||
const radix: number = 16,
|
||||
unicodeSliceValue: number = -4;
|
||||
|
||||
let regexp: RegExp = new RegExp('[a-zA-Z]');
|
||||
|
||||
return `'${string.replace(/[\s\S]/g, (escape: string): string => {
|
||||
if (regexp.test(escape)) {
|
||||
return '\\x' + escape.charCodeAt(0).toString(radix);
|
||||
}
|
||||
|
||||
return `\\u${('0000' + escape.charCodeAt(0).toString(radix)).slice(unicodeSliceValue)}`;
|
||||
})}'`;
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
|
||||
console.log('inside', abc.item);
|
||||
}
|
||||
|
||||
console.log('between', abc);
|
||||
console.log('тест', abc);
|
||||
|
||||
var abc = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user