mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
boolan values to JSFuck convert
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
const Utils_1 = require("../Utils");
|
||||
exports.JSFuck = Utils_1.Utils.strEnumify({
|
||||
False: '![]',
|
||||
True: '!![]'
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Utils } from "../Utils";
|
||||
|
||||
export const JSFuck: any = Utils.strEnumify({
|
||||
False: '![]',
|
||||
True: '!![]'
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
"use strict";
|
||||
const JSFuck_1 = require("../enums/JSFuck");
|
||||
const NodeUtils_1 = require("../NodeUtils");
|
||||
const Utils_1 = require('../Utils');
|
||||
class NodeObfuscator {
|
||||
@@ -15,10 +16,7 @@ class NodeObfuscator {
|
||||
}
|
||||
}
|
||||
replaceLiteralBooleanByJSFuck(nodeValue) {
|
||||
if (nodeValue) {
|
||||
return '!![]';
|
||||
}
|
||||
return '![]';
|
||||
return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
|
||||
}
|
||||
replaceLiteralNumberByHexadecimalValue(nodeValue) {
|
||||
const prefix = '0x';
|
||||
|
||||
@@ -2,6 +2,8 @@ import { INode } from '../interfaces/INode';
|
||||
import { INodeObfuscator } from '../interfaces/INodeObfuscator';
|
||||
import { ITreeNode } from "../interfaces/nodes/ITreeNode";
|
||||
|
||||
import { JSFuck } from "../enums/JSFuck";
|
||||
|
||||
import { NodeUtils } from "../NodeUtils";
|
||||
import { Utils } from '../Utils';
|
||||
|
||||
@@ -47,11 +49,7 @@ export abstract class NodeObfuscator implements INodeObfuscator {
|
||||
* @returns {string}
|
||||
*/
|
||||
protected replaceLiteralBooleanByJSFuck (nodeValue: boolean): string {
|
||||
if (nodeValue) {
|
||||
return '!![]';
|
||||
}
|
||||
|
||||
return '![]';
|
||||
return nodeValue ? JSFuck.True : JSFuck.False;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user