mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
refactoring
This commit is contained in:
+3
-2
@@ -30,10 +30,11 @@ class NodeObfuscator {
|
||||
return `${prefix}${Utils_1.Utils.decToHex(nodeValue)}`;
|
||||
}
|
||||
replaceLiteralStringByUnicodeArrayCall(nodeValue) {
|
||||
let value = Utils_1.Utils.stringToUnicode(nodeValue), unicodeArray = this.nodes.get('unicodeArrayNode').getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex;
|
||||
let value = Utils_1.Utils.stringToUnicode(nodeValue);
|
||||
let unicodeArray = this.nodes.get('unicodeArrayNode').getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex;
|
||||
if (sameIndex < 0) {
|
||||
index = unicodeArray.length;
|
||||
unicodeArray.push(Utils_1.Utils.stringToUnicode(nodeValue));
|
||||
unicodeArray.push(value);
|
||||
}
|
||||
else {
|
||||
index = sameIndex;
|
||||
|
||||
@@ -86,15 +86,16 @@ export abstract class NodeObfuscator implements INodeObfuscator {
|
||||
* @returns {string}
|
||||
*/
|
||||
protected replaceLiteralStringByUnicodeArrayCall (nodeValue: string): string {
|
||||
let value: string = Utils.stringToUnicode(nodeValue),
|
||||
unicodeArray: string[] = this.nodes.get('unicodeArrayNode').getNodeData(),
|
||||
let value: string = Utils.stringToUnicode(nodeValue);
|
||||
|
||||
let unicodeArray: string[] = this.nodes.get('unicodeArrayNode').getNodeData(),
|
||||
sameIndex: number = unicodeArray.indexOf(value),
|
||||
index: number,
|
||||
hexadecimalIndex: string;
|
||||
|
||||
if (sameIndex < 0) {
|
||||
index = unicodeArray.length;
|
||||
unicodeArray.push(Utils.stringToUnicode(nodeValue));
|
||||
unicodeArray.push(value);
|
||||
} else {
|
||||
index = sameIndex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user